Skip to content
Snippets Groups Projects

Reproducibility, step 1

Merged Thomas Kluyver requested to merge feat/reproducibility into master
1 file
+ 45
50
Compare changes
  • Side-by-side
  • Inline
+ 45
50
@@ -217,56 +217,51 @@ unmodified sections of code being looked at.
@@ -217,56 +217,51 @@ unmodified sections of code being looked at.
Python Scripted Calibration
Python Scripted Calibration
***************************
***************************
**Do not run this on the Maxwell gateway**. Rather, ``salloc`` a node for
To launch correction or characterisation jobs, run something like this::
yourself first:
xfel-calibrate AGIPD CORRECT \
.. code::
--in-folder /gpfs/exfel/exp/SPB/202131/p900215/raw --run 591 \
--out-folder /gpfs/exfel/data/scratch/kluyvert/agipd-calib-900215-591 \
salloc -p exfel/upex -t 01:00:00
--karabo-id SPB_DET_AGIPD1M-1 --karabo-id-control SPB_IRU_AGIPD1M1 \
--karabo-da-control AGIPD1MCTRL00 --modules 0-4
where `-p` gives the partition to use: exfel **or** upex and `-t` the duration
the node should be allocated. Then ``ssh`` onto that node.
The first two arguments refer to a *detector* and an *action*, and are used to
find the appropriate notebook to run. Most of the optional arguments are
Then activate your environment as described above (or just continue if you are
translated into parameter assignments in the notebook, e.g. ``--modules 0-4``
not using a venv).
sets ``modules = [0, 1, 2, 3]`` in the notebook.
If running headless (i.e. without X forwarding), be sure to set
This normally submits jobs to Slurm to do the work; you can check their status
``MPLBACKEND=Agg``, via:
with ``squeue --me``. If you are working on a dedicated node, you can use the
``--no-cluster-job`` option to run all the work on that node instead.
.. code::
The notebooks will be used to create a PDF report after the jobs have run.
export MPLBACKEND=Agg
This will be placed in ``--out-folder`` by default, though it can be overridden
with the ``--report-to`` option.
Then start an ``ipcluster``. If you followed the steps above this can be done
via:
Reproducing calibration
=======================
.. code::
The information to run the calibration code again is saved to a directory next to
ipcluster start --n=32
the PDF report, named starting with ``slurm_out_``. It can be run as a new job
like this::
Finally run the script:
python3 -m xfel_calibrate.repeat \
/gpfs/exfel/data/scratch/kluyvert/agipd-calib-900215-591/slurm_out_AGIPDOfflineCorrection \
.. code::
--out-folder /gpfs/exfel/data/scratch/kluyvert/agipd-calib-900215-591-repro
python3 calibrate.py --input /gpfs/exfel/exp/SPB/201701/p002012/raw/r0100 \
The information in the directory includes a Pip ``requirements.txt`` file
--output ../../test_out --mem-cells 30 --detector AGIPD --sequences 0,1
listing the packages installed when this task was first set up. For better
reproducibility, use this to create a similar environment, and pass
Here ``--input`` should point to a directory of ``RAW`` files for the detector
``--python path/to/bin/python`` to run notebooks in that environment.
you are calibrating. They will be output into the folder specified by
Future work will automate this step.
``--output``, which will have the run number or the last folder in the hierarchy
of the input appended. Additionally, you need to specify the number of
.. note::
``--mem-cells`` used for the run, as well as the ``--detector``. Finally, you
can optionally specify to only process certain ``--sequences`` of files,
Our aim here is to run the same code as before, with the same parameters,
matching the sequence numbers of the `RAW` input. These should be given as a
in a similar software environment. This should produce essentially the same
comma-separated list.
results, but not necessarily exactly identical. The code which runs may
use external resources, or involve some randomness, and even different
Finally, there is a ``--no-relgain`` option, which disables relative gain
hardware may make small differences.
correction. This can be useful while we still further characterize the detectors
to provide accurate relative gain correction constants.
You'll get a series of plots in the output directory as well.
Appendix
Appendix
********
********
Loading