Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Content

Table of Contents

Purpose

  • short-term goal - support in a single place detectors moving across LCLS experiments.
  • perspective goal - calibration store for LCLS-II

It is assumed that hardware configuration of modern detectors will be associated with configuration index coming from DAQ. This index will be used to extract hardly retrievable calibration data such as geometry, gain factors etc. in case of transition of the detector from one experiment to another.

Architecture

Requirements

  • instrument independent - detector can be moved between instruments and hatches
  • experiment independent - detector can be moved between experiments
  • portability - calibration data for particular detector should be portable as a self consistent file
  • combination of FS & DB files (hdf5 for uniformity)
  • management model - calibration data should be managed through API only in order to prevent adding/removing unknown files without history
  • API + GUI for central managementdeployment -
  • deployment  can ONLY be done through the API/GUI.
  • time stamp (sec) is THE ONLY value for validity range check.
  • <detname> === <dettype>-<detid> is THE ONLY choice for the official file name. This name is mapped from other aliases.

...

  • Detector name consists of a common part <dettype> and unique part <detid>.
  • Alias to the detector name should be kept in separate dictionary outside the scheme.
  • Each detector may have optional predecessor, successor, and other tags in the dictionary.
  • Calibration type folders contain info about calibrations of particular type, ex: pedestals, rms, status, mask, background, etc.
  • Each calibration type contains a set of time stamp ranges defining calibration validity range. If the second time stamp of the range is missing it is considered as infinity (by the end).
  • The time stamp range folder contains tstamp_begin, tstamp_end (int) values, dictionary of tags associated with this folder, reference to the default calibration, and folders with calibration versions, distinguished by there production time stamp.
  • The number of calibration versions for each time stamp range is not limited. Default calibration is defined by the reference default_version.

 

 

Data and metadata in tags

Below are the lists of fields which potentially can be used to define detector and access calibrations

...

Field nameDescriptionMore details, example
dtypedata typeint, float, double, etc
ndimsnumber of dimensions (N)as it says
dim:1size of dim.1...
dim:2size of dim.2...
.........
dim:Nsize of dim.N...

API

Parameters

dettype (str) - detector type: cspad, cspad2x2, pnccd, fccd, opal, epix100a, etc.

...

Code Block
# Import
from PSCalib.CalibStore import CalibStore

# Initialization
CPATH_DEF = '/reg/g/psdm/detector/calib'  # default calib directory
cpath = '<path>/calib'                    # local calib directory
cpath = '<path>/<detname><dettype>-<detid>.h5'     # direct to file
cpath = env.calibDir()                    # '/reg/d/psdm/<INS>/<experiment>/calib' - accept current directory

detname = 'pnccd-12345678'                # standard name includes detector type, dash, and n-digit id number
detname = 'Camera1'                       # alias

cs = CalibStore(cpath, detname)           # creates a CalibStore object.
""" get calibration store object
    Input parameters:
    cpath [str] - path to the hdf5 file or calibration directory. 
                  If cpath is a path to hdf5 file - next parameter is ignored.
                  If cpath=None - default path is used.
                  If cpath is specified as a path to directory (or default) then detname can be an alias.  
    detname [str] - name/alias of the detector 
""" 

UI - acess methods

Code Block
p = tstamp parameter to identify constants, which can be retrieved from evt.run() #- run number, evt

nda = cs.get(ctype, tstamp - parameter to identify constants p) # where ctype stands for pedestals, status, rms, geometry, etc.

nda = cs.pedestals(p)
nda = cs.pixel_status(p)
nda = cs.pixel_rms(p)
nda = cs.pixel_mask(p)
nda = cs.pixel_gain(p)
nda = cs.pixel_bkgd(p)
nda = cs.common_mode(p)

geo = cs.geometry(p)

...

Code Block
cs.addcalib(ctype, nda, p)
cs.delete(ctype, p)
cdic = cs.getdict(ctype)

 

TBD

Open questions

  • What is included in the detector Id version?  FEE version, controller version, etc?
  • when constants are updated (file open to write) they are not available... Lock to resolve.

Data flow

  • who produces and supply constants
  • who is allowed to submit constants
  • who is allowed to access constants
  • ACL inside API or using OS
  • ACL for all or particular detector/type/ etc.

References

...