make_flattened_ramp_flt
- wfc3tools.wfc3ir_tools.make_flattened_ramp_flt(raw_file, stats_subregion=None, stats_method='median', sigma_clip=False, sigma=None, sigma_upper=None, sigma_lower=None, iters=None)[source]
Corrects for non-variable background and produce a ‘flattened’ FLT and IMA.
This function must run in the working directory with data files. CRCORR value in RAW will be temporarily changed; if you are worried about the integrity of RAW contents, please keep a pristine copy elsewhere.
Users supply a RAW file, which is used to create an IMA file with calwf3 with the CRCORR switch set to OMIT. Then, the average background level from each read of the IMA is subtracted from the read, and later added back to the full exposure to preserve pixel statistics. Finally, calwf3 is run again on the flattened IMA to produce an FLT.
Note that if the RAW file is part of an association, the ASN file must be in the same directory as the RAW file. If ASN_TAB is NONE, a dummy ASN file will be created in the working directory.
Users may provide a region for the median to be computed, otherwise this will default to the median over the whole image excluding the 5 pixel overscan region on the border.
The following output files will be created:
dummy_asn.fits(if dummy ASN is needed for processing)<rootname>_ima.fits(flattened IMA as described above)<rootname>_flt.fits(FLT from flattened IMA)<rootname>_flc.fits(if PCTECORR is done)<rootname>.tra(trailer file from calwf3 run on flattened IMA)
- Parameters:
- raw_filestr
RAW filename.
- stats_subregiontuple or None
Tuple of
((xmin, xmax), (ymin, ymax))to specify region for average calculation. Defaults to whole image, excluding the 5-pixel overscan region.- stats_methodstr
Method of stats computation on each read when subtracting the average to flatten. Must be ‘mean’ or ‘median’. Defaults to ‘median’.
- sigma_clipbool
If True, data will be sigma-clipped when computing stats. Defaults to False.
- sigmaint or None
The number of standard deviations to use as the lower and upper clipping limit. This is ignored when
sigma_clip=Falseand must be set to a number ifsigma_clip=True. Defaults to None.- sigma_upperint or None
The number of standard deviations to use as the upper bound for the clipping limit. This is ignored when
sigma_clip=False. If None whensigma_clip=True, then the value ofsigmais used. Defaults to None.- sigma_lowerint or None
The number of standard deviations to use as the lower bound for the clipping limit. This is ignored when
sigma_clip=False. If None whensigma_clip=True, then the value ofsigmais used. Defaults to None.- itersint or None
The number of iterations to perform sigma clipping. This is ignored when
sigma_clip=Falseand must be set to a number ifsigma_clip=True. Defaults to None.