Skip to content

Commit

Permalink
Merge pull request #12 from raphaelshirley/master
Browse files Browse the repository at this point in the history
Code running with w.2023.09
  • Loading branch information
raphaelshirley authored Mar 23, 2023
2 parents 7abb898 + 019a86d commit 736981e
Show file tree
Hide file tree
Showing 24 changed files with 452 additions and 668 deletions.
34 changes: 8 additions & 26 deletions config/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,15 @@
# Reference catalogs
# The following was copied from obs_subaru and manages conflicts between gen2 and gen3
ref_cat = "ps1_pv3_3pi_20170110_vista"
for refObjLoader in (config.astromRefObjLoader,
config.photoRefObjLoader,
):
refObjLoader.load(os.path.join(ObsConfigDir, "filterMap.py"))
# This is the Gen2 configuration option.
#refObjLoader.ref_dataset_name = ref_cat #deprecated
# Use the filterMap instead of the "any" filter. Broke after w_2022_21 without this
refObjLoader.anyFilterMapsToThis = None

# for matchConfig in (config.astrometry,
# ):
# # matchConfig.sourceFluxType = 'Psf'
# # matchConfig.sourceSelector.active.sourceFluxType = 'Psf'
# # matchConfig.matcher.maxRotationDeg = 1.145916
# matchConfig.matcher.maxOffsetPix = 5
# if isinstance(matchConfig.matcher, MatchOptimisticBConfig):
# matchConfig.matcher.allowedNonperpDeg = 0.2
# matchConfig.matcher.maxMatchDistArcSec = 2.0
# matchConfig.sourceSelector.active.excludePixelFlags = False
# if isinstance(matchConfig.matcher, MatchPessimisticBConfig):
# matchConfig.matcher.allowedNonperpDeg = 0.2
# matchConfig.matcher.maxMatchDistArcSec = 2.0
# matchConfig.sourceSelector.active.excludePixelFlags = False

# These are the Gen3 configuration options for reference catalog name.
config.connections.photoRefCat = ref_cat

# Use PS1/VISTA for both astrometry and photometry.
config.connections.astromRefCat = ref_cat
config.astromRefObjLoader.load(os.path.join(ObsConfigDir, "filterMap.py"))
# Use the filterMap instead of the "any" filter (as is used for Gaia.
config.astromRefObjLoader.anyFilterMapsToThis = None

config.connections.photoRefCat = ref_cat
config.photoRefObjLoader.load(os.path.join(ObsConfigDir, "filterMap.py"))

# number of iterations of fitter (which fits X and Y separately, and so benefits from a few iterations
# See Slack: https://lsstc.slack.com/archives/C2B6X08LS/p1586468459084600
Expand Down
2 changes: 1 addition & 1 deletion config/characterizeImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# This sets the reference catalog name for Gen2.
# Note that in Gen3, we've stopped pretending (which is what Gen2 does,
# for backwards compatibility) that charImage uses a reference catalog.
config.refObjLoader.ref_dataset_name = "ps1_pv3_3pi_20170110_vista"
#config.refObjLoader.ref_dataset_name = "ps1_pv3_3pi_20170110_vista"

# measureApCorr error?
# example failure: dataId={'dateObs': '2012-11-22', 'visit': 658653, 'filter': 'VISTA-Ks', 'hdu': 9, 'ccdnum': 8, 'ccd': 8}
Expand Down
10 changes: 5 additions & 5 deletions config/colorterms.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@

