Keck-DataReductionPipelines / KCWI_DRP

KCWI python DRP
BSD 3-Clause "New" or "Revised" License
8 stars 12 forks source link

Flat fielding master flat construction #101

Open prusinski opened 2 years ago

prusinski commented 2 years ago

In the flat fielding process, the DRP takes in twilight, dome, and internal flats and makes master versions of each. In the CorrectIllumination class, does the reduction use the twilight flats to correct the internals for large spatial variations, and then use that corrected flat as the “master” flat? I haven’t noticed an EXTERNAL_FLAT flag in the python version - is there a way to have the DRP favor the twilight/dome flats like the IDL version?

MNBrod commented 2 years ago

The flats are handled independently in the pipeline. The internal flats are corrected for vignetting, but that is done by fitting other parts of the flat. It is hoped that when KCWI is upgraded with KCRM, the vignetting will be removed. The best way I know of to select certain types flats is to make the other flats unavailable to the pipeline. I usually do this with subdirectories called "dflats", "tflats" and "cflats". You can copy or link the appropriate files into the main directory to try different types of flats in the reduction. (Don)

I'll make this a feature request, although we likely won't get to it in the next couple weeks. It's useful functionality to have, and shouldn't be too hard to implement. In the meantime, I would use the workaround above.

prusinski commented 2 years ago

Sounds good, thank you! There's obviously no rush given that we can already choose what files to use if need be.

I guess I'm curious if the reduction has all three master flats (internal, dome, twilight), how it goes about correcting the science frames (to construct the *intf.fits files). Does it choose one particular master flat by which to divide the science frames or does it still incorporate all three masters (after they've been independently corrected of course)?

scizen9 commented 2 years ago

No. It only uses the internal flat if that is available. The priority order is:

  1. cont flat
  2. twilight flat
  3. dome flat
prusinski commented 2 years ago

Okay, I see - thanks!