Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

These commands can be executed in psana (1) environment.

Panel constants repository and file naming conventions

Currently per-panel calibration constants resides under directory called as "repository"

/reg/g/psdm/detector/gains/epix10k/panels/

/reg/g/psdm/detector/gains/epix10k/panels/logs/

/reg/g/psdm/detector/gains/epix10k/panels/<panel-id>/<calibration-type>/<file-name.dat/txt>

The panel constants file name consists of fields to provide unique self-describing content

<panel-type>_<panel-id-short-number>-<timestamp-as-YYYYmmDDHHMMSS>_<experiment>_r<run-number>_<calibration-type>_<gain-range>.dat

for example 

epix10ka_0110_20210727105515_detdaq19_r0082_pedestals_FH.dat

See more in EPIX10KA Per-panel calibration constants


Example of commands

Examples assume that processing is done on 2020-07-14 on detdaq18 run 80 or 92. These parameters needs to substututed for real be substituted in actual processing.

Offset and gain calibration

Regular offset and gain calibration

Script epix10ka_offset_calibration works on special runs containing 103 calib-cycles =  5 dark + 2 x (7x7) charge injection.

...

List of commands to process all panels in batch:

Code Block
bsub -o 2020-07-14-r92-offset-log00 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i0  -p
bsub -o 2020-07-14-r92-offset-log01 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i1  -p
bsub -o 2020-07-14-r92-offset-log02 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i2  -p
bsub -o 2020-07-14-r92-offset-log03 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i3  -p
bsub -o 2020-07-14-r92-offset-log04 -q psanaq ...
epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i4i15  -p

bsub#in -o 2020-07-14-r92-offset-log05 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i5  -pbatch (should be in slurm now)
bsub -o 2020-07-14-detdaq18-r92-offset-log06log15 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i6i15  -p
bsub -o 2020-07-14-r92-offset-log07 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i7  -p
bsub -o 2020-07-14-r92-offset-log08 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i8  -p
bsub -o 2020-07-14-r92-offset-log09 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i9  -p
bsub -o 2020-07-14-r92-offset-log10 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i10 -p
bsub -o 2020-07-14-r92-offset-log11 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i11 -p
bsub -o 2020-07-14-r92-offset-log12 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i12 -p
bsub -o 2020-07-14-r92-offset-log13 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i13 -p
bsub -o 2020-07-14-r92-offset-log14 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i14 -p
bsub -o 2020-07-14-r92-offset-log15 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i15 -p

To preserve batch log files for references in future please copy them by command:

cp 2020-07-14-r92-offset-log* /reg/g/psdm/detector/gains/epix10k/panels/logs/

...

-p

Log files can be found in:

/reg/g/psdm/detector/gains/epix10k/panels/logs/

If everything in log files looks fine, they have the same size, then per-panel-per-gain-range constants needs to be merged and deployed.

Alternative offset calibration

Regular offset calibration procedure is complicated and may not be available for new detectors.

If the offset files are missing in the directory /reg/g/psdm/detector/gains/epix10k/panels/<panel-id>/offset/

pedestals for gain switching modes created by command epix10ka_deploy_constants will be zeros.

Philip has developed a script to populate the panel offset directory with files of type offsetph like

epix10ka_0110_20210513000001_detdaq19_r0082_offsetph_AML.dat

Code Block
titlePhilip's recipe to produce offsets
collapsetrue
Hart, Philip Adam <philiph@slac.stanford.edu> Wed 10/13/2021 12:48 PM
JFTR, under ~/philiph/psana/mfxc00118/mfxlx4219
I have run
python deployOfficial10kOffsetsV2.py MFX
source deploy_offsetph_constants.sh
with output
2021-10-13-r384-log-epix10ka-deploy-constants
and now we have what look like sensible AML-L pedestals.
Bhavna, we should officialize this during in a calm in the storm.
Thanks,
Philip

Example for population of the offset directory with correct names is in

https://github.com/lcls-psana/Detector/blob/master/examples/ex_epix10ka_save_ctype_in_repo.py

Formulae for pedestals of AML-L and AHL-L is changed by Philip's request,
AML_L pedestal = FL + offset, if offset is available, otherwise 0 (or can be changed to FL).

Pedestal calibration

Script epix10ka_pedestals_calibration works on special runs containing 5 dark calib-cycles.

...

Code Block
titlecommands for interactive processing of 5 calib-cycle dark runs
epix10ka_pedestals_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r80 -c 0 &> 2020-07-14-r80-cc0-log-epix10ka-pedestals-calibration&
epix10ka_pedestals_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r80 -c 1 &> 2020-07-14-r80-cc1-log-epix10ka-pedestals-calibration&
epix10ka_pedestals_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r80 -c 2 &> 2020-07-14-r80-cc2-log-epix10ka-pedestals-calibration&
epix10ka_pedestals_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r80 -c 3 &> 2020-07-14-r80-cc3-log-epix10ka-pedestals-calibration&
epix10ka_pedestals_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r80 -c 4 &> 2020-07-14-r80-cc4-log-epix10ka-pedestals-calibration& 

Similar batch commands:

Code Block
titlecommands for batch processing of 5 calib-cycle dark runs
bsub -o 2020-07-14-r80-cc0-log-epix10ka-pedestals-calibration -q psanaq epix10ka_pedestals_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r80 -c 0
bsub -o 2020-07-14-r80-cc1-log-epix10ka-pedestals-calibration -q psanaq epix10ka_pedestals_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r80 -c 1
bsub -o 2020-07-14-r80-cc2-log-epix10ka-pedestals-calibration -q psanaq epix10ka_pedestals_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r80 -c 2
bsub -o 2020-07-14-r80-cc3-log-epix10ka-pedestals-calibration -q psanaq epix10ka_pedestals_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r80 -c 3
bsub -o 2020-07-14-r80-cc4-log-epix10ka-pedestals-calibration -q psanaq epix10ka_pedestals_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r80 -c 4

Log files:

Then preserve log files:cp 2020-07-14-r80-cc*-log-epix10ka-pedestals-calibration /reg/g/psdm/detector/gains/epix10k/panels/logs/

...

Code Block
titlecammand for merging and deployment of calibration constants
epix10ka_deploy_constants -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -D -p psrc &> 2020-07-14-r92-log-epix10ka-deploy-constants

Parameter "-p psrc" specifies what constants need to be saved, where "c" stands for charge injection gains (see help).

Preserve log file:

By default "-p psrg" and constant gains are deployed as high/medium/low = 16.4/5.466/0.164 ADU/keV.

Log file in:

cp 2020-07-14-r92-offset-log* /reg/g/psdm/detector/gains/epix10k/panels/logs/

Geometry

Geometry constants generated from optical metrology (see dates in directory names) and data tuning in psana format resides under

  • /reg/g/psdm/detector/alignment/epix10ka/
  • /reg/g/psdm/detector/alignment/epix10ka2m/
  • /reg/g/psdm/detector/alignment/epix10kaquad/

The last line of the geometry file needs in adjustment of the detector position relative IP.

Constants needs to be deployed under <experiment>/calib/ directory using command in lcls environment set by source /cds/sw/ds/ana/conda1/manage/bin/psconda.sh like

  • calibfile deploy -h

References

...