Content

Overview

This note extends Jungfrau and Epix10ka Calibration for specific commands to produce calibration constants. These commands work with all epix10ka composite detectors from single-panel to 4-panel quad and 16-panel epix10ka2m.

Scripts

There are three major scripts intended for production of intensity correction constants:

scripts to generate intensity correction constants
epix10ka_offset_calibration -h     # done more rarely by psana/detector experts on 103-calib-cycle dark + charge injection runs
epix10ka_pedestals_calibration -h  # done quite often on 5-calib-cycle dark runs
epix10ka_deploy_constants -h       # merges per-panel-per-gain-range constants in full scale calibration files of shape (7, <number-of-panels>, 352, 384)
geometry_deploy_constants -h       # deploy geometry files obtained from optical metrology

NOTE: The "-h" option for all commands shows common example syntax, as well as descriptions of parameters.

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"

/sdf/group/lcls/ds/ana/detector/gains/epix10k/panels/

/sdf/group/lcls/ds/ana/detector/gains/epix10k/panels/logs/

/sdf/group/lcls/ds/ana/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 detdaq18 run 80 or 92. These parameters needs to 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.

Processing time of this file is quite long, so it is split for panels, which can be run in parallel, that still takes ~1hour 30min.

List of commands to process all panels in batch:

epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i0  -p
epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i1  -p
epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i2  -p
...
epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i15 -p

#in batch (should be in slurm now)
bsub -o 2020-07-14-detdaq18-r92-offset-log15 -q psanaq epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -i15 -p

Log files can be found in:

/sdf/group/lcls/ds/ana/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

Philip's recipe to produce offsets
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.

To speed-up processing commands are split for 5 calib-cycles. Processing time is a few minutes per gain range so script can be run interactively or in batch.

Interactive commands:

commands for interactive processing of 5 calib-cycle dark runs
epix10ka_pedestals_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r80 -c 0
epix10ka_pedestals_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r80 -c 1
epix10ka_pedestals_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r80 -c 2
epix10ka_pedestals_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r80 -c 3
epix10ka_pedestals_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r80 -c 4

Log files:

/sdf/group/lcls/ds/ana/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.

Merging and deployment

Script epix10ka_deploy_constants merges per-panel-per-gain-range constants in full scale calibration files of shape (7, <number-of-panels>, 352, 384) and deploys them under experiment calib directory.

Execution time is a few minutes, so everything can be done interactively.

Command:

cammand for merging and deployment of calibration constants
epix10ka_deploy_constants -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r92 -D -p psrc

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

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

Log file in:

/sdf/group/lcls/ds/ana/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

  • /sdf/group/lcls/ds/ana/detector/calib/geometry/epix10ka/
  • /sdf/group/lcls/ds/ana/detector/calib/geometry/epix10ka2m/
  • /sdf/group/lcls/ds/ana/detector/calib/geometry/epix10kaquad/
Current content of the directory /sdf/group/lcls/ds/ana/detector/calib/geometry/epix10ka2m/
ana-4.0.62-py3 [dubrovin@sdfiana004:~/LCLS/con-py3]$ ls -1  /sdf/group/lcls/ds/ana/detector/calib/geometry/epix10ka2m
2018-11-15-geometry-epix10ka2m.txt
2020-02-25-geometry-epix10ka2m.1-v0-z0.txt
2020-02-25-geometry-epix10ka2m.1-v1-mfxc00118-0044-z0.txt
2020-02-25-geometry-epix10ka2m.1-v1-mfxc00318-0013-z0.txt
2020-06-25-geometry-epix10ka2m.0-v1.txt
2020-09-10-geometry-epix10ka2m.1-v1-cortilt-center.txt
2021-02-02-geometry-epix10ks2m.1-recentred-for-psana.txt
2021-02-02-geometry-epix10ks2m.1.txt
2022-03-08-geometry-epix10ka2m-APS-1-r2.txt
2024-08-09-geometry-epix10ks2m.0.txt
 epix10ka2m_default.data
