# Outline of main processing step for current processCcd

**URL:** <https://www.rubin.community/t/outline-of-main-processing-step-for-current-processccd/448>\
**Category:** Data Management\
**Tags:** processccd\
**Created:** [December 15, 2015, 12:00am UTC](https://www.rubin.community/t/outline-of-main-processing-step-for-current-processccd/448 "2015-12-15T00:00:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nidever](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/nidever/32/29_2.png) [@nidever](https://www.rubin.community/u/nidever)\
**Post date:** [December 15, 2015, 12:00am UTC](https://www.rubin.community/t/outline-of-main-processing-step-for-current-processccd/448/1 "2015-12-15T00:00:43Z")

</div>

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](http://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)

---

<div class="post-metadata">

**Author:** ![rowen](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/rowen/32/52_2.png) [@rowen](https://www.rubin.community/u/rowen)\
**Post date:** [December 15, 2015, 12:32am UTC](https://www.rubin.community/t/outline-of-main-processing-step-for-current-processccd/448/2 "2015-12-15T00:32:04Z")

</div>

See [Requirements for overhauled calibration task?](http://www.rubin.community/t/requirements-for-overhauled-calibration-task/370/8) 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](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?](http://www.rubin.community/t/requirements-for-overhauled-calibration-task/370/8) or a discussion linked from there.
