ZOGY icon indicating copy to clipboard operation
ZOGY copied to clipboard

Bug in ZOGY?

Open plirat opened this issue 3 years ago • 1 comments

Hello,

I seem to have found a bug in ZOGY when run without providing mask images. The problem results when trying to update the header of the mask fits file during remapping since although the data for the mask is created the fits file is not. My solution was to change prep_optimal_subtraction as follows :

# create new mask or modify an existing one
# determine data_mask
if fits_mask is not None:
    # read in mask image
    data_mask = read_hdulist (fits_mask, dtype='uint8')
    data_mask = create_modify_mask (data_wcs, satlevel, data_mask=data_mask)
else:
    data_mask = None
    data_mask = create_modify_mask (data_wcs, satlevel, data_mask=data_mask)
    fits_mask = input_fits.replace('.fits', '_mask.fits')
    header_mask = read_hdulist (input_fits, get_data=False, get_header=True)
    fits.writeto (fits_mask, data_mask, header_mask, overwrite=True) 

Please, let me know if you have any comments.

Cheers, Paulina

plirat avatar Dec 23 '21 17:12 plirat

Dear Paulina,

Thanks very much for pointing out this bug! I’ve just updated zogy.py with your suggestions and pushed it to the GitHub repository.

Best wishes, Paul

On 23 Dec 2021, at 18:22, plirat @.***> wrote:

Hello,

I seem to have found a bug in ZOGY when run without providing mask images. The problem results when trying to update the header of the mask fits file during remapping since although the data for the mask is created the fits file is not. My solution was to change prep_optimal_subtraction as follows :

create new mask or modify an existing one

determine data_mask

if fits_mask is not None: # read in mask image data_mask = read_hdulist (fits_mask, dtype='uint8') data_mask = create_modify_mask (data_wcs, satlevel, data_mask=data_mask) else: data_mask = None data_mask = create_modify_mask (data_wcs, satlevel, data_mask=data_mask) fits_mask = input_fits.replace('.fits', '_mask.fits') header_mask = read_hdulist (input_fits, get_data=False, get_header=True) fits.writeto (fits_mask, data_mask, header_mask, overwrite=True)

Please, let me know if you have any comments.

Cheers, Paulina

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you are subscribed to this thread.

pmvreeswijk avatar Jan 05 '22 18:01 pmvreeswijk