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

Compare with Current View Page History

« Previous Version 9 Next »

Content

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 management
  • deployment -

Location of calibration directory and files

In LCLS data FS

/reg/g/psdm/detector/calib

or

/reg/d/psdm/calib/ # instrument and experiment independent path

/reg/d/psdm/<INS>/<experiment>/calib # path to current experiment-dependent calibration

In local space

keep entire calib path

  • <path>/calib/<dettype>/<dettype>-<detid>.h5

or use it directly

  • <path>/<dettype>-<detid>.h5

Structure of calibration directory

Everything in lower case:

<path>/calib/
             <dettype>/
             cspad2x2/
             pnccd/
             epix100a/
             cspad/
                      <calib-files>
                      <dettype>-<detid>.h5
                      <dettype>-<detid>.h5

Scheme of the calibration file

 

 

 

Data flow

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

Data and metadata

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

Detector metadata

Field nameDescriptionMore details, example
dettypedetector typeCSPAD, CSPAD2X2, EPIX100A, etc.
detnamedetector unique name(if any) ex.: Camera1
detaliasalias nameif it is hard to memorize the entire name, ex.: 'cspad1'
detidxdetector indexinteger number which codes the hardware version
detidxaliassymbolic alias of the indexcan be used if it is hard to memorize the index integer number
detcompidx:001list of component indexesjust in case if we are going to retrieve calibration parameters for separate components
detidxprevdetector index for previous versiondetector index for previous version (if available) for the purpose of old calibration search
detidxnextdetector index for next versiondetector index for next version (if available) for the purpose of new calibration search
dettsectime-stamptime stamp associated with beginning of the validity range for new configuration
detcom:001comments for this hardware versionas it says {key:comment}
dettag:001other tagsjust in case if something is forgotten in this table

Calibration parameters' metadata

Field nameDescriptionMore details, example
calibtypecalibration typeex.: geometry, pixel_status, pixel_gain, pedestals, common_mode, etc.
tsectime stampbeginning of the validity range
exporiginal experiment(if available) where calibration constants were obtained
runnumoriginal run number(if available) where calibration constants were obtained
runbeginbegin run number(if available) for validity range
runendend run number(if available) for validity range
sourceoriginal DAQ data sourcedata source from DAQ, ex.: 'CxiDs2.0:Cspad.0'
srcaliasdata source aliasex.: 'cspad'
calibversversion tagin order to access using symbolic name or some alias
calibversaliasversion aliasif it is hard to memorize version tag
com:001comments for this versionas it says {key:comment}
tag:001other tagsjust in case if something is forgotten in this table

In case of numpy array their metadata are stored with an object.
Text file needs in n-d array metadata

n-d array metadata

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.

ctype (str) - calibration type: pedestals, status, rms, mask, gain, bkgd, common_mode, geometry

detid (str) - detector unique id number

detname (str) - detector unique name, combination of <dettype>-<detid>

detalias (str) - detector alias name assigned to the detname

cpath (str) - path to the calibration directory (ex: cpath='<path>/calib') or direct hdf5 file name (ex: cpath='<path>/<detname>-<detid>.h5'). Default calibration directory CPATH_DEF='/reg/g/psdm/detector/calib'.

 

 

Initialization

# 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>-<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
detname = 'Camp.0:pnCCD.1'                # accept source

runnum = 10                               # or evt.run()

cs = CalibStore(cpath, detname)
""" 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.
    detname [str] - name/alias of the detector 
""" 

UI - acess methods

p = evt.run() # run number, evt, tstamp - parameter to identify constants

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)

Management methods

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

 

TBD

Open questions

  • Do we have to account for detector version, FEE version, controller version, etc?
  • one DB file per
    • detector version idx
    • detector name (idx-s inside?)
  • db location
  • file name
  • master file
  • when constants are updated (file open to write) they are not available... Lock to resolve.

References

 

  • No labels