Page History
...
Code Block |
---|
// Assume that file is located in /reg/d/psdm/AMO/amotut13/calib/PNCCD::CalibV1/Camp.0:pnCCD.1/pedestals/1-end.data const std::string calibDir = "/reg/d/psdm/AMO/amotut13/calib"; const std::string groupName = "PNCCD::CalibV1"; const std::string source = "Camp.0:pnCCD.1"; unsigned long runNumber = 10; unsigned print_bits = 255; PSCalib::PnccdCalibPars *calibpars = new PSCalib::PnccdCalibPars(calibDir, groupName, source, runNumber, print_bits); calibpars->printCalibPars(); calibpars->printCalibParsStatus(); calibpars->printInputPars(); ndarray<pdscalibdata::PnccdPedestalsV1::pars_t, 3> peds = calibpars -> pedestals(); ndarray<pdscalibdata::PnccdCommonModeV1::pars_t, 1> cmod = calibpars -> common_mode(); ndarray<pdscalibdata::PnccdPixelStatusV1::pars_t, 3> stat = calibpars -> pixel_status(); ndarray<pdscalibdata::PnccdPixelGainV1::pars_t, 3> gain = calibpars -> pixel_gain(); |
...
Pros
- Simple format for calibration files - just a text file with pre-defined number of values for each type:
Code Block |
---|
973.941639 881.189675 1050.211 773.263749 899.241302 981.805836 1150.72615 993.084175 1121.15488 1029.76319 1220.14927 903.278339 1097.49944 1066.94949 1263.71044 1053.53872 1194.35915 935.320988 1317 ... |
...
Cons
- Too simple calibration file format, does not allow any metadata or comments.
- Detector-dependent objects and parameters "knows" about parameters' array type and shape:
- PSCalib::PnccdCalibPars which depends on PnccdPedestalsV1, PnccdCommonModeV1, ..., PnccdBaseV1
pdscalibdata::PnccdPedestalsV1::pars_t = float
pdscalibdata::PnccdCommonModeV1::pars_t = uint16_t
pdscalibdata::PnccdPixelStatusV1::pars_t = uint16_t
pdscalibdata::PnccdPixelGainV1::pars_t = float
- const std::string groupName = "PNCCD::CalibV1"; - do we really need it ?
How to improve interface for "new-style" calibration
We Other words, we need to define calibration array shape, type of parameters, and where to find it them under calib directory: groupName="PNCCD::CalibV1", source="Camp.0:pnCCD.1";
...
- Use universal calibration object (for all detectors!):
PSCalib::CalibPars *calibpars = new PSCalib::CalibPars(calibDir, source, runNumber, print_bits);
wheresource d
efines the detector type, - Use universal (for all detectors!) modules for each calibration type:
pdscalibdata/include/DetPedestalsV1.h - loads pedestals from file, returns ndarray of pedestals
pdscalibdata/include/DetCommonModeV1.h - the same for common mode
pdscalibdata/include/DetPixelGainV1.h - the same for pixel gain
pdscalibdata/include/DetPixelStatusV1.h - the same for pixel status - Use universally (for all detectors!) pre-defined types of parameters :
pdscalibdata::DetPedestalsV1::pars_t = float
pdscalibdata::DetCommonModeV1::pars_t = uint16_t
pdscalibdata::DetPixelStatusV1::pars_t = uint16_t
pdscalibdata::DetPixelGainV1::pars_t = float
- Define the groupName="PNCCD::CalibV1" from dictionary for source="Camp.0:pnCCD.1" - this means that we will never change the groupName !
Save/retrieve ndarray type/shape from file header, for example:
Code Block # RULES: # Lines starting with # in the beginning of the file are considered as comments or pseudo-comments for metadata # Lines without # with space-separated values are used for input of parameters # Empty lines are ignored # Optional fields: # TITLE: This is a file with pedestals # DATE_TIME: 2014-01-30 10:21:23 # AUTHOR: someone # EXPERIMENT: amotut13 # DETECTOR: Camp.0:pnCCD.1 # CALIB_TYPE: pedestals # Mandatory fields to define the ndarray<TYPE,NDIMS> and its shape as unsigned shape[NDIMS] = {DIM1,DIM2,DIM3} # TYPE: float # NDIMS: 3 # DIM1: 4 # DIM2: 255 # DIM3: 255 973.941639 881.189675 1050.211 773.263749 899.241302 981.805836 1150.72615 993.084175 1121.15488 1029.76319 1220.14927 903.278339 1097.49944 1066.94949 1263.71044 1053.53872 1194.35915 935.320988 1317 ...
...
Overview
Content Tools