Versions Compared

Key

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

...

Code Block
ctype = pedestals # status, rms, mask, gain, bkgd, common_mode, geometry, etc
tsp = tstamp parameter to identify constants, which can be retrieved from evt.run() - run number, evt
vers = None # for default or versind or version time stamp.

# generic access method:
obj = cs.get(ctype, tsp, vers)

Base class DCBase

Is reserved to support common methods of all project classes. For now it stands for manipulations with tags but not limited to.

Code Block
DCBase - base class for this project
====================================
tags = obj.tags()                  # returns (dict) dictionary of tags associated with each object
tag  = obj.tag(k)                  # returns tag value for key k
log  = obj.history(fmt)            # returns (str) history records preceded by the time stamp (default fmt='%Y-%m-%dT%H:%M:%S%Z') as a text 
d    = obj.histdict()              # returns (dict) history dictionary associated with current object

obj.set_tags(d)                    # set (dict) dictionary of tags for object
obj.add_tag(k,v)                   # add (k,v) tag to the dictionary of tags for object
obj.del_tags()                     # delete all tags from the dictionary
obj.del_tag(k)                     # delete tag with key k
obj.set_history(d)                 # set (dict) as a history dictionary of the current object
obj.add_history(rec, ts)           # add (str) record with (float) time stamp to the history dictionary (ts:rec). If ts is None - call current time is used as a key. 

...

Class DCStore

Code Block
DCStore acess 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 


DCTypeDCStore management methods
==========================
ctype       = cto.ctype()cs.set_tscfile(ts)                 # set (strint) oftime ctypestamp name
tsrangesof the file creation = cto.ranges(
cs.set_dettype(dettype)            # set (str) # (listdetector type
cs.set_detid(detid) of time ranges for ctype
tsro        = cto.rangeobj(tsrange)  # set (str)  # (DCRange ~ h5py.Group) time stamp validity range object


DCRange methods
===============
tsbegindetector id
cs.set_detname(detname)            # =set tsro.begin(str) detector name of self object
cs.set_predecessor(pred)           # set (intstr) timedetname stampof beginningpredecessor validityor range
tsend       = tsro.end(None
cs.set_successor(succ)             #    #set (intstr) timedetname stampof endingsuccessor validityor range
versionsNone
cs.add_ctype(ctype)    = tsro.versions()           # #add (list of floatstr) versionscalibration oftype calibrations
versodefto the   = tsro.versdef()DCStore object
cs.del_ctype(ctype)              # (DCVersion ~ h5py.Group# delete ctype (str) referencefrom tothe the default version in the time-range object
versoDCStore object
cs.save(path)            = tsro.versobj(vers)         # (DCVersion ~ h5py.Group) specified version in the time-range object


DCVersion methods
==save current calibration in the file specified by path, if path is Null - update current file.

Class DCType

Code Block
DCType acess methods
====================
tsversctype      = versocto.tsprodctype()           # (str) of ctype name
tsranges   #= cto.ranges(int) time  stamp of the version production
calibdata   =# verso.calib(list) of time ranges for ctype
tsro       = cto.rangeobj(tsrange) # (np.array) calibration array

Management methods

Code Block
DCStoreDCRange ~ h5py.Group) time stamp validity range object

DCType management 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==========
cto.add_range(tsr)                 # setadd (str) detectorof nametime ofranges selffor objectctype
cscto.setdel_predecessorrange(pred)tsr)                 # delete setrange (str)from detnamethe of predecessor or None
cs.set_successor(succ)    DCType object

Class DCRange

Code Block
DCRange acess methods
=====================
tsbegin     = tsro.begin()         # set (strint) detnametime ofstamp successorbeginning orvalidity None
cs.add_ctype(ctype)range
tsend       = tsro.end()           # add (strint) calibrationtime typestamp toending thevalidity DCStore object
cs.del_ctype(ctype)range
versions    = tsro.versions()      # (list of float) versions # delete ctype (str) from the DCStore object
cs.save(pathof calibrations
versodef    = tsro.versdef()       # (DCVersion ~ h5py.Group) reference to the default version in the time-range object
verso   # save current calibration in the file specified by path, if path is Null - update current file.


DCType methods
= tsro.versobj(vers)   # (DCVersion ~ h5py.Group) specified version in the time-range object

DCRange management methods
==========================
ctotsro.addset_rangebegin(tsrtsbegin)                 # addset (strint) oftime timestamp rangesbeginning forvalidity ctyperange
ctotsro.delset_rangeend(tsrtsend)                 # deleteset range(int) fromtime thestamp DCType object


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

Class DCVersion

Code Block
DCVersion  # set (DCVersion ~ h5py.Group) versions of calibrations
tsro.set_versdef(versacess methods
=======================
tsvers      = verso.tsprod()       # (int) time stamp of the #version setproduction
calibdata (DCVersion ~ h5py.Group) versions of calibrations
tsro.del_version(vers= verso.calib()        # (np.array)    # delete versioncalibration array


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

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.

...