This note shows how to work with private calibration constants.

Intro

In LCLS-II calibration constants resides in the data bases. Access to the DB can be done through python API, CLI, and GUI. At regular deployment calibration constants goes in two databases designated  for experiment and for detector. In regular request for calibration constants experimental DB is addressed first, then if constants not found, the detector DB is included in search. These features are sufficient for regular operations with detectors. For test purpose it is important to work with "private" constants which would not disturb any regular data processing. 

Regular DB

Calibration constant on MongoDB server are grouped in databases identified by their names

  • cdb_<experiment-name>
  • cdb_<detector-name>

for example

  • cdb_rixx45619
  • cdb_epixhr2x2_000001

Private DB

Private DB is organized the same way as detector DB, but its name is extended with custom "dbsuffix".

  • cdb_<detector-name>_<dbsuffix>

for example

  • cdb_epixhr2x2_000001_mytestdb

To deploy and access calibration constants one has to specify this optional parameter --dbsuffix.

Add constants to the private DB

Constants can be deployed with regular deployment commands appended with additional parameter --dbsuffix <unique-string-name>

  • cdb add ... --dbsuffix <unique-string-name> ...
  • epix10ka_deploy_constants ... --dbsuffix <unique-string-name>...

for example

  • cdb add -e rixx45619 -d epixhr2x2_000001 -t 2021-10-01T00:00:00-0800 -c pedestals -f mypeds --dbsuffix  mytestdb
  • cdb add -e rixx45619 -d epixhr2x2_000001 -t 2021-10-01T00:00:00-0800 -c geometry -f mygeo -i txt --dbsuffix  mytestdb
  • epix10ka_deploy_constants -e rixx45619 -d epixhr -r121 --dbsuffix mytestdb -D

Use private constants

Example script to use private DB

ds = DataSource(exp='rixx45619', run=121, dbsuffix='mytestdb')
det = run.Detector('epixhr')
arr = det.raw.calib(evt)
img = det.raw.image(evt)

References

  • No labels