Versions Compared

Key

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

...

instrument and experiment-independent path to calibration directory and file

  • /reg/g/psdm/<PATH>/detector/calib/
                                              <dettype>/<dettype>-<detid>.h5

...

experiment-dependent path to calibration directory and file

  • /reg/d/psdm<PATH>/<INS>/<experiment>/calib/
                                                                 <dettype>/<dettype>-<detid>.h5

...

local calib path to calibration directory and file

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

...

direct path to calibration file

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

Structure of calibration directory

Everything in lower case:

Code Block
<path><path-to-calib>/calib/                                   # top calib directory
             <dettype>/                         # detector type folders
             cspad2x2/
             pnccd/
             epix100a/
             cspad/
                       <files>                  # level of files
                       <aliases1>.als           # file with a map of aliases to detector names
                       ...
                       <aliasesN>.als           # one of these files can be used to map "sources" to detector names
                       <dettype>-<detid>.h5     # files with detector-dependent calibration data
                       <dettype>-<detid>.h5

 


  • The calib directory is a top level DCS directory.
  • Detector type <dettype> folders are used to organize files under the calib directory. In case of direct access to the hdf5 file the detector type is duplicated in the name of the file.
  • Unique part of the detector name <detid> is used to assign calibration file to the particular detector hardware configuration version. If the detector hardware configuration is changing a new calibration file is created with new <detid>.
  • Information about predecessor and successor (if available) can be saved under the root level of the calibration file.
  • Current sources (ex: 'Camp.0:pnCCD.1' ) could be presented in the dictionary of aliases.

...

Below are the lists of metadata fields which potentially can be used to define detector configuration, calibration parameters etc.

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}
detpar:001other parametersjust 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 parin order to access using symbolic name or some alias
calibversaliasversion aliasif it is hard to memorize version par
com:001comments for this versionas it says {key:comment}
par:001other parametersjust 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
DTYPE(str) data typeint, float, double, etc.
NDIMS(int) number of dimensions (N)ex.: 3
DIM:1(int) size of dim.1ex.: 185
DIM:2(int) size of dim.2ex.: 388
.........
DIM:N(int) size of dim.Nex.: 2

API

Parameters

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

...

versind (int) - consecutive version index assigned/mapped to the version production time stamp.

 


Initialization

Code Block
# Import
from PSCalib.DCStore import DCStore       # inport DCStore (Detector Calibration Store) object 

# Initialization
REPO = '/reg/g/psdm/<PATH>/detector/calib'            # default calib repository

cdir = env.calibDir()                     # '/reg/d/psdm/<PATH>/<INS>/<experiment>/calib' - accept current directory
path = cdir + <dettype>

fname = '[path/]pnccd-12345678'           # standard name includes detector type, dash, and n-digit id number
fname = '[path/]Camera1'                  # alias

cs = DCStore(fname)                       # creates a DCStore object.
""" get calibration store object
    Input parameters:
    fname [str] - file name/alias of the detector 
"""

...

  • logic for default version
    • always last added constants
    • set specified version
    • what to do with default if new version is added?

 


  • when constants are updated (file open to write) they are not available... Lock to resolve.

...

  • table of aliases with records: <alias> <source> <begin> <end>
  • repository
  • <PATH>//reg/g/psdm/detector/calib  "g" or "d"
  • epix100a full name  - 6 numbers of hardware versions, firmware version is a 7th number
  • time double to two integers or int64 (32bit-sec, 32-bit-nsec)
  • geometry needs to be saved as a text
  • repository file has geometry and pixel_gain - like constants
  • do not search in <experiment>/calib
  • access through network for AMI (cpo: TCP with hardwired IP addresses, m:web service/reddis)

References

...