roman-corgi / corgidrp

Data Reduction Pipeline for the Roman Coronagraph Instrument
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

ability for desmear step function to determine if desmearing is worthwhile based on inputs #176

Open kjl0025 opened 3 months ago

kjl0025 commented 3 months ago

Is your feature request related to a problem? Please describe. For calibrating a synthetic master dark, some frames in the input dataset may need to be desmeared while others may not. An edit to the structure of the walker could be done to handle this, or we could add optional inputs to the desmear step function to handle this. This would also be useful for a regular (non-calibration) dataset as well; instead of having the user separately figure out if desmearing is appropriate before specifying a recipe for the dataset, the step function could handle it automatically.

Describe the solution you'd like There could be inputs for expected values, in e- units, for mean FPN (or perhaps max value for FPN since it may have a mean of 0), read noise, mean CIC, and mean dark current. If these are not specified, they could be taken from a specified synthesized master dark if appropriate. (In the context of a recipe for making a synthesized master dark, the user would specify the numbers in the aforementioned inputs.) If none of these are specified, the step function makes no recommendation. Based on these inputs and the EM gain and exposure time used for a given frame, the step function would determine how far above the values to be subtracted in the desmearing are compared to the non-smeared noise. If significantly above (determined by an optional input, number of standard deviations which could default to 2 maybe), the desmearing is recommended. Then there could be an override flag (True or False) to override the step function's recommendation to smear or not.

Additional context If there are cases where a user wants to override the desmear step function's recommendations for only a subset of frames in a dataset, then I think a change to the walker's structure would be needed. This would also be true for any other step function for which a user wants different keyword arguments per frame in an input dataset.

semaphoreP commented 3 months ago

Is this something you want to try to get in this release? Or is this a longer-term project?

kjl0025 commented 3 months ago

It's not necessary for this release. Just a longer-term project.