Skip to content

Commit

Permalink
Add extension names for the stamp fits files
Browse files Browse the repository at this point in the history
  • Loading branch information
e-koch committed Aug 15, 2024
1 parent abcf803 commit ea3aada
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fil_finder/filament.py
Original file line number Diff line number Diff line change
Expand Up @@ -1535,20 +1535,26 @@ def save_fits(self, savename, image, pad_size=20 * u.pix, header=None,
input_image = input_image.value.copy()

hdu = fits.PrimaryHDU(input_image, header)
hdu.name = 'IMAGE'

skel_hdr = header.copy()
skel_hdr['BUNIT'] = ("", "bool")
skel_hdr['COMMENT'] = "Skeleton created by fil_finder on " + \
time.strftime("%c")

skel_hdu = fits.ImageHDU(skels.astype(int), skel_hdr)
skel_hdu.name = 'SKELETON'

skel_lp_hdu = fits.ImageHDU(skels_lp.astype(int), skel_hdr)
skel_lp_hdu.name = 'SKELETON_LONGPATH'

model_hdu = fits.ImageHDU(model, header)
model_hdu.name = 'MODEL'

hdulist = fits.HDUList([hdu, skel_hdu, skel_lp_hdu, model_hdu])
hdulist.append(fits.table_to_hdu(tab))
tab_hdu = fits.table_to_hdu(tab)
tab_hdu.name = 'PIXEXTENTS'

hdulist = fits.HDUList([hdu, skel_hdu, skel_lp_hdu, model_hdu, tab_hdu])

hdulist.writeto(savename, **kwargs)

Expand Down

0 comments on commit ea3aada

Please sign in to comment.