def test_QuadraticFit_string(self):
        fit1 = dataclasses.QuadraticFit()
        fit1.quad_fit_a = 1.618
        fit1.quad_fit_b = 1.645
        fit1.quad_fit_c = 1.20205
        fit2 = dataclasses.QuadraticFit()
        fit2.quad_fit_a = 1.618
        fit2.quad_fit_b = 1.645
        fit2.quad_fit_c = 1.20205

        self.assertEqual(fit1.__str__(), fit2.__str__(),
                         "these should be the same.")
Ejemplo n.º 2
0
    def test_QuadraticFit_equality(self):
        fit1 = dataclasses.QuadraticFit()
        fit1.quad_fit_a = 1.618
        fit1.quad_fit_b = 1.645
        fit1.quad_fit_c = 1.20205

        fit2 = dataclasses.QuadraticFit()
        fit2.quad_fit_a = 1.618
        fit2.quad_fit_b = 1.645
        fit2.quad_fit_c = 1.20205
        
        self.assertEqual(fit1, fit2, "these should be the same.")
 def test_QuadraticFit_equality_default_ctor(self):
     o1 = dataclasses.QuadraticFit()
     o2 = dataclasses.QuadraticFit()
     self.assertEqual(o1, o2, "these should be the same.")
Ejemplo n.º 4
0
    if not is_nan(domcal.combined_spe_charge_distribution.gaus_mean)
]) / len(allI3DOMCalibrations)
combinedSPEChargeDistribution.gaus_width = sum([
    domcal.combined_spe_charge_distribution.gaus_width
    for domcal in allI3DOMCalibrations
    if not is_nan(domcal.combined_spe_charge_distribution.gaus_width)
]) / len(allI3DOMCalibrations)
combinedSPEChargeDistribution.compensation_factor = 1  # no data for spe distribution for these DOMs so use 1 for now
combinedSPEChargeDistribution.slc_gaus_mean = sum([
    domcal.combined_spe_charge_distribution.slc_gaus_mean
    for domcal in allI3DOMCalibrations
    if not is_nan(domcal.combined_spe_charge_distribution.slc_gaus_mean)
]) / len(allI3DOMCalibrations)
newDOMCalib.combined_spe_charge_distribution = combinedSPEChargeDistribution

freqQuadFit1 = dataclasses.QuadraticFit()
freqQuadFit2 = dataclasses.QuadraticFit()
dataFreqQuadFit1 = [domcal.atwd_freq_fit[0] for domcal in allI3DOMCalibrations]
dataFreqQuadFit2 = [domcal.atwd_freq_fit[1] for domcal in allI3DOMCalibrations]
freqQuadFit1.quad_fit_a = sum([
    item.quad_fit_a for item in dataFreqQuadFit1 if not is_nan(item.quad_fit_a)
]) / len(dataFreqQuadFit1)
freqQuadFit1.quad_fit_b = sum([
    item.quad_fit_b for item in dataFreqQuadFit1 if not is_nan(item.quad_fit_b)
]) / len(dataFreqQuadFit1)
freqQuadFit1.quad_fit_c = sum([
    item.quad_fit_c for item in dataFreqQuadFit1 if not is_nan(item.quad_fit_c)
]) / len(dataFreqQuadFit1)
freqQuadFit2.quad_fit_a = sum([
    item.quad_fit_a for item in dataFreqQuadFit2 if not is_nan(item.quad_fit_a)
]) / len(dataFreqQuadFit2)