Content
Intro
This page describes mechanism of calibration constants dynamic generation and access for multi-panel jungfrau detector. This is relevant to rarely changed constants of types gain
and offset
, e.g. for single-panel detector
- gain: shape:(3, 1, 512, 1024) size:1572864 dtype:float32
- offset: shape:(3, 1, 512, 1024) size:1572864 dtype:float32
which are combined from 3 per-panel files with shape (512, 1024).
Naming conventions
Since psana.Jungfrau.ConfigV3 software provides per-segment access to the class ModuleConfigV1 object with three methods
- moduleVersion()
- firmwareVersion()
- serialNumber()
which return 64-bit integer numbers like 1511699, 23403815178277, 3997947, respectively. However, some of these numbers in hexadecimal format looks as dates and times. For better readability the panel Id name can be formatted as '%s-%s-%s', for hexadecimal values with dropped '0x' (hex(v).lsplit('0x'), e.g. "171113-154920171025-3d00fb".
Then, total Jungfrau Id is a variable-length underscore-separated concatenation of sequential segment Id names, i.g. for two segments of exp=xcsls3716:run=631, XcsEndstation.0:Jungfrau.0 Id is 170505-149520170815-3d00b0_170505-149520170815-3d00f7.
API
Method returning Jungfrau and its segments' Ids is implemented in Detector/src/UtilsJungfrau.py and can be used as in example:
import psana from Detector.UtilsJungfrau import id_jungfrau ds = psana.DataSource('xpptut15:run=430') env = ds.env() src = 'MfxEndstation.0:Jungfrau.0' # or part of the DetInfo name 'Jung' or 'Jungfrau.1' or alias 'jungfrau1M' print 'id_jungfrau(env, src, 0):', id_jungfrau(env, src, iseg=0) # for segment 0 print 'id_jungfrau(env, src, 1):', id_jungfrau(env, src, iseg=1) # for segment 1 print 'id_jungfrau(env, src) :', id_jungfrau(env, src) # for all segments
which prints
id_jungfrau(env, src, 0): 171113-154920171025-3d00b0 id_jungfrau(env, src, 1): 171113-154920171025-3d00f7 id_jungfrau(env, src) : 171113-154920171025-3d00b0_171113-154920171025-3d00f7
CLI
A few commands which shed light on data with jungfrau detector are listed below.
Command line to get jungfrau Id:
jungfrau_id exp=xpptut15:run=430 [Jungfrau.0]
Command line to get jungfrau psana.EventKey objects:
event_keys -d exp=xpptut15:run=430 -m2 -p Jung
Command line to find experiment runs with jungfrau:
find_detector_runs MFX jungfrau
Available data
Summary of experiments/runs with jungfrau data on 2018-04-19 is listed below.
Calibration production
For now, firmware calibration for offset
and gain
is produced per segment (named as M044, M068, M088, etc.), e.g. directory /reg/g/psdm/detector/gains/jungfrau/M088/ contains:
g0_gain.npy g0_offset.npy g1_gain.npy g1_offset.npy g2_gain.npy g2_offset.npy
For auto-generation of calibration files it is suggested to
- keep segment calibration files under /reg/g/psdm/detector/gains/jungfrau/
- use segment Id names in stead of M088 etc with possible referencing
- keep the same naming conventions for gain range and type (g1_gain.npy, g1_offset.npy, g2_gain.npy, etc.)
- versions?
Calibration file for particular detector can be generated dynamically using names of its segments from configuration data. Thus generated file can be deployed in the calib or "generic" repository.
Content of panel calibration directory
/reg/g/psdm/detector/gains/jungfrau/
Panel Ids in hexadecimal format 171113-154920171025-3d00b0 <- this may be reference to one of the M0## directories 171113-154920171025-3d00f7 170505-149520170815-3d00b0 170505-149520170815-3d00f7 171113-154920171025-3d00fb Philip's assignment: M044/ for exp=mfx11116:run=689 171113-154920171025-3d00fb-20180306000000 M088,M068: exp=xcsx22015:run=513, psana.Jungfrau.ConfigV2, XcsEndstation.0:Jungfrau.0 run 503 on Oct 25, 2017 Later experiment: exp=xcsls3716:run=631, id=170505-149520170815-3d00b0_170505-149520170815-3d00f7 run 1 on Dec 5, 2017 16:14 M068/ 170505-149520170815-3d00b0-20171025000000 M088/ 170505-149520170815-3d00f7-20171025000000
Questions
- prefix zeroes in the name
- calibration versions
References