Skip to content

Commit

Permalink
Add support for using extra input collections in notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisherlevine committed Sep 13, 2023
1 parent b4ca86d commit c633d4d
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions python/lsst/atmospec/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import lsst.pex.config as pexConfig
from lsst.pipe.base import Pipeline
from lsst.obs.lsst.translators.lsst import FILTER_DELIMITER
from lsst.utils.iteration import ensure_iterable

import astropy
import astropy.units as u
Expand Down Expand Up @@ -573,7 +574,13 @@ def getFilterAndDisperserFromExp(exp):
return filt, grating


def runNotebook(dataId, outputCollection, taskConfigs={}, configOptions={}, embargo=False):
def runNotebook(dataId,
outputCollection,
*,
extraInputCollections=None,
taskConfigs={},
configOptions={},
embargo=False):
"""Run the ProcessStar pipeline for a single dataId, writing to the
specified output collection.
Expand All @@ -587,6 +594,8 @@ def runNotebook(dataId, outputCollection, taskConfigs={}, configOptions={}, emba
The dataId to run.
outputCollection : `str`, optional
Output collection name.
extraInputCollections : `list` of `str`
Any extra input collections to use when processing.
taskConfigs : `dict` [`lsst.pipe.base.PipelineTaskConfig`], optional
Dictionary of config config classes. The key of the ``taskConfigs``
dict is the relevant task label. The value of ``taskConfigs``
Expand Down Expand Up @@ -620,11 +629,12 @@ def makeQuery(dataId):
repo = "LATISS" if not embargo else "/repo/embargo"

# TODO: use LATISS_DEFAULT_COLLECTIONS here?
inputs = ['LATISS/raw/all', 'refcats', 'LATISS/calib']
if extraInputCollections is not None:
extraInputCollections = ensure_iterable(extraInputCollections)
inputs.extend(extraInputCollections)
butler = SimplePipelineExecutor.prep_butler(repo,
inputs=['LATISS/raw/all',
'refcats',
'LATISS/calib',
],
inputs=inputs,
output=outputCollection)

pipeline = Pipeline.fromFile("${ATMOSPEC_DIR}/pipelines/processStar.yaml")
Expand Down

0 comments on commit c633d4d

Please sign in to comment.