findslope
- jwst.ami.utils.findslope(a)[source]
Find slopes of an array.
- Parameters:
- a2D float array
Phase slope array
- Returns:
- slopes2D float array
Slopes
Notes
Find slopes of an array, over pixels not bordering the edge of the array. There should be valid data on either side of every pixel selected by the mask m. a is in radians of phase (in Fourier domain) when used in NRM/KP applications. The std dev of the middle 9 pixels is used to clean the mask of invalid slope data, where we’re subtracting inside-mask-support from outside-mask-support. This mask is called newmask. Converting tilt in radians per Fourier Domain (eg pupil_ACF) pixel Original Domain (eg image intensity) pixels:
If the tilt[0] is 2 pi radians per ODpixel you recover the same OD array you started with. That means you shifted the ODarray one full lattice spacing, the input array size, so you moved it by OD.shape[0].
2 pi/FDpixel of phase slope => ODarray.shape[0] 1 rad/FDpixel of phase slope => ODarray.shape[0]/(2 pi) shift x rad/FDpixel of phase slope => x * ODarray.shape[0]/(2 pi) ODpixels shift
- Gain between rad/pix phase slope and original domain pixels is
a.shape[0 or 1]/(2 pi)
- Multiply the measured phase slope by this gain for pixels of incoming array
centroid shift away from array center.