Registering MagAO-X images when the star is saturated¶
Written by Logan Pearce, 2024, www.loganpearce.com
When a star is saturated on the detector, the exact center of the star and the total flux from the star can't be determined, since the photon buckets overflowed.
Let's load two example imagaes, one where the star saturated the detector and one where it did not.
import numpy as np
import matplotlib.pyplot as plt
unsat = fits.getdata('unsat.fits').astype('=f8')
sat = fits.getdata('sat.fits').astype('=f8')
fig,axes = plt.subplots(nrows=1, ncols=2)
axes[0].imshow(unsat, origin='lower')
axes[0].set_xlim(450,550)
axes[0].set_ylim(450,550)
axes[1].imshow(sat, origin='lower')
axes[1].set_xlim(450,550)
axes[1].set_ylim(500,600)
(500.0, 600.0)
Here we plot a slice of the image through the center of the star (noramlized b/c we don't care about flux values here) for each image.
plt.plot(range(unsat.shape[0]),unsat[:,503]/np.max(unsat), label='Unsaturated')
plt.plot(range(sat.shape[0]),sat[:,510]/np.max(sat), label='Saturated')
plt.legend(loc=(1.01,0))
plt.xlim(475,600)
plt.xlabel('Pixel')
Text(0.5, 0, 'Pixel')
The profile for the saturated star is cut off, making it impossible to fit a 2D Gaussian or use peak finding to find the location of the star. To register (center) these images for future analysis, we need another way to find the exact location of the star on the detector.
MagAO-X images have symmetric spikey speckles caused by the deformable mirror. They're always there, always in the same place relative to star (as a function of the filter wavelength). We can use these DM spikes to find the exact location of the star on the detector and register the images. We will use the four brightest speckles seen in this stretch of the saturated image.
from astropy.visualization import ImageNormalize, ZScaleInterval
norm = ImageNormalize(sat, interval=ZScaleInterval())
plt.imshow(sat, cmap='bone', norm=norm, origin="lower")
<matplotlib.image.AxesImage at 0x16d874610>