def test_TauParam_string(self):
        d1 = dataclasses.TauParam()
        d1.p0 = 0.5772
        d1.p1 = 1.645
        d1.p2 = 1.202
        d1.p3 = 1.0823
        d1.p4 = 2.612
        d1.p5 = -1.4604
        d1.tau_frac = -0.5
        d2 = dataclasses.TauParam()
        d2.p0 = 0.5772
        d2.p1 = 1.645
        d2.p2 = 1.202
        d2.p3 = 1.0823
        d2.p4 = 2.612
        d2.p5 = -1.4604
        d2.tau_frac = -0.5

        self.assertEqual(d1.__str__(), d2.__str__(),
                         "these should be the same.")
 def test_TauParam_equality_default_ctor(self):
     o1 = dataclasses.TauParam()
     o2 = dataclasses.TauParam()
     self.assertEqual(o1, o2, "these should be the same.")
예제 #3
0
dom_cal = i3Calibration.dom_cal
dom_status = i3DetectorStatus.dom_status
trigger_status = i3DetectorStatus.trigger_status

allI3DOMCalibrations = dom_cal.values()
allI3DOMStatuses = dom_status.values()

# setting dom calibration (if no known input value average from data).
# some fields had doms that had nan values. Those values were ignored.
# one of the doms was used instead of creating a new one because some
# attributes were immutable and would have stayed nan if they were
# intializaed in a new object
newDOMCalib = allI3DOMCalibrations[1000]

tauparam = dataclasses.TauParam()
tauparam.p0 = sum([
    domcal.tau_parameters.p0
    for domcal in allI3DOMCalibrations if not is_nan(domcal.tau_parameters.p0)
]) / len(allI3DOMCalibrations)
tauparam.p1 = sum([
    domcal.tau_parameters.p1
    for domcal in allI3DOMCalibrations if not is_nan(domcal.tau_parameters.p1)
]) / len(allI3DOMCalibrations)
tauparam.p2 = sum([
    domcal.tau_parameters.p2
    for domcal in allI3DOMCalibrations if not is_nan(domcal.tau_parameters.p2)
]) / len(allI3DOMCalibrations)
tauparam.p3 = sum([
    domcal.tau_parameters.p3
    for domcal in allI3DOMCalibrations if not is_nan(domcal.tau_parameters.p3)