Source code for iCalibrationDB.operating_condition

from .util import DictConvertable


[docs]class OperatingCondition(DictConvertable): """ A class describing a detector operating condition parameter. It is mandatory to give a `name` and `value`. Optionally, acceptable upper and lower deviations, and whether these are to be evaluated logarithmically can be specified. """ mandatory = ["flg_available", "flg_logarithmic", "parameter_name", "value"] def __init__(self): super(OperatingCondition, self).__init__() self._datadict["flg_available"] = True self._datadict["flg_logarithmic"] = False @property def name(self): """ The property described by this condition. May contain spaces """ return self._datadict.get("parameter_name") @name.setter def name(self, value): self._datadict["parameter_name"] = str(value) @name.deleter def name(self): del self._datadict["parameter_name"] @property def value(self): """ Value of the variable. Needs to be convertable to `float`. """ return self._datadict.get("value", None) @value.setter def value(self, value): self._datadict["value"] = float(value) @value.deleter def value(self): del self._datadict["value"] @property def logarithmic(self): """ If set to `True`, deviations are evaluated as decades of a logarithm """ return self._datadict.get("flg_logarithmic", None) @logarithmic.setter def logarithmic(self, value): self._datadict["flg_logarithmic"] = bool(value) @logarithmic.deleter def logarithmic(self): del self._datadict["flg_logarithmic"] @property def lower_deviation(self): """ Absolute deviation to lower values that is acceptable """ return self._datadict.get("lower_deviation_value", None) @lower_deviation.setter def lower_deviation(self, value): self._datadict["lower_deviation_value"] = float(value) @lower_deviation.deleter def lower_deviation(self): del self._datadict["lower_deviation_value"] @property def upper_deviation(self): """ Absolute deviation to lower higher that is acceptable """ return self._datadict.get("upper_deviation_value", None) @upper_deviation.setter def upper_deviation(self, value): self._datadict["upper_deviation_value"] = float(value) @upper_deviation.deleter def upper_deviation(self): del self._datadict["upper_deviation_value"] @property def available(self): """ Internal parameter, should be kept at its default (True). """ return self._datadict.get("flg_available", None) @available.setter def available(self, value): self._datadict["flg_available"] = bool(value) @available.deleter def available(self): del self._datadict["flg_available"] @property def description(self): """ A description of the property """ return self._datadict.get("description", None) @description.setter def description(self, value): self._datadict["description"] = str(value) @description.deleter def description(self): del self._datadict["description"]