Here’s the single-frame processing pipeline sketch we came up with today:
- ISR (instrument signature removal)
- Largest data unit: amp, then CCD (includes assembly).
- Run on Snaps independently.
- Flat field assuming sky SED.
- We’re guessing (hoping?) this includes all the brighter-fatter correction we need.
- Combine Snaps
- Largest data unit: CCD
- We’re expecting to just be able to add them, but that’s not guaranteed. If we have to warp and/or PSF-match, a lot needs to be changed (and maybe we should rethink the observing strategy).
- Could find and mask some cosmic rays here (by diffing); can’t interpolate them yet without the PSF.
- Detect+Background
- Largest data unit: CCD
- Only concerned with moderately bright stars at this point (i.e. inputs to PSF modeling); can make tradeoffs in the algorithms that adversely affect galaxies.
- Use wavefront sensors to provide a PSF size guess for detection.
- Measurement
- Largest data unit: CCD
- Only algorithms needed for star selection and PSF determination - aperture fluxes, centroider, 2nd-moments.
- Initial PSF Estimation
- Largest data unit: CCD
- Expect to use traditional, non-physical (e.g. PCA/polynomial) methods, or relatively simple extensions.
- This needs to include some approach to modeling the extended wings of stars.
- Repair CRs/Defects
- Largest data unit: CCD
- Run on Snaps independently; recombine afterwards.
- Can use both differences and morphology to find CRs.
- Need to use PSF model for interpolation as well as morphological CR detection (why we can’t do this in ISR).
- Resampling (?)
- Largest data unit: CCD
- We may need to resample some or all of the image at this stage to deal with astrometric features in the sensors (I don’t recall the name for the effect; perhaps @rhl can remind me - and expound).
- We can’t just roll these distortions into the WCS, because they’re not linear over the scale of the PSF.
- If we don’t correct for these effects, they could mess up downstream operations (like warping) that assume good sampling.
- It’s not clear whether we’ll have to do this, and if we do, how much of the image needs to be modified - it depends on sensor characteristics we haven’t really determined. The traditional approach has been to treat these astrometric effects as QE variation, which (mostly?) works for photometry, but doesn’t work for other measurements.
- Detect+Background (again)
- Largest data unit: CCD
- Lower threshold than last time, now only mostly concerned with stars.
- Can use the PSF model for detection smoothing
- Deblend?
- Largest data unit: CCD
- May not be necessary; depends on how faint we need to go here. Since these are still just for calibration purposes, we’d prefer isolated objects anyway.
- Measure (again)
- Largest data unit: CCD
- Can now use PSF-dependent algorithms.
- Still focused on measurements needed for calibration purposes (this is not what populates the final Source table).
- Need debiased centroid estimates.
- Match to External Catalog
- Largest data unit: Visit
- We expect some CCDs not to have enough well-measured objects; want to use full visit to recover them, since we know the relationship between CCDs in advance.
- Includes initial astrometric solution and initial photometric calibration.
Before we can actually continue to the final stage of Source measurement and detection, we’ll have to start other pipelines, because we’ll use them to find backgrounds, PSF estimation stars, and artifacts that we’ll want to use in the final SFM.
- Relative Calibration
- Largest data unit: all visits in an area of sky, size TBD
- This is a “local ubercal”; we don’t expect to need to use the entire sky at once, but that’s not completely ruled out.
- Solves for final astrometric solution (including small-scale atmospheric variations we can’t constrain from lab data or matching to Gaia)
- Solves for final photometric solution, including correction from raw DN (assuming sky SED we used for flat-fielding) to more reasonable nominal SEDs for objects.
- If we can’t rely on Gaia to tie the photometry together at large scales, we may need to have a larger-scale relative solver for that (Gaia will be definitely be sufficient for large scale astrometry).
- We may use galaxies for astrometry, but not for photometry.
- We might be able to identify our best set of stars to use for PSF estimation here, by matching stars considered for PSF estimation on individual frames. We’ll also find the true (per-epoch) centroids of PSF stars with proper motion, or at least be able to reject them.
- PSF-Matched Coaddition and Background Matching
- Largest data unit: all visits (sequentially?) within a patch
- This generates templates for difference images and coadds for aperture fluxes (which are either the same, or just different subsets of visits with the same processing, modulo DCR correction choices)
- We’ll do background matching at the same time, which (after we subtract the final background from the coadd) will allow us to compute our best background for individual visit images.
- Background matching will also give us an opportunity to identify artifacts, and because we’re making PSF-matched coadds we can also use per-pixel outlier rejection to help with this.
- Likelihood and/or direct coaddition and processing (?)
- Largest data unit: all visits (sequentially?) within a patch, patch
- Only need to do this before the final SFM if coadd processing is necessary to reject galaxies from the PSF estimation star catalog.
- Image Differencing
- Largest data unit: visits?
- May be necessary to find all artifacts and moving objects that we’ll need to flag in single-frame measurement; we have better sensitivity than we will in background matching because we don’t have to warp the science image here.
Once we’ve got a consistent PSF star catalog, good backgrounds, and good artifact masks from some combination of the above steps, we can complete single-frame processing:
- Final PSF Determination
- Largest data unit: visit (probably; some chance we could use multiple overlapping visits)
- This will be a much more sophisticated PSF modeling algorithm than what came before, mostly focused on requirements for weak lensing. Will likely use some sort of physical models and wavefront sensor data.
- Final Single Frame Measurement
- Largest data unit: CCD
- Need to have best PSFs here so we can run shear estimation codes for systematics tests and reject exposures with unconstrained PSFs/astrometry from multi-fit. Will not use shear estimation here for science, and we may not use the same algorithm we use later.
- Not clear what the other algorithmic requirements are here; we suspect that these measurements will be superceded by forced photometry or multi-fit for most science.
A few closing thoughts:
-
We forgot about aperture correction. Probably goes with initial PSF determination, and it’s closely related to modeling the wings of stars (they at least need to be consistent) but how to coadd that information is tricky.
-
We’re assuming here that the final PSF estimation is only needed by multi-fit, and hence it’s okay to make all coadds using the initial PSF. If we do need the final PSF when we build the coadds, but we can create a good PSF star catalog withing needing the coadds, then that’s easy - we just build coadds after we do the final PSF determination (which would still have to happen after relative calibration). If we do need the coadds to reject galaxies/binaries/etc. from the PSF star catalog and we can’t use the initial PSF to build the coadds, things get tricky; we’d either have to add another (final) round of coaddition or another (intermediate) round of PSF determination.
-
Given that the final PSF estimation and single-frame measurement stages happen completely separately from the image characterization stuff that happens earlier, and they may need to happen after we build coadds, it may make sense to try to accomplish these when we’re doing multi-fit, since that’s the next time we’d naturally be revisiting the individual visit images. The challenge would be that the PSF estimation at least will definitely need to operate on full visits (though maybe not with access to all of the pixels).