You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

In multi-panel composite detectors detector geometry constants are required to get arrays of pixel 3-d coordinates and derived objects. Mapping of correct constants with specific detector is a big issue if it is done manually. This note is about script automating/simplifying this job.

Command line interface

To get current information about geometry constants deployment script, use command:

geometry_deploy_constants -h

2022-03-25 results of the command> geometry_deploy_constants -h
(ana-4.0.37) [<username>@psanagpu106:~/LCLS/con-py2]$ geometry_deploy_constants -e xpptut15 -r 320 -d XppGon.0:Cspad.0 -D -c ./calib -h
usage: 
geometry_deploy_constants -e <experiment> -d <detector> -r <run-number> [-D] [-L <logging-mode>] [...]

REGULAR COMMAND EXAMPLE:
  geometry_deploy_constants -e cxilu9218 -d CxiDs1.0:Jungfrau.0 -r238 --posz -100000 --posx 0 --posy 0 --rotz 90 -D --runrange 10-20

TEST COMMANDS:
Ex.1  for Cspad CXI    : geometry_deploy_constants -e xpptut15 -r 380 -d CxiDs1.0:Cspad.0 -D -c ./calib
Ex.2  for Cspad CXI    : geometry_deploy_constants -e xpptut15 -r 380 -d CxiDs2.0:Cspad.0 -D -c ./calib
Ex.3  for Cspad XPP    : geometry_deploy_constants -e xpptut15 -r 320 -d XppGon.0:Cspad.0 -D -c ./calib
Ex.4  for cspad2x2     : geometry_deploy_constants -e xpptut15 -r 460 -d MecTargetChamber.0:Cspad2x2.3 -D -c ./calib --posz -100000 --posx 10 --posy -20 --rotz 90
Ex.5  for jungfrau512k : geometry_deploy_constants -e xpptut15 -r 410 -d MfxEndstation.0:Jungfrau.1 -D -c ./calib
Ex.6  for jungfrau1M   : geometry_deploy_constants -e xpptut15 -r 430 -d MfxEndstation.0:Jungfrau.0 -D -c ./calib
Ex.7  for jungfrau4M   : geometry_deploy_constants -e xpptut15 -r 530 -d DetLab.0:Jungfrau.2 -D -c ./calib
Ex.8  for epix10ka2m   : geometry_deploy_constants -e xpptut15 -r 570 -d MfxEndstation.0:Epix10ka2M.0 -D -c ./calib
Ex.9  for epix100a     : geometry_deploy_constants -e xpptut15 -r 260 -d XcsEndstation.0:Epix100a.1 -D -c ./calib
Ex.10 for pnCCD        : geometry_deploy_constants -e xpptut15 -r 450 -d Camp.0:pnCCD.1 -D -c ./calib
Ex.11 for epix10kaquad : geometry_deploy_constants -e xpptut15 -r 590 -d MecTargetChamber.0:Epix10kaQuad.0 -D -c ./calib
Ex.12 for epix10kaquad : geometry_deploy_constants -e xpptut15 -r 590 -d MecTargetChamber.0:Epix10kaQuad.1 -D -c ./calib
Ex.13 for epix10kaquad : geometry_deploy_constants -e xpptut15 -r 590 -d MecTargetChamber.0:Epix10kaQuad.2 -D -c ./calib
Ex.14 for epix10kaquad : geometry_deploy_constants -e xpptut15 -r 590 -d MecTargetChamber.0:Epix10kaQuad.3 -D -c ./calib

Help:  geometry_deploy_constants -h

Deployment of geometry calibration parameters

optional arguments:
  -h, --help            show this help message and exit
  -e EXP, --exp EXP     experiment name, default = None
  -d DET, --det DET     detector name, default = None
  -r RUN, --run RUN     run number of the existing dataset to get run time-
                        stamp, detector full name etc., default = None
  -t TSTAMP, --tstamp TSTAMP
                        non-default time stamp (<YYYYmmddHHMMSS) or run
                        number(<10000) for constants selection in repo. By
                        default run time is used, default = None
  -s DSSUFFIX, --dssuffix DSSUFFIX
                        dataset name suffix beyond
                        exp=<expname>:run=<runnum><dssuffix>, for example
                        ":smd:dir=<path>/xtc/", default = None
  -x DSNAME, --dsname DSNAME
                        overrides exp=<expname>:run=<runnum><dssuffix> if
                        specified, e.g. path to *.xtc file, default = None
  -o DIRREPO, --dirrepo DIRREPO
                        non-default repository of calibration results, default
                        = /reg/g/psdm/detector/calib/geometry/
  -c DIRCALIB, --dircalib DIRCALIB
                        deployment calib directory if different from standard
                        one, default = None
  -l LOGLEV, --loglev LOGLEV
                        logging mode, one of INFO, CRITICAL, WARN, WARNING,
                        ERROR, DEBUG, NOTSET, default = INFO
  --dirmode DIRMODE     mode for all mkdir, default = 511
  --filemode FILEMODE   mode for all saved files, default = 438
  -D, --deploy          deploy constants to the calib dir, default = False
  -R RUNRANGE, --runrange RUNRANGE
                        validity run range for output calibration file,
                        default = 0-end
  --parent PARENT       parent frame name containing the detector geometry
                        object, default = IP
  --posx POSX           detector position x[um] relative IP, default =
                        0.000000
  --posy POSY           detector position y[um] relative IP, default =
                        0.000000
  --posz POSZ           detector position z[um] relative IP, default =
                        -100000.000000
  --rotx ROTX           detector rotation angle [degree] around axis x,
                        default = 0.000000
  --roty ROTY           detector position angle [degree] around axis y,
                        default = 0.000000
  --rotz ROTZ           detector position angle [degree] around axis z,
                        default = 0.000000

