Flat field the data (PIPE2D-10)

[PIPE2D-81] Design access mechanism, dataset types for accessing flats from Butler Created: 10/Sep/16  Updated: 07/Oct/16  Resolved: 07/Oct/16

Status: Done
Project: DRP 2-D Pipeline
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Sub-task Priority: Major
Reporter: swinbank Assignee: aritter
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to PIPE2D-47 make FiberTrace persistable Done
relates to PIPE2D-68 Add FiberTrace to data model Done
Sprint: 2014-17
Reviewers: rhl

 Description   

Need to be able to retrieve dithered flats, aperture definition flats (equivalent to dither=0), etc. One option is to load all flats from the Butler and sort them out in Python code; another is to define separate dataset types, or do something clever with DataIds. Please:

  • Write down all the different types of flats you expect to be working with;
  • Produce a straw-man design for how you want to organize them.


 Comments   
Comment by aritter [ 22/Sep/16 ]

We will be working with dispersed Flats only, no photometric Flats. There is 2 kinds of dispersed Flats:

  • no offset in x for aperture definition (identification of tracing of the FiberTrace apertures)
  • dithered Flats for the construction of normalized Flats to take out the pixel-to-pixel sensitivity variations (~10 different offsets in x)
    We need a header keyword that tells us the shift in x: 0 for no shift +/- xShift. Currently this header keyword is "sim.slit.xoffset". We might want to change that to "slit.xoffset" or something similar.

Flat calibration products are:

  • a combined Flat with 0 xOffset for the aperture definition. I propose to call this calibration file "apDef" and add an apDef file to the data model and the mapper, following the standard file names and mapper entries for calibration products. According to the data model the file names should be
    "pfsApDef-%06d-%1d%1s.fits" % (visit0, spectrograph, arm)
  • a normalized Flat which I propose to call "Flat" and stick to the definition in the data model and mapper.

Tasks to create the calibration products:

  • I propose to add a CalibTask "constructApDefTask" which searches for Flats with xOffset=0, runs the ISR, and combines multiple exposures to remove cosmic rays which could irritate the tracing procedure
  • The normalized Flat is being constructed by the CalibTask "constructNormFlatTask", which already exists. Preferably multiple exposures of each xOffset should be combined to get rid of cosmic rays. Combination of multiple exposures with the same xOffset is not yet implemented.
Comment by rhl [ 24/Sep/16 ]

Why do we need your "apDef" files? We will be persisting the traces, not the files that go into their generation. See PIPE2D-47 and PIPE2D-68 (which I have linked to this ticket). I think that this ticket needs to define how to get the butler to read and write the persisted traces, and that includes defining their format in the data model – it's in as a placeholder,

"pfsFiberTrace-%06d-%1d%1s.fits" % (visit0, spectrograph, arm)

but without any specification of the format beyond TBD.

It's fine to keep the processed dithered flats as "Flat" in the data model. When you sort out the header keywords, provenance, etc. that'll need to be added to the data model description.

Comment by rhl [ 24/Sep/16 ]

Is there a ticket to handle multiple offsets with the same x, and CR removal etc.? If not, please file one.

Comment by aritter [ 30/Sep/16 ]

In the discussion with Craig we found that we will also have image Flats (no spectrograph), at least until the CCDs are permanently mounted in the spectrographs. These image Flats (short imFlats) will be used to include pixel-to-pixel sensitivity variations in the simulations, and to look for CCD defects. However, we both agreed that we won't need a new datamodel entry for these imFlats as they can easily be constructed by running the standard ISR and then median combine the postISR images.
As Robert correctly points out we don't need apDef Files as we will persist the FiberTraceSets, so really the only Flat we need to persist is the normalized Flat. For the creation of the FiberTraceSets we will write a CalibTask that starts with the raw (dithered) Flats, finds the Flats with xOffset=0.0, runs the ISR, combines them, and traces the apertures.

Comment by aritter [ 05/Oct/16 ]

After discussion with RHL and Craig we decided to persist both image Flats and fiber Flats. The current 'Flat' will be renamed 'fiberFlat' to avoid confusion once and for all.

Generated at Sat Feb 10 15:48:13 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.