jbclean¶
- sofia_redux.instruments.forcast.jbclean.jbclean(data, header=None, variance=None, bar_spacing=16, width=4, mode='wrap')[source]¶
Removes “jailbar” artifacts from images
Filter the input data with a 16x16 box and remove the filtered image from the input image. Then, the jail bar is most of the features found in the subtracted image. We use this image to calculate the jail bar using median. This function checks the configuration file (dripconf.txt) for a preferred method. If JBCLEAN is set to fft, it does a Fourier transform of the image, to mask the 16-pixel periodic jailbar pattern. This median method appears to work better than the fft method in most cases and is recommended. If JBCLEAN is set to n, no jailbar correction is performed. Note that if JBCLEAN=fft, this function is called by sofia_redux.instruments.forcast.clean on raw frames; if JBCLEAN=median, this function is called by sofia_redux.instruments.forcast.stack, on the chop/nod subtracted frames.
Note: for now, it is assumed that the jailbar has no error, so the variance, if passed, is not modified.
- Parameters:
- datanumpy.ndarray
Input data array (nrow, ncol)
- headerastropy.io.fits.header.Header, optional
Input header; will be updated with HISTORY message
- variancenumpy.ndarray, optional
Variance array (nrow, ncol) to update in parallel with the data array
- bar_spacingint, optional
known jailbar spacing between columns
- widthint, optional
Only applies if JBCLEAN=median. See
jbmedian
for details- modestr, optional
Specifies the edge handling mode for median filter. Only applies if JBCLEAN=median.
- Returns:
- numpy.ndarray, numpy.ndarray
Jailbar-cleaned array (nimage, nrow, ncol) or (nrow, ncol) Propagated variance (nimage, nrow, ncol) or (nrow, ncol)