Algorithm

Command geometry_deploy_constants <parameters> checks experiment (-e, –-exp) run (-r, –-run) information for requested detector (-d, –-det), finds the run time stamp, finds appropriate file with geometry constants in the repository (-o, --dirrepo), changes detector orientation, apply translation relative IP (if parameters --parent, --pos*, --rot* specified) and deploys constants under <experiment>/calib directory, or directory specified by parameter (-c, --calibdir). Results of this command, depending on parameter (-l, --loglev), are dumped on terminal and preserved in the logfile

<dirrepo>/logs/<year>/<time-stamp>_log_geometry_deploy_constants_<user-login-name>.txt

Repository

Conventions about repository containing files with geometry calibration constants. 

Currently -o,--dirrepo is set to /reg/g/psdm/detector/calib/geometry/

Current content of --dirrepo
(ana-4.0.37) [<username>@psanagpu106:/reg/g/psdm/detector/calib/geometry]$ ls -l
total 4
drwxr-xr-x 1 dubrovin br  0 Mar 22 14:13 andor
drwxr-xr-x 1 dubrovin br  0 Mar 22 14:08 andor3d
drwxrwxr-- 1 dubrovin br  0 Mar 24 11:30 cspad
drwxrwxr-- 1 dubrovin br  0 Mar 24 11:55 cspad2x2
drwxrwxr-- 1 dubrovin br  0 Mar 24 12:00 epix100a
drwxrwxr-- 1 dubrovin br  0 Mar 23 14:54 epix10ka
drwxr-xr-x 1 dubrovin br  0 Mar 24 12:14 epix10ka2m
drwxr-xr-x 1 dubrovin br  0 Mar 24 13:42 epix10kaquad
drwxrwxr-- 1 dubrovin br  0 Mar 23 10:14 jungfrau
drwxrwxrwx 1 dubrovin br  0 Mar 15 09:55 logs
drwxrwxr-- 1 dubrovin br  0 Mar 17 15:02 pnccd
drwxr-xr-x 1 dubrovin br  0 Mar 22 09:33 rayonix

and beside logfiles under subdirectory logs/ it contains directories for "all" detector types which need in geometry constants. 

Currently repository is fully populated for cspad, cspad2x2, epix100a, epix10ka, epix10ka2m, epix10kaquad, jungfrau, pnccd. If other detector(s) required they need to be populated here.

Population of the directory epix10ka2m
/reg/g/psdm/detector/calib/geometry]$ ls -l1 epix10ka2m
total 68
-rw-r--r-- 1 dubrovin br 3662 Mar 22 13:16 2018-11-15-geometry-epix10ka2m.txt
-rw-r--r-- 1 dubrovin br 3720 Mar 22 13:15 2020-02-25-geometry-epix10ka2m.1-v0-z0.txt
-rw-r--r-- 1 dubrovin br 3350 Mar 22 13:15 2020-02-25-geometry-epix10ka2m.1-v1-mfxc00118-0044-z0.txt
-rw-r--r-- 1 dubrovin br 3355 Mar 22 13:14 2020-02-25-geometry-epix10ka2m.1-v1-mfxc00318-0013-z0.txt
-rw-r--r-- 1 dubrovin br 3268 Mar 22 13:15 2020-06-25-geometry-epix10ka2m.0-v1.txt
-rw-r--r-- 1 dubrovin br 3424 Mar 22 13:14 2020-09-10-geometry-epix10ka2m.1-v1-cortilt-center.txt
-rw-r--r-- 1 dubrovin br 3340 Mar 22 11:12 2021-02-02-geometry-epix10ks2m.1-recentred-for-psana.txt
-rw-r--r-- 1 dubrovin br 3267 Mar 22 11:12 2021-02-02-geometry-epix10ks2m.1.txt
-rw-r--r-- 1 dubrovin br 3355 Mar 22 13:21 epix10ka2m_default.data
lrwxrwxrwx 1 dubrovin br   42 Mar 22 10:50 epix10ka2m_MfxEndstation-0-Epix10ka2M-0_20200225.data -> 2020-02-25-geometry-epix10ka2m.1-v0-z0.txt
lrwxrwxrwx 1 dubrovin br   54 Mar 22 10:55 epix10ka2m_MfxEndstation-0-Epix10ka2M-0_20200910.data -> 2020-09-10-geometry-epix10ka2m.1-v1-cortilt-center.txt
lrwxrwxrwx 1 dubrovin br   56 Mar 22 13:09 epix10ka2m_MfxEndstation-0-Epix10ka2M-0_20210202.data -> 2021-02-02-geometry-epix10ks2m.1-recentred-for-psana.txt
lrwxrwxrwx 1 dubrovin br   34 Mar 22 10:43 epix10ka2m_XcsEndstation-0-Epix10ka2M-0_20181115.data -> 2018-11-15-geometry-epix10ka2m.txt
lrwxrwxrwx 1 dubrovin br   39 Mar 22 10:45 epix10ka2m_XppGon-0-Epix10ka2M-0_20200625.data -> 2020-06-25-geometry-epix10ka2m.0-v1.txt

Script finds path to the geometry file using its name conventions:

<dirrepo>/<det-type>/<dettype>_<full-lcls1-detector-name>_<time-stamp>.data

where the time-stamp is presented in format YYYYMMDD (it is assumed that optical metrology or variation of geometry constants do not need to be changed more often than once per day...).

If geometry file for specified detector and time-stamp is missing, constants from <dettype>_default.data will be loaded.

Tracking down possible issues

From log-file (or dump on terminal) it should be quite clear what script is doing and what problem might be. Please pay attention that

  • script grabs expected file for requested detector and time-stamp
  • check if the geometry file in its final destination under the calib/ directory is available and not empty
  • please report about any issues

References

  • No labels