# Names used by data IDs in both Gen2 and Gen3, and
# Exposure.getFilter() in Gen3 (data is the same).
'HSC-G': Colorterm(primary="g", secondary="r", c0=0.005728, c1=0.061749, c2=-0.001125),
'HSC-R': Colorterm(primary="r", secondary="i", c0=-0.000144, c1=0.001369, c2=-0.008380),
'EXT-G': Colorterm(primary="g", secondary="r", c0=0.005728, c1=0.061749, c2=-0.001125),
'EXT-R': Colorterm(primary="r", secondary="i", c0=-0.000144, c1=0.001369, c2=-0.008380),
# 'HSC-R2': Colorterm(primary="r", secondary="i", c0=-0.000032, c1=-0.002866, c2=-0.012638),
'HSC-I': Colorterm(primary="i", secondary="z", c0=0.000643, c1=-0.130078, c2=-0.006855),
'EXT-I': Colorterm(primary="i", secondary="z", c0=0.000643, c1=-0.130078, c2=-0.006855),
# 'HSC-I2': Colorterm(primary="i", secondary="z", c0=0.001625, c1=-0.200406, c2=-0.013666),
'HSC-Z': Colorterm(primary="z", secondary="y", c0=-0.005362, c1=-0.221551, c2=-0.308279),
'HSC-Y': Colorterm(primary="y", secondary="z", c0=-0.002055, c1=0.209680, c2=0.227296),
'EXT-Z': Colorterm(primary="z", secondary="y", c0=-0.005362, c1=-0.221551, c2=-0.308279),
'EXT-Y': Colorterm(primary="y", secondary="z", c0=-0.002055, c1=0.209680, c2=0.227296),
'VIRCAM-Z': Colorterm(primary="z2", secondary="z2"),
'VIRCAM-Y': Colorterm(primary="y2", secondary="y2"),
'VIRCAM-J': Colorterm(primary="j", secondary="j"),
Expand Down
10 changes: 5 additions & 5 deletions config/filterMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# All names on right are used in the refcats
# All names on the left are names of image bands as physcial_filter or band
for source, target in [
('HSC-G', 'g'),
('HSC-R', 'r'),
('HSC-I', 'i'),
('HSC-Z', 'z'),
('HSC-Y', 'y'),
('EXT-G', 'g'),
('EXT-R', 'r'),
('EXT-I', 'i'),
('EXT-Z', 'z'),
('EXT-Y', 'y'),
('VIRCAM-Z', 'z2'),
('VIRCAM-Y', 'y2'),
('VIRCAM-J', 'j'),
Expand Down
8 changes: 8 additions & 0 deletions config/makeLSSTSkyMap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Taken from https://github.com/lsst/obs_lsst/blob/main/config/makeSkyMap.py
# This may change
config.name = "LSST"
config.skyMap.name = "rings"
config.skyMap["rings"].numRings = 120
config.skyMap["rings"].projection = "TAN"
config.skyMap["rings"].tractOverlap = 1.0/60 # Overlap between tracts (degrees)
config.skyMap["rings"].pixelScale = 0.2
2 changes: 1 addition & 1 deletion config/measureCoaddSources.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# config.match.refObjLoader=None
# Set reference catalog for Gen2. "ps1_pv3_3pi_vist2020"
config.match.refObjLoader.ref_dataset_name = "ps1_pv3_3pi_20170110_vista" # ps1_pv3_3pi_20170110
#config.match.refObjLoader.ref_dataset_name = "ps1_pv3_3pi_20170110_vista" # ps1_pv3_3pi_20170110
# Set reference catalog for Gen3.
config.connections.refCat = "ps1_pv3_3pi_20170110_vista" # ps1_pv3_3pi_20170110

Expand Down
266 changes: 246 additions & 20 deletions pipelines/DRP.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,271 @@
description: The DRP pipeline specialized for the VIRCAM instrument
instrument: lsst.obs.vista.VIRCAM
description: VIRCAM experimental pipeline based on LSSTCam-imSim
instrument: lsstuk.obs.vista.VIRCAM
imports:
- $PIPE_TASKS_DIR/pipelines/DRP.yaml
- $DRP_PIPE_DIR/ingredients/DRP-minimal-calibration.yaml
- $ANALYSIS_TOOLS_DIR/pipelines/coaddDiffMatchedQualityExtended.yaml
- $ANALYSIS_TOOLS_DIR/pipelines/coaddQualityCore.yaml
- $FARO_DIR/pipelines/metrics_pipeline.yaml
tasks:
isr: lsst.obs.vista.VircamIsrTask
singleFrame:
isr: lsstuk.obs.vista.VircamIsrTask
calibrate: lsst.pipe.tasks.calibrate.CalibrateTask
measure:
class: lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask
config:
connections.refCat: "ps1_pv3_3pi_20170110_vista"

subsets:
step1:
subset:
- isr
- characterizeImage
- calibrate
- writeSourceTable
- transformSourceTable
description: |
Per-detector tasks that can be run together to start the DRP pipeline.
These may or may not be run with 'tract' or 'patch' as part of the data
ID expression. This specific pipeline contains no tasks that require full
visits. Running with 'tract' (and 'patch') constraints will select
partial visits that overlap that region.
In data release processing, operators should stop to address unexpected
failures before continuing on to step2.
step2:
subset:
- consolidateSourceTable
- consolidateVisitSummary
- isolatedStarAssociation
- finalizeCharacterization
- makeCcdVisitTable
- makeVisitTable
description: >
Set of tasks for complete single frame processing. Analogous to
SingleFrameDriver. isr swapped with vircamIsr to include confidence maps.
coaddDetect:
- updateVisitSummary
description: |
Tasks that can be run together, but only after the 'step1'.
This is a mix of visit-level, tract-level, and collection-level tasks
that must be run with a skymap data query constraint only (an instrument
constraint is fine, but generally unneccessary). For example, running
with 'tract' (and 'patch') constraints will select partial visits that
overlap that region. A skymap constraint is necessary to prevent
isolatedStarAssociation from producing results for all skymaps in the
data repository.
Visit-level tasks include consolidateSourceTable, consolidateVisitSummary,
finalizeCharacterization, updateVisitSummary.
Tract-level tasks include: isolatedStarAssociation
Full collection-level tasks include: makeCcdVisitTable, makeVisitTable
step3:
subset:
- makeWarp
- assembleCoadd
- detection
- mergeDetections
- deblend
- measure
- mergeMeasurements
- forcedPhotCoadd
- transformObjectTable
- writeObjectTable
- consolidateObjectTable
- healSparsePropertyMaps
- selectGoodSeeingVisits
- templateGen
#- matchObjectToTruth
#- compareObjectToTruth
description: |
Tasks that can be run together, but only after the 'step1' and 'step2'
subsets.
These should be run with explicit 'tract' constraints essentially all the
time, because otherwise quanta will be created for jobs with only partial
visit coverage.
It is expected that many forcedPhotCcd quanta will "normally" fail when
running this subset, but this isn't a problem right now because there are
no tasks downstream of it. If other tasks regularly fail or we add tasks
downstream of forcedPhotCcd, these subsets or the tasks will need
additional changes.
This subset is considered a workaround for missing middleware and task
functionality. It may be removed in the future.
step3a:
subset:
- makeWarp
- assembleCoadd
- detection
description: >
A set of tasks to run when coadding images. Adding detection to typical run.
multiVisitLater:
#- mergeDetections
#- deblend
#- measure
#- mergeMeasurements
#- forcedPhotCoadd
#- transformObjectTable
#- writeObjectTable
#- consolidateObjectTable
- healSparsePropertyMaps
#- selectGoodSeeingVisits
#- templateGen
#- matchObjectToTruth
#- compareObjectToTruth
description: |
Tasks that can be run together, but only after the 'step1' and 'step2'
subsets.
These should be run with explicit 'tract' constraints essentially all the
time, because otherwise quanta will be created for jobs with only partial
visit coverage.
It is expected that many forcedPhotCcd quanta will "normally" fail when
running this subset, but this isn't a problem right now because there are
no tasks downstream of it. If other tasks regularly fail or we add tasks
downstream of forcedPhotCcd, these subsets or the tasks will need
additional changes.
This subset is considered a workaround for missing middleware and task
functionality. It may be removed in the future.
step3b:
subset:
#- makeWarp
#- assembleCoadd
#- healSparsePropertyMaps # needs visit info
#- detection #use public HSC detections and run separately on VIRCAM
# - assembleCoadd
#- detection
- mergeDetections
- deblend
- measure # needs visit src catalogues if propagating flags
- measure
- mergeMeasurements
#- forcedPhotCcd # needs CCD exposures
- forcedPhotCoadd
- writeObjectTable
- transformObjectTable
- writeObjectTable
- consolidateObjectTable
description: >
Later parts of multivisit to be conducted following importation of HSC/LSST deepCoadds during VISTA VIRCAM joint processing.
#- healSparsePropertyMaps
#The following steps require single epoch visits which are not ingested for HSC
#- selectGoodSeeingVisits
#- templateGen
#- matchObjectToTruth
#- compareObjectToTruth
description: |
Tasks that can be run together, but only after the 'step1' and 'step2'
subsets.
These should be run with explicit 'tract' constraints essentially all the
time, because otherwise quanta will be created for jobs with only partial
visit coverage.
It is expected that many forcedPhotCcd quanta will "normally" fail when
running this subset, but this isn't a problem right now because there are
no tasks downstream of it. If other tasks regularly fail or we add tasks
downstream of forcedPhotCcd, these subsets or the tasks will need
additional changes.
This subset is considered a workaround for missing middleware and task
functionality. It may be removed in the future.
step4:
subset:
- forcedPhotCcd
- forcedPhotDiffim
- getTemplate
- subtractImages
- detectAndMeasureDiaSources
- transformDiaSourceCat
- writeForcedSourceTable
description: |
Tasks that can be run together, but only after the 'step1', 'step2' and
'step3' subsets
These detector-level tasks should not be run with 'tract' or 'patch' as
part of the data ID expression if all reference catalogs or diffIm
templates that cover these detector-level quanta are desired.
step5:
subset:
- drpAssociation
- drpDiaCalculation
- forcedPhotCcdOnDiaObjects
- forcedPhotDiffOnDiaObjects
- transformForcedSourceTable
- consolidateForcedSourceTable
- consolidateAssocDiaSourceTable
- consolidateFullDiaObjectTable
- writeForcedSourceOnDiaObjectTable
- transformForcedSourceOnDiaObjectTable
- consolidateForcedSourceOnDiaObjectTable
description: |
Tasks that can be run together, but only after the 'step1', 'step2',
'step3', and 'step4' subsets
This step includes patch-level aggregation Tasks. These should be run
with explicit 'tract' constraints in the data query, otherwise quanta
will be created for jobs with only partial visit coverage.
'consolidateForcedSourceTable' is a tract-level task that aggregates
patches and should be rerun if any of the patches fail.
step6:
subset:
- consolidateDiaSourceTable
description: |
Tasks that can be run together, but only after the 'step1', 'step2',
'step3', and 'step4' subsets
This step includes visit-level aggregation tasks. Running without tract
or patch in the data query is recommended, otherwise the outputs of
consolidateDiaSourceTable will not contain complete visits.
This subset is separate from step4 to signal to operators to pause to
assess unexpected image differencing failures before these aggregation
steps. Otherwise, if run in the same quantum graph, aggregated data
products (e.g. diaObjects) would not be created if one or more of the
expected inputs is missing.
step7:
subset:
- consolidateHealSparsePropertyMaps
description: |
Tasks that should be run as the final step that require global inputs,
and can be run after the 'step3' subset.
This step has global aggregation tasks to run over all visits, detectors,
tracts, etc. This step should be run only with the instrument constraint
in the data query.
step8:
subset:
- analyzeObjectTableCore
- analyzeObjectTableSurveyCore
- catalogMatchTract
- refCatObjectTract
- diff_matched_analysis
description: |
Core (most important), coadd-level plots/metrics from analysis_tools.
Must be run after 'step3' (writeObjectTable). Cannot be run with any
dataquery constraints if analyzeObjectTableSurveyCore is included.
Can be run together with analysis_drp subsets, e.g. pipeline.yaml
(hash/pound sign)step8,analysis_coadd_plots,imsim_analysis_coadd_plots
Includes extended-level diff_matched_analysis metrics, which are
considered core for DC2 as they can't be run on other datasets yet.
faro_all:
subset:
# visit-level on single-frame products
- nsrcMeasVisit
- TE3
- TE4
# tract-level, matched-visit on single-frame products
- matchCatalogsTract
- matchCatalogsPatch
- matchCatalogsPatchMultiBand
- matchCatalogsTractMag17to21p5
- matchCatalogsTractStarsSNR5to80
- matchCatalogsTractGxsSNR5to80
- PA1
- PF1_design
- AM1
- AM2
- AM3
- AD1_design
- AD2_design
- AD3_design
- AF1_design
- AF2_design
- AF3_design
- AB1
- modelPhotRepGal1
- modelPhotRepGal2
- modelPhotRepGal3
- modelPhotRepGal4
- modelPhotRepStar1
- modelPhotRepStar2
- modelPhotRepStar3
- modelPhotRepStar4
- psfPhotRepStar1
- psfPhotRepStar2
- psfPhotRepStar3
- psfPhotRepStar4
# tract-level on coadd products
- TE1
- TE2
- wPerp
- skyObjectMean
- skyObjectStd
description: |
Set of tasks for calculation of metrics via faro.
These tasks are a mix of visit- and tract-level.
Tasks that require single-frame products use Calibrated Source Tables,
which are available after consolidateSourceTable (step2).
Tasks that require coadd products use Object Tables which are available
after consolidateObjectTable (step3).
Loading

0 comments on commit 736981e

Please sign in to comment.