Calibration Management Tool is intended to help in population of the calibration database. Most of imaging devices need in intensity corrections such as dark rate subtraction, per-pixel gain factor, masking of bad pixels etc. Some of imaging devices composed of separate sensors (a.k.a. tiles, segments, pixel matrices, etc.) such as CSPAD need in pixel geometry calibration parameters. There are many separate scripts in python, psana framework, etc. which allow to get calibration files for different imaging devices. However, it is not easy to set correct parameters in order to run these scripts. One has to be careful in selection of input experiment name, run number, device name(s), to set correct chain of processing algorithms, and finally define the correct destination path for calibration files. Calibration Management Tool greatly simplify this task. It is designed to integrate access to many separate scripts under single Graphical User Interface (GUI), it takes care about all variables and names, which can be selected from drop down menus, it helps to perform calibration and deploy calibration files in correct final directory with correct names.
Calibration Management Tool main functionality can be listed as follows:
/reg/d/psdm/<instrument>/<experiment>/calib/
with right names associated with a run range.User Interface (UI) of Calibration Management Tool is implemented in Python using standard external packages PyQt4
, matplotlib
, etc. and packages from offline software release (starting from ana-0.10.10):
CalibManager
- most of User Interface (UI) modules and implementation of the launching command calibman
PyCSPadImage -
image processing modules for CSPAD,CSPadPixCoords
-
C++ psana modules for CSPAD data access,
ImgAlgos
- C++ psanamodules for calibration in batch jobs,CorAna -
modules for Mask Editor,
etc.
Main window of the of the Calibration Management Tool is launched by the command calibman
. Its content may be different for the first and next sessions; current session status is preserved in configuration file at exit and restored at start of the next session (if this option is elected in configuration parameters). For example, UI with Calibration Management Tool - Old tool is shown below.
Main window of UI consists of three panels from top to bottom:
This panel contains three selection buttons with preceded labels for
Instrument
,Experiment
, andDetector
, which help to set associated parameters. Each of these buttons must be sequentially clicked and desired value should be selected from drop-down menu. After experiment name is selected, the default calibration directory appears in the next-right information field. This top-level calibration directory will be used as a destination path for deployment of all calibration files. Optional button Browser
launch directory selection dialog window which allows to set different from default destination calibration directory. At first setting the sequence of operations in this panel is guided by the next enabled green button. Already enabled buttons can be re-selected at any time. For tools like Calibration Management Tool - Old or Calibration Management Tool - Old the list of calibrated detectors is selected by the check boxes in the pop-up panel
and the title of the Detector button shows how many detectors are selected. For Calibration Management Tool - Old tool only one detector should be selected.
Parameters of this panel must be set before any other actions with Calibration Manager. |
Log-book panel is located in the bottom of the main window. It is intended as a global information panel in order to minimize a number of specific information fields. Records and messages at variation of status or at clicks on information buttons are posted in this panel. At the end of each session content of this panel is saved under work directory in the log-file with name containing start session time stamp.
Status panel shows up in a few applications such as Dark, File Manager, etc. on the top of application space. In most cases it shows content of the calibration directory for specified list of detectors. For each calibration file its effective run range is shown next right to its name. The effective run range is presented by two numbers, begin run and end run of the range. Run ranges may overlap for different files. If this happens, files from bottom side have higher priority.
Tab-bar allows to switch between different applications. Completely implemented applications under tabs:
Dark run processing tool is intended to produce calibration files for pedestals (for dark level subtraction) from dark runs and deploy them in correct place in calibration directory. In parallel hot pixel masks are produced and can be also deployed.
Dark panel is activated at click on Dark tab. It consists of
Control bar contains
List of run items panel consists of records for each run in "regular" - short or "expert" - extended mode.
Each run item in "regular" mode contains
Expert mode contains more information buttons for each run item
Application panel under ROI (Region Of Interest) tab has a minimal number of control fields, which allow to specify the file with image and open/close Mask Editor UI in separate window.
When launched, Mask Editor works as completely independent application. The Mask Editor allows to draw on image any number of a few geometry figure types and finally generate and save positive or negative mask for loaded image.
File manager tool consists of Calibration Management Tool - Old and control panel:
File manager control panel contains a set of control fields with functionality as follows.
Configuration tool has its own tab bar switching between panels with sets of parameters.
Two panels are implemented currently:
This panel has a few active fields:
work
directory. Selected directory shows up in the next right information field.results
directory. Selected directory shows up in the next right information field. This directory is not currently in use.This panel is intended for manipulation with configuration file, which contains a list of configuration parameters for entire project. The panel has a few active fields:
There is a bunch of confirmation popup windows with modal-style dialog. Appropriate selection need to be done by clicking on possible continuation buttons.
Modal dialog assumes that one of the buttons in this type of dialog window need to be clicked, otherwise UI will be frozen. |
Current status corresponds to:
relinfo Pkg/Rel TEST BASE(ana-0.10.12) CalibManager HEAD V00-00-14 |
Completely implemented applications under tabs:
Partly implemented tab(s):
On 2014-03-01 all currently known problems has been fixed.
addpkg CalibManager HEAD; (V00-00-17) |
If there is no known recent changes in the code of the project, then it may be launched using current release (≥ ana-0.10.10) from any directory :
cd <your-favorite-directory>; sit_setup; calibman; |
The latest version of this application with recent modifications for packages can be created and executed from the local release directory. Login to psana, then run use commands with appropriate substitutions for <...> fields:
cd <your-favorite-test-directory>; newrel ana-current test-CalibManager; cd test-CalibManager; sit_setup; addpkg CalibManager HEAD; addpkg <package2> HEAD; addpkg <package3> HEAD; ... scons; calibman; |
calibman
If terminal session was open long time ago, it is good idea to update credentials prior launching the calibman application:
kinit; aklog; |
No matter what tool tab is opening by default in the first session, it would be better to make sure that configuration parameters are set correctly. To do that click on tab Configuration, which opens Configuration Settings panel, then click on tab Parameters. Most parameters can be used with default values, but it is important to check, that
correct queue will be used for batch jobs. If necessary, change Queue in combo box.
correct range of events is set for event processing.
Threshold on rms is good for calibrated detector(s). Evaluation of this threshold requires in simple analysis which can be done after the 1st iteration on event averaging. Files containing averaged intensities and their rms values can be plotted as image and spectra. Spectrum of rms gives a rough idea of how to set this threshold. When threshold is set, second iteration on event averaging will produce correct mask-file for hot pixels, which rms exceeds the threshold.
World is not perfect. Anything may happen during this long workflow. Expert mode sheds light on most of the problems. Here is a list of most frequent problems;
calibman
application, first execute kinit
and aklog
commands.