Outline of main processing step for current processCcd

In preparation for the “initial PSF estimate” RFD discussion tomorrow, I’ve been digging into processCcd to figure out what it actually does. This is non-trivial since no good documentation currently exists for processCcd and there are lots of redirects in the code to subtasks. Here’s my attempt to unravel things. Corrections/improvements are welcome.

processCcd.py

  1. ISR (this happens in setPostIsrExposure using the retargeted isrtask set in jobs package)
  2. calibrate (if doCalibrate; by calibrateTask->pipe.taks.calibrate)
  • create initial PSF from configuration-defined guess (by calibrate.installInitialPsf)
  • repair defects but leave CRs in (by self.repair.run, subtask repair->pipe.tasks.repair)
  • estimate background (by measAlg.estimateBackground)
    • detection (by self.detection.makeSourceCatalog, subtask detection-> meas.algorithms.SourceDetectionTask)
    • measurement (by self.initialMeasurement.run, subtask initialMeasurement-> meas.base.SingleFrameMeasurementTask)
    • get initial PSF
      • if creating new PSF (doPSF)
        -astrometry/fit WCS (if doAastrometry; by astrometry.run, subtask astrometry-> meas.astrom.AstrometryTask), otherwise use original WCS
        -measure PSF (by self.measurePsf.run, subtask measurePsf-> pipe.tasks.measurePsf.MeasurePsfTask)
      • elseif there is an existing PSF use that (if hasPsf)
      • else no initial psf
    • repair CRs again with better PSF (if doPsf; by repair.run, subtask repair-> pipe.tasks.repair)
    • estimate background again ignored pixels affected by sources (if doBackground; by measAlg.estimateBackground)
    • measurement again (by self.measurement.run, subtask measurement-> meas.base.SingleFrameMeasurementTask)
      • do measurement with aperture correction (if doMeasureApCorr)
  • astrometry/fit WCS (if doAstrometry; by self.astrometry.run, subtask astrometry-> meas.astrom.AstrometryTask)
  • photometric calibration (if doPhotCal; by self.photocal.run, subtask photocal-> pipe.tasks.photoCal.PhotoCalTask)
  1. process the image (via ProcessImageTask)
  • detection (if doDetection; by self.detection.run, subtask detection-> meas.algorithms.SourceDetectionTask)
  • deblend (if doDeblend; by self.deblend.run, subtask deblend-> meas.deblender.SourceDeblendTask)
  • measurement (if doMeasurement; by self.measurement.run, subtask measurement-> meas.base.SingleFrameMeasurementTask)
2 Likes

See Requirements for overhauled calibration task? for a map of what processCcd.py is likely to do after refactoring CalibrateTask. @jbosch’s suggestion near the end seems likely to be adopted.

Also, I am keeping https://jira.lsstcorp.org/browse/DM-4692 up to date with what I am actually implementing. Comments are welcome, but preferably on this forum using Requirements for overhauled calibration task? or a discussion linked from there.