-
Notifications
You must be signed in to change notification settings - Fork 4
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-29348: Add ability to run global fgcmcal in a single pipeline. #59
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,31 +85,31 @@ class FgcmOutputProductsConnections(pipeBase.PipelineTaskConnections, | |
deferLoad=True, | ||
) | ||
|
||
fgcmVisitCatalog = connectionTypes.PrerequisiteInput( | ||
fgcmVisitCatalog = connectionTypes.Input( | ||
doc="Catalog of visit information for fgcm", | ||
name="fgcmVisitCatalog", | ||
storageClass="Catalog", | ||
dimensions=("instrument",), | ||
deferLoad=True, | ||
) | ||
|
||
fgcmStandardStars = connectionTypes.PrerequisiteInput( | ||
fgcmStandardStars = connectionTypes.Input( | ||
doc="Catalog of standard star data from fgcm fit", | ||
name="fgcmStandardStars{cycleNumber}", | ||
storageClass="SimpleCatalog", | ||
dimensions=("instrument",), | ||
deferLoad=True, | ||
) | ||
|
||
fgcmZeropoints = connectionTypes.PrerequisiteInput( | ||
fgcmZeropoints = connectionTypes.Input( | ||
doc="Catalog of zeropoints from fgcm fit", | ||
name="fgcmZeropoints{cycleNumber}", | ||
storageClass="Catalog", | ||
dimensions=("instrument",), | ||
deferLoad=True, | ||
) | ||
|
||
fgcmAtmosphereParameters = connectionTypes.PrerequisiteInput( | ||
fgcmAtmosphereParameters = connectionTypes.Input( | ||
doc="Catalog of atmosphere parameters from fgcm fit", | ||
name="fgcmAtmosphereParameters{cycleNumber}", | ||
storageClass="Catalog", | ||
|
@@ -126,12 +126,6 @@ class FgcmOutputProductsConnections(pipeBase.PipelineTaskConnections, | |
multiple=True, | ||
) | ||
|
||
fgcmBuildStarsTableConfig = connectionTypes.PrerequisiteInput( | ||
doc="Config used to build FGCM input stars", | ||
name="fgcmBuildStarsTable_config", | ||
storageClass="Config", | ||
) | ||
|
||
fgcmPhotoCalib = connectionTypes.Output( | ||
doc=("Per-visit photometric calibrations derived from fgcm calibration. " | ||
"These catalogs use detector id for the id and are sorted for " | ||
|
@@ -173,9 +167,9 @@ def __init__(self, *, config=None): | |
if not config.doReferenceCalibration: | ||
self.prerequisiteInputs.remove("refCat") | ||
if not config.doAtmosphereOutput: | ||
self.prerequisiteInputs.remove("fgcmAtmosphereParameters") | ||
self.inputs.remove("fgcmAtmosphereParameters") | ||
if not config.doZeropointOutput: | ||
self.prerequisiteInputs.remove("fgcmZeropoints") | ||
self.inputs.remove("fgcmZeropoints") | ||
if not config.doReferenceCalibration: | ||
self.outputs.remove("fgcmOffsets") | ||
|
||
|
@@ -189,7 +183,12 @@ class FgcmOutputProductsConfig(pipeBase.PipelineTaskConfig, | |
dtype=int, | ||
default=None, | ||
) | ||
|
||
physicalFilterMap = pexConfig.DictField( | ||
doc="Mapping from 'physicalFilter' to band.", | ||
keytype=str, | ||
itemtype=str, | ||
default={}, | ||
) | ||
# The following fields refer to calibrating from a reference | ||
# catalog, but in the future this might need to be expanded | ||
doReferenceCalibration = pexConfig.Field( | ||
|
@@ -408,18 +407,7 @@ def runQuantum(self, butlerQC, inputRefs, outputRefs): | |
else: | ||
self.refObjLoader = None | ||
|
||
dataRefDict['fgcmBuildStarsTableConfig'] = butlerQC.get(inputRefs.fgcmBuildStarsTableConfig) | ||
|
||
fgcmBuildStarsConfig = butlerQC.get(inputRefs.fgcmBuildStarsTableConfig) | ||
physicalFilterMap = fgcmBuildStarsConfig.physicalFilterMap | ||
|
||
if self.config.doComposeWcsJacobian and not fgcmBuildStarsConfig.doApplyWcsJacobian: | ||
raise RuntimeError("Cannot compose the WCS jacobian if it hasn't been applied " | ||
"in fgcmBuildStarsTask.") | ||
if not self.config.doComposeWcsJacobian and fgcmBuildStarsConfig.doApplyWcsJacobian: | ||
self.log.warn("Jacobian was applied in build-stars but doComposeWcsJacobian is not set.") | ||
Comment on lines
-413
to
-420
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why were these checks removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We seem to be unable to read in the configs as regular inputs, and these checks seemed extraneous. But my intention is to add these to the gen3 pipeline "contracts". The pipeline itself isn't anywhere yet since it doesn't quite fit into the current framework; I'll ticket that separately. |
||
|
||
struct = self.run(dataRefDict, physicalFilterMap, returnCatalogs=True) | ||
struct = self.run(dataRefDict, self.config.physicalFilterMap, returnCatalogs=True) | ||
|
||
# Output the photoCalib exposure catalogs | ||
if struct.photoCalibCatalogs is not None: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
import lsst.fgcmcal as fgcmcal | ||
|
||
config.outfileBase = 'TestFgcm' | ||
# The unused z-band is here to test the case that extra filters | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're still getting that extra-filter test with |
||
# are in the map that are not used in the calibrations. | ||
config.physicalFilterMap = {'HSC-G': 'g', | ||
'HSC-R': 'r', | ||
'HSC-I': 'i', | ||
'HSC-Z': 'z'} | ||
config.bands = ['g', 'r', 'i'] | ||
config.fitBands = ['g', 'r', 'i'] | ||
config.requiredBands = ['r', 'i'] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we changing all these to just
Inputs
? As far as I can tell, some are still always used (unlike egfgcmAtmosphereParameters
that may not be needed depending on the config) here and infgcmFitCycle
...?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, the three tasks (build stars; fit; output products) all had to be done separately. And I believe a
PrerequisiteInput
is faster for the the quantum graph generator to find (or not find). But now I have the ability to link them all into one pipeline, so thefgcmVisitCatalog
doesn't actually exist prior to the start of the pipeline run, so it must be a regularInput
that is constrained by the quantum graph generator.