Skip to content

[LPD] Add parallel gain support to CalibrationData v2

Philipp Schmidt requested to merge feat/lpd-parallel-gain-cond into master

Description

In preparation to potentially correct parallel gain data, this adds support for the new parallel gain parameter to the CalibrationData API v2. Naturally this should also end up in extra.calibration in case users want to take up correction themselves.

As I was writing the legacy code to only inject this new parameter in case it is enabled, I also added a small change coercing data already to CalCat's types (i.e. float or str) in ConditionsBase.make_dict(). This change is debatable, but for now seems prudent. I would definitely prefer to offer natural types on the Python side (as done here with parallel_gain: bool), but this code is already written with database names in mind and hence seemed to make sense to operate on database types.

Furthermore, initially I only wanted to change some of the default values to those actually occuring more often (category = 0 and source_energy = 9.3, not 9.2!). As I was checking the database and history of those values, I continued the process for the others and realized that essentially all of them are constant (bias_voltage and memory_cells). Hence I put those defaults in there, so you can query constants now with LPDConditions().

How Has This Been Tested?

caldata = CalibrationData.from_condition(
    LPDConditions(parallel_gain=True),
    'FXE_DET_LPD1M-1',
    event_at=datetime.now())
caldata.display_markdown_table()

Types of changes

  • New feature (non-breaking change which adds functionality)

Reviewers

@ahmedk @kluyvert

Merge request reports