Versions Compared

Key

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

...

deploy_constants -e xpptut15 -r 260 -d XcsEndstation.0:Epix100a.1 -C gain -D -c calib

methods to populate repository

Since ana-4.0.45 a couple of methods are introduced to populate repository with constants, as shown in examples.

Code Block
titleExample for method file_name_in_repo
collapsetrue
from Detector.UtilsDeployConstants import file_name_in_repo
exp = 'xpptut15'
run = 260
det = 'XcsEndstation.0:Epix100a.1'
ctype = 'gain'
#tstamp = None
#rundepl = None
tstamp = '20220901120000'  # or None
undepl = '123'  # or None
print('File name in repository: %s' %\
          file_name_in_repo(exp, run, det, ctype, tstamp=tstamp, rundepl=rundepl)
    )
Code Block
titleExample for method save_epix100a_ctype_in_repo
collapsetrue
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(format='[%(levelname).1s]: %(message)s', level=logging.DEBUG) #INFO)

from Detector.UtilsDeployConstants import save_epix100a_ctype_in_repo
import numpy as np

arr2d = 0.061*np.ones((704,768))
exp = 'xpptut15'
run = 260
det = 'XcsEndstation.0:Epix100a.1'
ctype = 'gain'
tstamp = '20220901120000' # or None
rundepl = '123' # or None
save_epix100a_ctype_in_repo(arr2d, exp, run, det, ctype, tstamp=tstamp, rundepl=rundepl, fmt='%.4f')

Functionality

Command with correct list of parameters (-e xpptut15 -r 260 -d XcsEndstation.0:Epix100a.1 -C gain) tries to access if available or create the repository directory tree. If specific file for the run or specified (-t TSTAMP, --tstamp TSTAMP) time stamp is available it will be deployed under standard or specified (-c DIRCALIB, --dircalib DIRCALIB) calib directory. If calibration file is not found - nothing is deployed and appropriate warning is generated in the log file. Created directory tree for new detector can be used to add new default or time-stamp-dependent calibration files.

...