Population of the calibration store with constants is a significant problem for instrument scientists and users. Regular dark processing script calibrun produces significant portion of constants (pedestals, pixel_status, pixel_rms) for all regular detectors with single gain range.
Recently a few scripts were developed for dark processing and deployment constants for multigain detectors Jungfrau and Epix10ka. and geometry constants deployment.
New script deploy_constants
is intended for deployment of default-style pre-defined calibration constants. These constants can be provided quite flexibly for any detector type, any specic detector, for variable time stamp, etc.
Code
Essential code is implemented under the Detector package in modules app/deploy_constants and src/UtilsDeployConstants.py
Command
In psana environment on any psana node (with access to data) use command
deploy_constants -h
Repository
Repository structure is defined for flexibility to account for detector dependent time dependent and default constants
Repository: repodir = /reg/g/psdm/detector/calib/constants/ Log files: <repodir>/logs/ - directory for log files <repodir>/logs/<YEAR>/<time-stamp>_log_deploy_constants_<uid>.txt ex: <repodir>/logs/2022/2022-06-09T121926_log_deploy_constants_dubrovin.txt Detector type directory: <repodir>/<dettype> - detector type directory for dettypes: cspad, cspad2x2, epix100a, pnccd <repodir>/<dettype>/.aliases.txt - dictionary between detector id/name and short alias Directory for default files: <repodir>/<dettype>/default/ <dettype>_default_<ctype>.txt ex: epix100a_default_gain.txt Specific detector directory: <repodir>/<dettype>/<detector-id-or-name>/ Calibration type subdirectory: <repodir>/<dettype>/<detector-id-or-name>/<calib-type>/ <dettype>_<alias>_<YYYYmmddHHMMSS>_<exp-name>_r<run-number>_<ctype>.txt ex: epix100a_0001_20100101000000_xpptut15_r0260_gain.txt
Content
Currently a few files with constants are supplied for epix100a gain, common_mode and geometry
- /reg/g/psdm/detector/calib/constants/epix100a/default/epix100a_default_common_mode.txt, epix100a_default_gain.txt, epix100a_default_geometry.txt
- /reg/g/psdm/detector/calib/constants/epix100a/3925999616-0996579585-0553648138-1232098304-1221641739-2650251521-3976200215/gain/epix100a_0001_20100101000000_xpptut15_r0260_gain.txt
epix100a default constants
Default gains for epix100a are set in software as unite. Some of users requested constants as 0.060 keV/ADU. File epix100a_default_gain.txt contains gain factors 0.06 for all pixels. Command to install this constants is
deploy_constants -e <experiment> -d <detector> -r <run-number> -C gain -D
For example, test it for deployment in your local calib directory:
deploy_constants -e xpptut15 -r 260 -d XcsEndstation.0:Epix100a.1 -C gain -D -c calib
Functionality
Fully flagged command with correct list parameters (-e xpptut15 -r 260 -d XcsEndstation.0:Epix100a.1 -C gain) tries to access if available or creates the repository directory tree. If specific file for the run or specified (-t TSTAMP, --tstamp TSTAMP) time stamp is available it will be deployed under standard or specified (-c DIRCALIB, --dircalib DIRCALIB) calib directory. If calibration file is not found - nothing is deployed and apropriate warning is generated in the log file.