Content
Overview
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 multi-gain detectors Jungfrau and Epix10ka. Separate application was developed for geometry constants deployment.
New script deploy_constants
is intended for deployment of default-style calibration constants. These constants can be deployed depending on detector type, specific detector id/name, time stamp.
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
Structure of repository is designed to account for detector type/id/name and time dependent constants. We assume that
repodir = <PATHREPO>/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
What is available
Currently a few files with constants are supplied for epix100a gain, common_mode and geometry
- <PATHREPO>/detector/calib/constants/epix100a/default/epix100a_default_common_mode.txt, epix100a_default_gain.txt, epix100a_default_geometry.txt
- <PATHREPO>/detector/calib/constants/epix100a/3925999616-0996579585-0553648138-1232098304-1221641739-2650251521-3976200215/gain/epix100a_0001_20100101000000_xpptut15_r0260_gain.txt → reference to one of defaults.
If needed content of repository can be extended for other detectors and calibration types.
epix100a default constants
Default gains for epix100a are set equal to ones. 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
Test command below deploys constants under the local calib directory:
deploy_constants -e xpptut15 -r 260 -d XcsEndstation.0:Epix100a.1 -C gain -D -c calib
methods to populate repository
Since ana-4.0.45 a couple of methods are introduced to populate repository with constants, as shown in examples.
Functionality
Command with correct list of parameters (-e xpptut15 -r 260 -d XcsEndstation.0:Epix100a.1 -C gain) tries to access if available or create 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 appropriate warning is generated in the log file. Created directory tree for new detector can be used to add new default or time-stamp-dependent calibration files.
Extension
Currently repository is populated manually for a few default files.
Script calibrun can be updated to populate new repository for dark processing results (pedestals, pixel_status, pixel_rms, etc.)
References
- calibrun - CLI for dark calibration of regular detectors
- Detector geometry constants deployment
- Jungfrau and Epix10ka Calibration
- Calibration Scripts Repository and Logging
- Path to data and calibration constants for psana in LCLS1 - defines <PATHREPO>