epix10ka2m_MfxEndstation-0-Epix10ka2M-0_20200225.data -> 2020-02-25-geometry-epix10ka2m.1-v0-z0.txt
epix10ka2m_MfxEndstation-0-Epix10ka2M-0_20200910.data -> 2020-09-10-geometry-epix10ka2m.1-v1-cortilt-center.txt
epix10ka2m_MfxEndstation-0-Epix10ka2M-0_20210202.data -> 2021-02-02-geometry-epix10ks2m.1-recentred-for-psana.txt
epix10ka2m_tmp.data
epix10ka2m_XcsEndstation-0-Epix10ka2M-0_20181115.data -> 2018-11-15-geometry-epix10ka2m.txt
epix10ka2m_XppGon-0-Epix10ka2M-0_20200625.data -> 2020-06-25-geometry-epix10ka2m.0-v1.txt
README-2022-03-23

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

  • geometry_deploy_constants -h
  • fallback command: calibfile deploy -h
Example of the geometry_deploy_constants
geometry_deploy_constants -e mfxp1003323 -r 16 -d MfxEndstation.0:Epix10ka2M.0 -D -c calib --runrange 16-end # test command deploys geometry file under the local calib/ directory
geometry_deploy_constants -e mfxp1003323 -r 24 -d MfxEndstation.0:Epix10ka2M.0 -D --runrange 24-end 
geometry_deploy_constants -e xcsl1036223 -r 50 -d XcsEndstation.0:Epix10ka2M.0 -D --runrange 50-end
geometry_deploy_constants -e xppl1002323 -r 50 -d XppGon.0:Epix10ka2M.0 -D --runrange 51-end

Maintanance of the geometry files' repository

In release ana-4.0.63-py3 and above

Selection of the geometry files is based on the detector alias and time stamp association like epix10ka2m_0002_20241003012345.data, where the detector alias epix10ka2m_0002 is created from the list of panel ids, as listed in <repository>/.aliases-epix10ka2m.txt

  • new geometry file evaluated from optical metrology or somehow updated heeds to be copied in repository /sdf/group/lcls/ds/ana/detector/calib/geometry/epix10ka2m/ with arbitrary name like 2021-02-02-geometry-epix10ks2m.1-recentred-for-psana.txt, specifying its creation date and associated detector, i.g. epix10ks2m.0 or epix10ks2m.1 etc.
  • new data for this detector need to be produced
  • expert command ones per optical metrology - link between detector alias name and new geometry file must be generated by command like: geometry_deploy_constants -e mfxp1003323 -r 24 -d MfxEndstation.0:Epix10ka2M.0 -a 2021-02-02-geometry-epix10ks2m.1-recentred-for-psana.txt -t 20240225120000 -D
  • instrument scientist command, once per new hatch detector innstalled/replaced - deploy geometry under calib directory: geometry_deploy_constants -e mfxp1003323 -r 24 -d MfxEndstation.0:Epix10ka2M.0 --runrange 24-end -D -c calib

In release ana-4.0.62-py3 and below

Selection of the geometry is based on the detector nname and time stamp association like epix10ka2m_XppGon-0-Epix10ka2M-0_20200625.data

  • New geometry file evaluated from optical metrology must be copied to /sdf/group/lcls/ds/ana/detector/calib/geometry/epix10ka2m with arbitrrary name, like 2020-02-25-geometry-epix10ka2m.1-v1-mfxc00318-0013-z0.txt, relecting production date, detector type, possible experiment for further alignment, etc.
  • Reference like epix10ka2m_MfxEndstation-0-Epix10ka2M-0_20200225.data -> 2020-02-25-geometry-epix10ka2m.1-v0-z0.txt with pre-deffined name should be created to use the new geometry file in the geometry_deploy_constants.

References


  • No labels