Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-19852: Copy SkySubtractionTask from pipe_drivers #707

Merged
merged 22 commits into from Jul 29, 2022
Merged

Conversation

timj
Copy link
Member

@timj timj commented Jul 29, 2022

No description provided.

PaulPrice and others added 21 commits July 28, 2022 21:29
We combine a large-scale background model and a scaled sky frame and
write a background model consisting of these (and un-doing the original)
that can be used downstream to correct the calexp.  This does a decent job
over most of the field of view of HSC.
This provides a facility to produce a binned image of the entire focal
plane (butler product visit_camera).
Makes the binning factor configurable, and reduces boilerplate.
We use a wide matched-filter and relatively low threshold to pick
up faint extended wings of bright sources. This reduces the
over-subtraction around bright sources.
Prepare Tasks for Gen3 PipelineTask conversion by:
* Renaming CmdlineTask's entry method to `runDataRef`.  The default
  CmdlineTask.TaskRunner now calls a Task's `runDataRef` method on the
  parsed command line inputs.
  `runDataRef` method can take any Gen2 Butler data products.
* Renaming CmdlineTasks previous core methods (e.g. assemble,
  characterize) to `run` when they exist.
Tim Jenness points out that the 'maskedImage' variable isn't defined.
Looks like it was renamed 'image' at some point, but not updated in
this block.
This allows a better measurement of the sky level, less affected
by the wings of bright objects.
This cleans up any remaining low-level sky after the
original two stages (large-scale focalplane sky-subtraction
and sky frame subtraction).
The new Gen3 implementation of the skyCorrection code is serialized,
and duplicates some of the SkyCorrectionTask methods to provide this
serialized form via a run() method (which matches the Gen2
runDataRef() method).  Comments have been added to link the Gen2 and
Gen3 methods, and both methods should be updated for any future code
changes.

An additional "rawLinker" input dataset is needed for Gen3, as the
calExp (which has the dataset.visit column populated) cannot find a
link to find the appropriate camera/sky calibration entries.  Adding
this rawLinker allows the calExp to connect to the raw data that was
its source, and use that connection to find the calibration files.
This dataset is used only for constructing the quantum graph, and is
removed prior to processing in the task run() method.
If subtracting a background model fails, log the failure as an error and
return immediately so any additional dataRefs can continue to run.
for changed gen3 interface:
- storage class for raws
- calibration_label not in use anymore
- need lookup function as workaround for inability to query
  calibration collections
Order of inputs is not guaranteed, and the weighting per detector to the
full focal plane sky model can depend (very weakly) on the order of inputs,
so sort them by detector to guarantee reproducible results for the same set
of inputs.
@timj timj merged commit cdcd724 into main Jul 29, 2022
@timj timj deleted the tickets/DM-19852 branch July 29, 2022 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants