Skip to content

Commit

Permalink
Add and execute a source_injection pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmccann committed Nov 2, 2023
1 parent f00b9c5 commit db7b52f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
17 changes: 17 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,23 @@ external = env.Command([Dir(os.path.join(REPO_ROOT, "HSC", "masks")),
env.ProductDir("testdata_ci_hsc"),
"--export-file", os.path.join(PKG_ROOT, "resources",
"external_jointcal.yaml")),

getExecutableCmd("daf_butler", "butler", "register-dataset-type", REPO_ROOT,
"injection_catalog", "ArrowAstropy", "band", "htm7"),

getExecutableCmd("daf_butler", "butler", "ingest-files",
"--prefix", TESTDATA_ROOT,
REPO_ROOT, "injection_catalog", "injection_catalogs",
os.path.join(TESTDATA_ROOT, "injection_catalog_20231002.ecsv")),

getExecutableCmd("make_injection_pipeline", "-t", "deepCoadd", "-r",
os.path.join(env.ProductDir("DRP_PIPE_DIR"),
"pipelines", "HSC", "DRP-ci_hsc.yaml"),
"-i", os.path.join(env.ProductDir("SOURCE_INJECTION_DIR"),
"pipelines", "inject_coadd.yaml"),
"-f", os.path.join(REPO_ROOT, "DRP-ci_hsc+injection.yaml",
"--overwrite")
)
])
env.Alias("external", external)

Expand Down
20 changes: 19 additions & 1 deletion bin/pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,23 @@ repo=$1

COLLECTION=HSC/runs/ci_hsc
INPUTCOLL=HSC/defaults
INJECTION_COLLECTION=HSC/runs/ci_hsc_injection
INJECTION_INPUTCOLL=injection_catalogs
FARO_COLLECTION=HSC/runs/ci_hsc_faro
RESOURCE_USAGE_COLLECTION=HSC/runs/ci_hsc_resource_usage
HIPS_COLLECTION=HSC/runs/ci_hsc_hips

export DYLD_LIBRARY_PATH="$LSST_LIBRARY_PATH"
# exercise saving of the generated quantum graph to a file and reading it back
QGRAPH_FILE=$(mktemp).qgraph
INJECTION_QGRAPH_FILE=$(mktemp)_injection.qgraph
FARO_QGRAPH_FILE=$(mktemp)_faro.qgraph
RESOURCE_USAGE_QGRAPH_FILE=$(mktemp)_resource_usage.qgraph
HIPS_QGRAPH_FILE=$(mktemp)_hips.qgraph
INJECTION_LOG_FILE=$(mktemp)_injection.log

trap 'rm -f $QGRAPH_FILE $FARO_QGRAPH_FILE $RESOURCE_USAGE_QGRAPH_FILE $HIPS_QGRAPH_FILE' EXIT
trap 'rm -f $QGRAPH_FILE $INJECTION_QGRAPH_FILE $FARO_QGRAPH_FILE $RESOURCE_USAGE_QGRAPH_FILE \
$HIPS_QGRAPH_FILE' EXIT

pipetask --long-log --log-level="$loglevel" qgraph \
-d "skymap='discrete/ci_hsc' AND tract=0 AND patch=69" \
Expand All @@ -67,6 +72,19 @@ pipetask --long-log --log-level="$loglevel" run \
--register-dataset-types $mock \
--qgraph "$QGRAPH_FILE"

pipetask --long-log --log-level="$loglevel" qgraph \
-d "skymap='discrete/ci_hsc' AND tract=0 AND patch=69" \
-b "$repo"/butler.yaml \
--input "$COLLECTION","$INJECTION_INPUTCOLL" --output "$INJECTION_COLLECTION" \
-p "$repo"/DRP-ci_hsc+injection.yaml \
--save-qgraph "$INJECTION_QGRAPH_FILE"

pipetask --long-log --log-level="$loglevel" run \
-j "$jobs" -b "$repo"/butler.yaml \
--input "$COLLECTION","$INJECTION_INPUTCOLL" --output "$INJECTION_COLLECTION" \
--register-dataset-types $mock \
--qgraph "$INJECTION_QGRAPH_FILE"

pipetask --long-log --log-level="$loglevel" qgraph \
-d "skymap='discrete/ci_hsc' AND tract=0 AND patch=69 AND band in ('r', 'i')" \
-b "$repo"/butler.yaml \
Expand Down

0 comments on commit db7b52f

Please sign in to comment.