From 532e9019f4244a09834148ae0eeaf804ae1266c7 Mon Sep 17 00:00:00 2001 From: Trys McCann Date: Tue, 29 Oct 2024 13:34:13 -0700 Subject: [PATCH] Add analysis tasks to the injected RC2 pipelines. --- SConstruct | 18 ++++++++-- pipelines/HSC/DRP-RC2-post-injected.yaml | 46 ++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 pipelines/HSC/DRP-RC2-post-injected.yaml diff --git a/SConstruct b/SConstruct index f3e3ef49..52175d91 100644 --- a/SConstruct +++ b/SConstruct @@ -1,5 +1,6 @@ # -*- python -*- import os + from lsst.sconsUtils import scripts from lsst.sconsUtils.state import env from lsst.sconsUtils.utils import libraryLoaderEnvironment @@ -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( @@ -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", ] ), ) @@ -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", ] ), ) diff --git a/pipelines/HSC/DRP-RC2-post-injected.yaml b/pipelines/HSC/DRP-RC2-post-injected.yaml new file mode 100644 index 00000000..0e256941 --- /dev/null +++ b/pipelines/HSC/DRP-RC2-post-injected.yaml @@ -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, + )