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-47210: Add analysis tasks to the injected RC2 pipelines. #174

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- python -*-
import os

from lsst.sconsUtils import scripts
from lsst.sconsUtils.state import env
from lsst.sconsUtils.utils import libraryLoaderEnvironment
Expand All @@ -18,6 +19,17 @@ scripts.BasicSConstruct(
)
PKG_ROOT = env.ProductDir("drp_pipe")

additional_pipeline = os.path.join(
PKG_ROOT,
"pipelines",
"HSC",
"DRP-RC2-post-injected.yaml",
)

subset_name = "injected_coadd_analysis"
subset_description = "Analysis tasks for object_table level injected catalogs."


# make deepCoadd injection pipelines for rc2_subset and RC2
rc2_subset_injected_deepCoadd = env.Command(
target=os.path.join(
Expand All @@ -27,7 +39,8 @@ rc2_subset_injected_deepCoadd = env.Command(
action=" ".join(
[
libraryLoaderEnvironment(),
"make_injection_pipeline -t deepCoadd -r $SOURCE -f $TARGET --overwrite",
f"make_injection_pipeline -t deepCoadd -r $SOURCE -f $TARGET -a {additional_pipeline} "
f"-s {subset_name} -d '{subset_description}' --overwrite",
]
),
)
Expand All @@ -39,7 +52,8 @@ RC2_injected_deepCoadd = env.Command(
action=" ".join(
[
libraryLoaderEnvironment(),
"make_injection_pipeline -t deepCoadd -r $SOURCE -f $TARGET --overwrite",
f"make_injection_pipeline -t deepCoadd -r $SOURCE -f $TARGET -a {additional_pipeline} "
f"-s {subset_name} -d '{subset_description}' --overwrite",
]
),
)
Expand Down
46 changes: 46 additions & 0 deletions pipelines/HSC/DRP-RC2-post-injected.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
description: Match tract-level injected_deepCoadd_catalog datasets to injected_objectTable_tract datasets.
instrument: lsst.obs.subaru.HyperSuprimeCam
imports:
- location: $SOURCE_INJECTION_DIR/pipelines/match_injected_tract_catalog.yaml
- location: $ANALYSIS_TOOLS_DIR/pipelines/coaddDiffMatchedInjectedCore.yaml
tasks:
compare_object_to_injected:
class: lsst.pipe.tasks.diff_matched_tract_catalog.DiffMatchedTractCatalogTask
config:
connections.name_input_cat_ref: injected_deepCoadd_catalog_tract
connections.name_input_cat_target: injected_objectTable_tract
column_matched_prefix_ref: ref_

# TODO: Remove as part of DM-44139
columns_ref_mag_to_nJy: {g_mag: "g_flux", r_mag: "r_flux", i_mag: "i_flux", z_mag: "z_flux", y_mag: "y_flux"}
columns_ref_copy: [
"injected_id", "source_type",
"g_mag", "r_mag", "i_mag", "z_mag", "y_mag",
"injection_flag", "injected_isPatchInner",
]
columns_target_coord_err: ["coord_raErr", "coord_decErr"]
columns_target_copy: [
"g_psfFlux", "r_psfFlux", "i_psfFlux", "z_psfFlux", "y_psfFlux",
"g_psfFluxErr", "r_psfFluxErr", "i_psfFluxErr", "z_psfFluxErr", "y_psfFluxErr",
"g_psfFlux_flag", "r_psfFlux_flag", "i_psfFlux_flag", "z_psfFlux_flag", "y_psfFlux_flag",
"patch", "detect_isDeblendedSource", "detect_isPatchInner", "detect_isPrimary", "merge_peak_sky",
"refExtendedness", "refSizeExtendedness",
]
diff_matched_analysis:
class: lsst.analysis.tools.tasks.DiffMatchedAnalysisTask
config:
connections.inputName: matched_injected_deepCoadd_catalog_tract_injected_objectTable_tract
connections.outputName: matched_injected_deepCoadd_catalog_tract_injected_objectTable_tract

bands: ["g", "r", "i", "z", "y"]
python: |
from lsst.analysis.tools.atools.diffMatched import reconfigure_diff_matched_defaults

reconfigure_diff_matched_defaults(
config=config,
context="injection",
key_flux_meas="psf",
bands_color = {"g", "r", "i", "z", "y"},
use_any=False,
use_galaxies=False,
)
Loading