Skip to content

Conversation

@mikelangmayr
Copy link
Contributor

@mikelangmayr mikelangmayr commented Dec 9, 2025

  • fix flat field results
  • return correction matrix and make saving of corrected flat image optional via parameter


@task(name="Process Single Flat Frame")
def process_single_flat_frame(flat_fits_path: str, output_dir: str):
def process_single_flat_frame(flat_fits_path: str, output_dir: str, save_corrected_flat: bool = False):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is a use case to correct the flat image itself by the master_flat and save the corrected flat. As far as I know it is not needed for any of the DRP steps. We just need the master flat.

Copy link

@Yashvi-Sharma Yashvi-Sharma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added some comments. Overall looks good! There are going to be ~5 flat frames (fits files) per CSU mask. So in the batch process function we need to add a step where a list of flat fits files that all belong to the same CSU mask are taken and median-combined, and that median-combined flat frame gets sent to process_single_flat_frame to create the master_flat (correction) for that CSU mask.

I don't think we need the save_flat_fits as a separate function that saves both the correction and can flat-field science images because by its name people won't know that it is the function that applies flat correction to science images. We can directly save the correction in process_single_flat_frame, and have a separate function/task called FlatField (or something similar) that takes as input science images and correction and returns corrected science images (idea being that this task gets called in batch_process_science_frames workflow).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants