# Calib construction scripts

**URL:** <https://www.rubin.community/t/calib-construction-scripts/731>\
**Category:** DM Notifications\
**Tags:** pipe\_drivers, calib, ctrl\_pool\
**Created:** [April 28, 2016, 4:10pm UTC](https://www.rubin.community/t/calib-construction-scripts/731 "2016-04-28T16:10:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![price](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/price/32/488_2.png) [@price](https://www.rubin.community/u/price)\
**Post date:** [April 28, 2016, 4:10pm UTC](https://www.rubin.community/t/calib-construction-scripts/731/1 "2016-04-28T16:10:46Z")

</div>

In [DM-3373](https://jira.lsstcorp.org/browse/DM-3373) and a few other tickets, we ported over from HSC scripts for constructing calibs. These reside in pipe\_drivers, and use the MPI process pool in ctrl\_pool. Example command-lines for using these scripts are on [DM-5124](https://jira.lsstcorp.org/browse/DM-5124?focusedCommentId=46506&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-46506), but here’s a rough guide:

- Bin scripts are `constructBias.py`, `constructDark.py`, `constructFlat.py` and `constructFringe.py`.
- These are like a regular `CmdLineTask`, but with additional arguments that configure how to do the parallelism:
- `--batch-type` may be `smp` (Symmetric Multi-Processing, i.e., run on the local machine with multiple cores), `pbs` (submit the batch request to your PBS cluster) or `slurm` (submit the batch request to your Slurm cluster).
- `--job` is the job name (used by batch systems to identify the job, and in naming output log files).
- `--time` is the walltime limit for batch systems, _per element_ (in this case, the element is individual CCDs).
- `--cores` (for `smp` or `slurm` modes) specifies the number of cores to use.
- `--nodes` and `--procs` (for `pbs` or `slurm` modes) specifies the number of nodes and CPUs per node to use.
- `--batch-submit` can be used to provide additional options for batch submission (i.e., qsub or sbatch, as appropriate).
- `--mpiexec` can be used to provide additional options for `mpiexec`. On our Slurm clusters at Princeton, we’ve found we need `-bind-to socket` to prevent trouble.
- `--dry-run` can be used to test the command-line before submitting.
- You will probably need some configuration additions in your obs\_\* package.
- The individual scripts write `bias_config`, `dark_config`, `flat_config` and `fringe_config` datasets, so your Mapper needs to support those.
- Overrides can be added to your `obs_*/config` directory as `bias.py`, `dark.py`, `flat.py` and `fringe.py`.

@merlin is trying to get this working with DECam at the moment. Hopefully we can report success soon! Users of other cameras are welcome to request help here.

---

<div class="post-metadata">

**Author:** ![merlin](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/merlin/32/2652_2.png) [@merlin](https://www.rubin.community/u/merlin)\
**Post date:** [April 28, 2016, 4:29pm UTC](https://www.rubin.community/t/calib-construction-scripts/731/2 "2016-04-28T16:29:34Z")

</div>

Steps taken so far are to splice in:

`bias_config: { template: "config/bias.py" python: "lsst.pipe.drivers.constructCalibs.BiasConfig" persistable: "Config" storage: "ConfigStorage" tables: raw tables: raw_visit } dark_config: { template: "config/dark.py" python: "lsst.pipe.drivers.constructCalibs.DarkConfig" persistable: "Config" storage: "ConfigStorage" tables: raw tables: raw_visit } flat_config: { template: "config/flat.py" python: "lsst.pipe.drivers.constructCalibs.FlatConfig" persistable: "Config" storage: "ConfigStorage" tables: raw tables: raw_visit } fringe_config: { template: "config/fringe.py" python: "lsst.pipe.drivers.constructCalibs.FringeConfig" persistable: "Config" storage: "ConfigStorage" tables: raw tables: raw_visit`  
}

to DecamMapper.paf, just so that steps are recorded for others.

---

<div class="post-metadata">

**Author:** ![merlin](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/merlin/32/2652_2.png) [@merlin](https://www.rubin.community/u/merlin)\
**Post date:** [April 28, 2016, 4:30pm UTC](https://www.rubin.community/t/calib-construction-scripts/731/3 "2016-04-28T16:30:26Z")

</div>

@KSK I am also about to try this for the newly created obs\_monocam as well 🙂

---

<div class="post-metadata">

**Author:** ![price](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/price/32/488_2.png) [@price](https://www.rubin.community/u/price)\
**Post date:** [April 29, 2016, 6:19pm UTC](https://www.rubin.community/t/calib-construction-scripts/731/4 "2016-04-29T18:19:01Z")

</div>

This now works with:

- DECam, using branch tickets/DM-5899 of obs\_decam; and
- Monocam, using branch u/price/20160429 of obs\_monocam.

Note that these branches will (hopefully!) be cleaned up as part of their journey to master.
