soxspipe.commonutils.reducer¶
reduce all the data in a workspace, or target specific obs and files for reduction
- Author
David Young
- Date Created
January 17, 2024
Module Contents¶
Classes¶
*reduce all the data in a workspace, or target specific obs and files for reduction*
**Key Arguments:**
- ``log`` -- logger
- ``workspaceDirectory`` -- path to the root of the workspace
- ``reductionTarget`` -- target for reduction: "all", "sof", "ob" (default: "all")
- ``settings`` -- the settings dictionary
- ``pathToSettings`` -- path to the settings file.
- ``quitOnFail`` -- quit the pipeline on any recipe failure
- ``overwrite`` -- overwrite existing reductions. Default *False*.
- ``daemon`` -- run in daemon mode (no terminal output). Default *False*.
- ``verbose`` -- print verbose output to terminal. Default *False*.
- ``refreshWorkspace`` -- refresh the workspace before reducing to collect new files. Default *False*.
|
Functions¶
execute a pipeline recipe |
|
execute a pipeline recipe in multiprocessing mode |
API¶
- class soxspipe.commonutils.reducer.reducer(log, workspaceDirectory, reductionTarget='all', settings=False, pathToSettings=False, quitOnFail=False, overwrite=False, daemon=False, verbose=False, refreshWorkspace=False)[source][source]¶
Bases:
object*reduce all the data in a workspace, or target specific obs and files for reduction* **Key Arguments:** - ``log`` -- logger - ``workspaceDirectory`` -- path to the root of the workspace - ``reductionTarget`` -- target for reduction: "all", "sof", "ob" (default: "all") - ``settings`` -- the settings dictionary - ``pathToSettings`` -- path to the settings file. - ``quitOnFail`` -- quit the pipeline on any recipe failure - ``overwrite`` -- overwrite existing reductions. Default *False*. - ``daemon`` -- run in daemon mode (no terminal output). Default *False*. - ``verbose`` -- print verbose output to terminal. Default *False*. - ``refreshWorkspace`` -- refresh the workspace before reducing to collect new files. Default *False*.
`
**Usage:** ```python from soxspipe.commonutils import reducer collection = reducer( log=log, workspaceDirectory="/path/to/workspace/root/", reductionTarget="all", settings=settings, pathToSettings="/path/to/settings.yaml" ) collection.reduce() ```Initialization
- select_sof_files_to_process(recipe=False, reductionTarget=False, batch=False, arm=False)[source][source]¶
select all of the SOF files still requiring processing
Key Arguments: -
recipe– the name of the recipe to filter by (optional) -reductionTarget– target for reduction: “all”, “sof”, “ob” (default: False) -batch– number of SOF files to return (default: False, all) -arm– filter by arm (default: False, all)Return:
rawGroups– a dataframe of the containing a list of recipes and sof file paths
Usage:
rawGroups = reducer.select_sof_files_to_process()
- soxspipe.commonutils.reducer.run_recipe(log, recipe, sof, settings, overwrite, command=False, verbose=False, turnOffMP=False)[source][source]¶
execute a pipeline recipe
Key Arguments:
recipe– the name of the recipe tp executesof– path to the sof file containing the files the recipe requirescommand– the command used to run the recipesettings– the settings dictionaryoverwrite– overwrite existing reductions. Default False.verbose– print verbose output to terminal. Default False.turnOffMP– turn off multiprocessing mode. Default False.
Usage:
reducer.run_recipe("mbias", "/path/to/sofs/my_bias_files.sof")
- soxspipe.commonutils.reducer.run_recipe_bulk(log, recipe, sofList, commandList, settings, overwrite, workspaceDirectory, conn, sessionId)[source][source]¶
execute a pipeline recipe in multiprocessing mode
Key Arguments:
log– loggerrecipe– the name of the recipe tp executesofList– a list of paths to the sof files containing the files the recipe requirescommandList– a list of the commands used to run the recipe for eachsettings– the settings dictionaryoverwrite– overwrite existing reductions. Default False.workspaceDirectory– path to the root of the workspaceconn– a connection to the workspace databasesessionId– the session ID of the workspace