Feature #993

detector calibration

Added by Wilson, Antony about 12 years ago. Updated over 11 years ago.

Wilson, Antony
Python API
Start date:
23 May 2012
Due date:
% Done:


Estimated time:


the detectors wish to store their calibration data as flat files

it is proposed that they provide the following metadata when storing a calibration:
device name
calibration type
valid from date

retrieval of a calibration will be via one of these methods
get_calibration _for _run(device_name, calibration_type, run_number)
get_calibration _for _date(device_name, calibration_type, date_number)
get_current_calibration(device_name, calibration_type)
get_calibration _for _id(id)

get_ids(start_time, stop_time)
Return a list of ids of the calibration data sets that were valid during the given time period.
N.B. if the stop_time is None then only the ids that were valid at the start_time will be returned.
a dictionary containing the calibration ids data set:
key - id
value - dictionary with id specific data
id specific data dictionary:
key - validFrom
a datetime from when the id was valid
key - created
a datetime of when the id was created

Please can Yordan and Durga confirm that this will meet their requirements

Files (972 Bytes) Wilson, Antony, 12 July 2012 13:50 (500 Bytes) Wilson, Antony, 12 July 2012 13:50

Related issues

Related to Configuration Database - Bug #1519: Method to get calibrations by run is brokenClosedMartyniak, Janusz11 July 2014


Updated by Rajaram, Durga about 12 years ago

This is fine for the TOF calibrations and cabling map.

Gene is okay with this for the Ckov calibrations.
The Ckov map is part of files/DAQChannelMap.txt.
Maybe this should also go into the DB if it's not already
there, but I'm not sure under what category.

Is there a method for loading the files?
Or should I send them to you with name,type,valid_from_date?


Updated by Rogers, Chris about 12 years ago

Antony usually implements a web interface for upload and download and then a python binding in the cdb module. We need a download script inside MAUS, and an upload script somewhere (MAUS is convenient so I would do it there if I were you and keep everything together).

Download can be done from anywhere to the cdb download mirror server somewhere in PPD.

Upload is only available from inside micenet to the cdb server in the control room. For geometry, this is done by ssh onto onrec01 during a quiet time and do the upload from the MAUS install there, and I think this is a reasonable model to follow.

To have a look at the cdb module, loaded as a 3rd party library into MAUS, do

>> import cdb
>> help(cdb)

Edit: worth also having a look at the geometry-cdb interface module


Updated by Wilson, Antony about 12 years ago

  • Assignee changed from Rajaram, Durga to Karadzhov, Yordan

Hi Yordan
Please can you confirm that this will meet your requirement


Updated by Karadzhov, Yordan about 12 years ago

Sounds very good to me.


Updated by Wilson, Antony about 12 years ago

  • Assignee changed from Karadzhov, Yordan to Wilson, Antony

Updated by Wilson, Antony almost 12 years ago

My test CDB server has been updated and a new Python API is available at

Documentation can be found at

The attached examples show how to add data and retrieve data to my test server. You should be able to use my test server for limited testing.



Updated by Rajaram, Durga over 11 years ago

  • TOF calibrations are now in the production DB
  • Code to access calibration added, modified, merged
  • ConfigurationDefaults has new parameter to specifiy calib date (default = "current")
  • TOF_calibration_date_from TOF_calib_date_from

Also available in: Atom PDF