Computes the bias and the readout noise on the prescan region. More...
Public Member Functions | |
def | __init__ |
Make a Hermes component and initialize variables. | |
def | optionsAreValid |
checks user options | |
def | __call__ |
runs from here | |
Public Member Functions inherited from hermes.pipeline.core.pipelinecomponent.PipelineComponent | |
def | __init__ |
def | __call__ |
def | optionsAreValid |
def | getOptions |
def | setOptions |
def | checkExistShapeUnits |
def | isOption |
Public Attributes | |
isDebug | |
user may want intermediary result images in debug folder More... | |
prescanRejectFactor | |
reject factor | |
prescanFilDim | |
filter dimension | |
constantBias | |
constantBias can be "yes" or "no" or "model". More... | |
results | |
Public Attributes inherited from hermes.pipeline.core.pipelinecomponent.PipelineComponent | |
options | |
logger | |
ConsoleLogSeverity | |
default value | |
canShowGraphics | |
when machine does not run matplotlib. More... | |
Computes the bias and the readout noise on the prescan region.
PURPOSE : Estimates bias level and read-out noise from analysis of prescan region. Comparison with default values for the bias level and the read-out noise are made. Note that the bias value in the prescan region is somewhat different from that on the illuminated part of the detector (see procedures to characterize the detector for the determination of the offset). COMMENTS : Outlying intensity values are counted and masked (in fact, they should not occur in the prescan region; if there are too many outliers, a warning will be generated). The read-out noise is computed taking into account a possible (slight) variation of the bias over the prescan region, by computation of a local estimate of the bias. IF the bias value is constant over the frame (as it should be), the procedure would be more robust when using a global estimate of the bias and not a local one. IF the bias value varies over the frame, and this cannot be avoided by hardware intervention, the procedure would be more robust when building a specific few-parameter model for the shape of the variation of the bias over the frame, rather than depending on a general local estimator for the bias value. SYNTAX : INPUT CONSTANTS FROM INSTRUMENT MODEL : position of prescan region defaultPrescanreadoutNoiseADU INPUT DATA FROM RESULTDICT : An observed image from self.results.rawImage (possibly the mean of a stack of images, and in that case the number of images in stack is given by "len(self.results["FITSFileNames"])"). The size of the input image is checked against the expected shape of a raw image. OPTIONS READ FROM OPTIONDICT : MANDATORY : OPTIONAL : constantBias == "no" or "yes" or "model" If absent, default value "yes" is used. prescanFilDim default value is 5 prescanRejectFactor default value is 4.0 OUTPUT : Values measured in the prescan region for bias and read-out noise, in self.results.prescanBiasADU and self.results.prescanReadoutNoiseADU, also written to self.results.header TODO : comment on messages in case of invalid input data or suspect frames
hermes.pipeline.components.computebiasprescan.computeBiasPrescan.constantBias |
constantBias can be "yes" or "no" or "model".
Default value is "yes".
hermes.pipeline.components.computebiasprescan.computeBiasPrescan.isDebug |
user may want intermediary result images in debug folder
Determine the prescan area from the complete frame.
first get the dimensions Then compare with the passed image size if allowedSize.shape == self.results["rawImage"].shape and self.results["imageUnits"] == "ADU": determine local estimate of bias (median over size of filter) medfilt2d causes a memory crash. let's use gc to clean up memory before. Force writing of debug file as this solves the problem When not in debug mode, remove the unnecessary debug file we had to write