Versions Compared

Key

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

...

Code Block
/                                                                   # top-root-level contains info for the unique detector version
 dettype (str)                                                      # detector type name, ex: cspad, pnccd, etc
 detid (str)                                                        # unique detector id, ex: 01234
 tscfile (uint)                                                     # time stamp of creation of this structure
 predecessor (str)                                                  # name of the previous detector if available or None
 successor (str)                                                    # name of the next detector if available or None
 tags (dict)                                                        # dictionary of tags associated with this version of detector
 <ctype>/                                                           # folder for calibration type
          ctype (str)                                               # calibration type name
          tags (dict)                                               # dictionary of tags associated with calibration type
          <tstamp-range>/                                           # folder for time stamp validity range
          <tstamp>[-<tstamp-end>]/                                  # folder for validity range. If <tstamp-end> is not specified - then valid to the end
                                  tsbegin (uint)                    # time stamp for the beginning of the validity range
                                  tsend (uint)                      # time stamp for the end of the validity range
                                  defaultv                          # reference to the default calibration, ex:  <vers-tstamp2>
                                  tags (dict)                       # dictionary of tags associated with validity range
                                  <vers-tstamp1>/                   # folder for version created on tstamp1
                                                 tsvers (uint)      # tstamp1 of this version production 
                                                 calib (ndarray)    # calibration data
                                                 tagshistory (str)      # production history record
                                                 tags (dict)        # dictionary of tags, 
                                                                    #   ex: array size, number of dimensions, shape, data type, experiment, run, comments, author
                                  <vers-tstamp2>/                   # folder for version created on tstamp2
                                                 tsvers (uint)
                                                 calib (ndarray)
                                                 calib history (ndarraystr)
                                                 tags (dict)
           <tstamp2>[-<tstamp2-end>]/                               # folder for the next validity range.
 pedestals/                                                         # folder for the next calibration type, pedestals
 rms/                                                               # folder for the next calibration type, rms

...

Code Block
DCStore methods
===============
tscfile     = cs.tscfile()               # (int) time stamp of the file creation
dettype     = cs.dettype()               # (str) detector type
detid       = cs.detid()                 # (str) detector id
detname     = cs.detname()               # (str) detector name of self object
predecessor = cs.predecessor()           # (str) detname of predecessor or None
successor   = cs.successor()             # (str) detname of successor or None
ctypes      = cs.ctypes()                # (list) calibration types in the file
cto         = cs.ctypeobj(ctype)         # (DCType ~ h5py.Group) calibration type object
_________________________________________
nda         = cs.get(ctype, tsp, vers)   # (str) ctype - calibration type
                                         # (...) tsp - parameter to get time stamp (evt, runnum, ts_sec) 
_________________________________________# (int) vers - version of calibration, None - use default 


DCType methods
==============
ctype       = cto.ctype()                # (str) of ctype name
tsranges    = cto.ranges()               # (list) of time ranges for ctype
tsro        = cto.rangeobj(tsrange)      # (DCRange ~ h5py.Group) time stamp validity range object


DCRange methods
===============
tsbegin     = tsro.begin()               # (int) time stamp beginning validity range
tsend       = tsro.end()                 # (int) time stamp ending validity range
versions    = tsro.versions()            # (list of uint) versions of calibrations
versodef    = tsro.versdef()             # (DCVersion ~ h5py.Group) reference to the default version in the time-range object
verso       = tsro.versobj(vers)         # (DCVersion ~ h5py.Group) specified version in the time-range object


DCVersion methods
=================
tsvers      = verso.tsprod()             # (int) time stamp of the version production
calibdata   = verso.calib()              # (np.array) calibration array
rec         = verso.history()            # (str) production history record 

Management methods

Code Block
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
cs.save(path)                      # save current calibration in the file specified by path, if path is Null - update current file.


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
verso.history(rec)                 # (str) set production history record 

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.

...