Tutorial¶
The goal of this tutorial is to demonstrate the functionality of the offline calibration tool-chain. The main functionality offered by this package is the possibility to run a notebook on the shell with input parameters for the configuration. Extending that concept the package also takes care of starting the necessary jobs on the maxwell cluster, which can be more than one if the notebook makes use of ipyparallel. Finally the pycalibration package will generate a report containing all markup and result cells of the notebook.
The Tutorial consist of this documentation and two very simple notebooks:
notebooks/Tutorial/startversion.ipynb
A simple notebook with no knowledge of the requirements of the offline calibration.
notebooks/Tutorial/calversion.ipynb
Outcome of adapting the startversion notebook to be able to be run with the offline calibration tool-chain.
To have a look at those notebooks start from a shell with the karabo environment:
jupyter-notebook
This will open a jupyter kernel running in your browser where you can then open the notebooks in the folder notebooks/Tutorial. If you in addition also start on another shell the ipcluster as instructed in the calversion.ipynb notebook:
ipcluster start --n=4 --profile=tutorial
you can step through the cells and run them. If you run this notebook using the xfel-calibrate command as explained at the end of this tutorial you do not need to start the cluster yourself, it will be done by the framework.
Create your own notebook¶
Create a new notebook or re-arrange an existing following the guidelines of this documentation
Register you notebook by adding an entry to xfel_calibrate/notebooks.py following the structure given by the existing notebooks.
Note: Use all capital letters for DETECTOR and TYPE.
Load/register the new notebook by updating the installation:
pip install -e .
Running the notebook¶
Make sure output folders you want to use exist
To run your notebook:
xfel-calibrate Tutorial TEST
You can see your job in the queue with:
squeue --me
Look at the generated report in the chosen output folder.
More information on the job run on the cluster can be found in the temp folder.