Incorrect Indexing in the Defringe User's Guide
Closed this issue · 0 comments
dougbrn commented
In step 1 of the Defringe User's Guide, code is provided to demonstrate how the user would flatten the blue end of the flat field where the fringe pattern is not as intense:
# Flatten the blue end of the flat-field image [ONLY FOR G750L]
with fits.open(f"{flat_file}_nsp.fits") as hdulist:
hdulist[1].data[:250,:] = 1
hdulist.writeto(f"{flat_file}_nsp.fits",overwrite=True)
The indexing in the data call is reversed, flattening the bottom of the image, due to Python ordering arrays as [y,x]. This should be corrected to:
# Flatten the blue end of the flat-field image [ONLY FOR G750L]
with fits.open(f"{flat_file}_nsp.fits") as hdulist:
hdulist[1].data[:,:250] = 1
hdulist.writeto(f"{flat_file}_nsp.fits",overwrite=True)
Credit to Svea Hernandez for finding this issue.