Versions Compared

Key

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

...

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.

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 or (part of) calibration directory.
  • Combination of FS & DB files (hdf5 for uniformity).
  • API + GUI for central management.
  • Management can ONLY be done through the API/GUI in order to prevent adding/removing unknown files without history.
  • Time stamp (sec) is THE ONLY value for validity range check.
  • The <detname> is equivalent to <dettype>-<detid> and is THE ONLY choice for the file name. This name is mapped to the custom names in the files with aliases.

...

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

...

  • 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.

*

Base class

 

Code Block
DCBase - base class for this project
====================================
tags        = obj.tags()                  # (dict) dictionary of tags associated with each object
tag         = obj.tag(k)                  # returns tag value for key k

 

 

 

Access methods

Code Block
DCStore methods
===============
tscfile
obj.set_tags(d)      = cs.tscfile()             # set # (intdict) time stampdictionary of thetags filefor creation
dettypeobject
obj.add_tag(k,v)     = cs.dettype()             # add # (strk,v) detectortag type
detidto the dictionary of tags   = cs.detidfor object
obj.del_tags()                 #  (str) detector id
detname# delete all tags from =the cs.detname()dictionary
obj.del_tag(k)                     # (str)delete detectortag namewith key k 


Access methods

Code Block
DCStore methods
===============
tscfile    of self object
predecessor = cs.predecessortscfile()               # (strint) detnametime stamp of predecessorthe orfile Nonecreation
successordettype     = cs.successordettype()               # (str) detnamedetector of successor or None
ctypestype
detid       = cs.ctypesdetid()                 # (liststr) calibration types in the file
ctodetector id
detname     = cs.detname()     = cs.ctypeobj(ctype)         # (DCTypestr) ~ h5py.Group) calibration typedetector name of self object


DCTypepredecessor methods
==============
ctype= cs.predecessor()           =# cto.ctype(str) detname of predecessor or None
successor   = cs.successor()             # (str) detname of ctypesuccessor or nameNone
tsrangesctypes      = ctocs.rangesctypes()                # (list) ofcalibration timetypes rangesin forthe ctypefile
tsrocto         = ctocs.rangeobjctypeobj(tsrangectype)         # (DCRangeDCType ~ h5py.Group) timecalibration stamptype validity range object


DCRangeDCType methods
===============
tsbeginctype       = tsrocto.beginctype()                # (intstr) timeof stamp beginning validity range
tsend   ctype name
tsranges    = tsrocto.endranges()                 # (intlist) of time stamp ending validity range
versionsranges for ctype
tsro        = tsrocto.versionsrangeobj(tsrange)      # (DCRange ~ h5py.Group) time stamp #validity (list of uint) versions of calibrations
versodefrange object


DCRange methods
===============
tsbegin     = tsro.versdefbegin()               # (DCVersion ~ h5py.Groupint) referencetime tostamp thebeginning default version in the time-range object
versovalidity range
tsend       = tsro.versobjend(vers)         # (DCVersion ~ h5py.Group) specified version   in# the(int) time-range object


DCVersion methods
=================
tsvers   stamp ending validity range
versions    = versotsro.tsprodversions()             # (intlist of uint) time stampversions of the version production
calibdatacalibrations
versodef    = versotsro.calibversdef()              # (np.arrayDCVersion ~ h5py.Group) calibration array

Management methods

Code Block
DCBase - base class for this project
====================================
obj.set_tags(d)reference to the default version in the time-range object
verso       = tsro.versobj(vers)            # set (dict)DCVersion dictionary of tags for object
obj.add_tag(k,v)                   # add (k,v) tag to the dictionary of tags for object
obj.del_tags~ h5py.Group) specified version in the time-range object


DCVersion methods
=================
tsvers      = verso.tsprod()             # (int) time stamp of the version  #production
calibdata delete all tags from the dictionary
obj.del_tag(k)     = verso.calib()                # (np.array) calibration array


Management methods

Code Block
delete tag with key k


DCStore methods
===============
cs.set_tscfile(ts)                 # set (int) time stamp of the file creation  
cs.set_dettype(dettype)            # set (str) detector type
cs.set_detid(detid)                # set (str) detector id
cs.set_detname(detname)            # set (str) detector name of self object
cs.set_predecessor(pred)           # set (str) detname of predecessor or None
cs.set_successor(succ)             # set (str) detname of successor or None
cs.add_ctype(ctype)                # add (str) calibration type to the DCStore object
cs.del_ctype(ctype)                # delete ctype (str) from the DCStore object


DCType methods
==============
cto.add_range(tsr)                 # add (str) of time ranges for ctype
cto.del_range(tsr)                 # delete range from the DCType object


DCRange methods
===============
tsro.set_begin(tsbegin)            # set (int) time stamp beginning validity range
tsro.set_end(tsend)                # set (int) time stamp ending validity range
tsro.add_version(vers)             # set (DCVersion ~ h5py.Group) versions of calibrations
tsro.set_versdef(vers)             # set (DCVersion ~ h5py.Group) versions of calibrations
tsro.del_version(vers)             # delete version


DCVersion methods
=================
verso.set_tsprod(tsprod)           # set (int) time stamp of the version production
verso.add_calib(nda)               # set (np.array) calibration array

...