diff --git a/doc/BOZ analysis part I.a Correction determination.ipynb b/doc/BOZ analysis part I.a Correction determination.ipynb index 5a0c18250e919793741d8f1073447a564eb6b8eb..56c558cbd51a269ecd98a9d04d001caa5439470c 100644 --- a/doc/BOZ analysis part I.a Correction determination.ipynb +++ b/doc/BOZ analysis part I.a Correction determination.ipynb @@ -75,21 +75,6 @@ "rois_th = 4" ] }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "proposal = int(proposal)\n", - "darkrun = int(darkrun)\n", - "run = int(run)\n", - "module = int(module)\n", - "gain = int(gain)\n", - "sat_level = int(sat_level)\n", - "rois_th = int(rois_th)" - ] - }, { "cell_type": "code", "execution_count": 3, diff --git a/doc/howtos.rst b/doc/howtos.rst index e157a9d0205e2f61b5c9d325bd538abd3f58ab0e..961f7c7a2a97ea13c7eb4a6d9e14f74c610b430c 100644 --- a/doc/howtos.rst +++ b/doc/howtos.rst @@ -121,9 +121,10 @@ reads as: It uses the first notebook and is launched via slurm: -``sbatch ./boz_parameters_job.sh 615 614 3`` +``sbatch ./boz_parameters_job.sh -p 2937 -d 615 -r 614 -g 3`` -where 615 is the dark run number, 614 is the run on 3 broken membranes and 3 is +where 2937 is the proposal run number, where 615 is the dark run number, +614 is the run on 3 broken membranes and 3 is the DSSC gain in photon per bin. The proposal run number is defined inside the script file. diff --git a/doc/scripts/boz_parameters_job.sh b/doc/scripts/boz_parameters_job.sh index f8c199a10f4883798c5e415c8195a5110123b64f..99a4b121b23537ec1e98a069d342f6033ba34249 100644 --- a/doc/scripts/boz_parameters_job.sh +++ b/doc/scripts/boz_parameters_job.sh @@ -5,14 +5,31 @@ #SBATCH --mail-type=END,FAIL #SBATCH --output=logs/%j-%x.out -PROPOSAL=2784 -DARK=$1 -RUN=$2 -GAIN=$3 -ROISTH=${4:-1} -SATLEVEL=${5:-500} -MODULE=15 +ROISTH='1' +SATLEVEL='500' +MODULE='15' +while getopts ":p:d:r:k:g:t:s:m:" option +do + case $option in + p) PROPOSAL="$OPTARG";; + d) DARK="$OPTARG";; + r) RUN="$OPTARG";; + k) KERNEL="$OPTARG";; + g) GAIN="$OPTARG";; + t) ROISTH="$OPTARG";; + s) SATLEVEL="$OPTARG";; + m) MODULE="$OPTARG";; + \?) echo "Unknown option" + exit 1;; + :) echo "Missing option for input flag" + exit 1;; + esac +done + +echo ${KERNEL} + +# Load xfel environment source /etc/profile.d/modules.sh module load exfel module load exfel_anaconda3/1.1 @@ -24,20 +41,20 @@ RDIR="$PDIR/usr/processed_runs/r$(printf '%04d' $RUN)" mkdir $RDIR NB='BOZ analysis part I.a Correction determination.ipynb' -KERNEL="SCS Toolbox ($PPROPOSAL)" -#activate the proposal environment -ACTIVATE="$PDIR/usr/Software/envs/toolbox_$PPROPOSAL/bin/activate" -source $ACITVATE +# kernel list can be seen from 'jupyter kernelspec list' +if [ -z "${KERNEL}" ]; then + KERNEL="toolbox_$PPROPOSAL" +fi python -c "import papermill as pm; pm.execute_notebook(\ '$NB', \ - '$RDIR/output.ipynb', \ - parameters=dict(proposal='$PROPOSAL', \ - darkrun='$DARK', \ - run='$RUN', \ - module='$MODULE', \ - gain='$GAIN', \ - rois_th='$ROISTH', \ - sat_level='$SATLEVEL', \ - kernel='$KERNEL'))" + '$RDIR/output.ipynb', \ + kernel_name='$KERNEL', \ + parameters=dict(proposal=int('$PROPOSAL'), \ + darkrun=int('$DARK'), \ + run=int('$RUN'), \ + module=int('$MODULE'), \ + gain=int('$GAIN'), \ + rois_th=int('$ROISTH'), \ + sat_level=int('$SATLEVEL')))"