コード例 #1
0
    def test_LinearFit_string(self):
        fit1 = dataclasses.LinearFit()
        fit1.slope = 1.618
        fit1.intercept = 1.20205
        fit2 = dataclasses.LinearFit()
        fit2.slope = 1.618
        fit2.intercept = 1.20205

        self.assertEqual(fit1.__str__(), fit2.__str__(),
                         "these should be the same.")
コード例 #2
0
    def test_LinearFit_equality(self):
        fit1 = dataclasses.LinearFit()
        fit1.slope = 1.618
        fit1.intercept = 1.20205

        fit2 = dataclasses.LinearFit()
        fit2.slope = 1.618
        fit2.intercept = 1.20205
        
        self.assertEqual(fit1, fit2, "these should be the same.")
コード例 #3
0
    def test_MeanSPECharge_equality(self):
        fit1 = dataclasses.LinearFit()
        fit2 = dataclasses.LinearFit()
        ds1 = dataclasses.I3DOMStatus()
        dc1 = dataclasses.I3DOMCalibration()
        ds2 = dataclasses.I3DOMStatus()
        dc2 = dataclasses.I3DOMCalibration()

        fit1.slope = 1.618
        fit2.slope = 1.618
        fit1.intercept = 1.20205
        fit2.intercept = 1.20205
        ds1.dac_fadc_ref = 0.1234
        ds2.dac_fadc_ref = 0.1234

        dc1.fadc_baseline_fit = fit1
        dc2.fadc_baseline_fit = fit2

        mspe1 = dataclasses.mean_spe_charge(ds1, dc1)
        mspe2 = dataclasses.mean_spe_charge(ds2, dc2)

        self.assertEqual(mspe1, mspe2, "these should be the same.")
コード例 #4
0
    def test_FADCBaseline_equality(self):
        fit1 = dataclasses.LinearFit()
        fit2 = dataclasses.LinearFit()
        ds1 = dataclasses.I3DOMStatus()
        dc1 = dataclasses.I3DOMCalibration()
        ds2 = dataclasses.I3DOMStatus()
        dc2 = dataclasses.I3DOMCalibration()

        fit1.slope = 1.618
        fit2.slope = 1.618
        fit1.intercept = 1.20205
        fit2.intercept = 1.20205
        ds1.dac_fadc_ref = 0.1234
        ds2.dac_fadc_ref = 0.1234

        dc1.fadc_baseline_fit = fit1
        dc2.fadc_baseline_fit = fit2

        fadcb1 = dataclasses.fadc_baseline(ds1, dc1)
        fadcb2 = dataclasses.fadc_baseline(ds2, dc2)

        self.assertEqual(fadcb1, fadcb2, "these should be the same.")
コード例 #5
0
def remove_spe_fits(frame):
    """
    Replaces the I3Calibration frame. Removes the SPE fits from the calibration data
    since it is included in the gcdserver.
    """

    cal = deepcopy(frame['I3Calibration'])
    del frame['I3Calibration']

    for omkey, i3domcal in cal.dom_cal.items():
        i3domcal.combined_spe_charge_distribution = dataclasses.SPEChargeDistribution(
        )
        i3domcal.mean_fadc_charge = float('nan')
        i3domcal.mean_atwd_charge = float('nan')
        i3domcal.spe_disc_calib = dataclasses.LinearFit()

        cal.dom_cal[omkey] = i3domcal

    frame['I3Calibration'] = cal
コード例 #6
0
ファイル: correct_GCD.py プロジェクト: wardVD/IceSimV05
    if omkey not in badOMs \
           and omkey in dom_cal \
           and omkey in dom_status:

        domcal = dom_cal[omkey]
        domstat = dom_status[omkey]

        threshold = dataclasses.spe_pmt_threshold(domstat, domcal)
        threshold /= I3Units.mV

        if threshold < 0:
            logfile.write('Pathological PMT discriminator threshold')
            logfile.write('  %s  threshold = %2.2f mV' %
                          (str(omkey), threshold))
            fit = dataclasses.LinearFit()
            fit.slope = NaN
            fit.intercept = NaN
            calibration.dom_cal[omkey].PMTDiscCalib = fit

            dc = calibration.dom_cal[omkey]
            thresh = dataclasses.spe_pmt_threshold(domstat, dc)
            logfile.write('  correcting to %2.2f mV' % thresh / I3Units.mV)

        if omgeo.omtype == dataclasses.I3OMGeo.IceCube:
            if omkey not in badOMs and isnan(domcal.dom_noise_rate):
                logfile.write("ERROR : no valid noise rate for this DOM %s " %
                              str(omkey))
                logfile.write("  NOT CORRECTING")

            if isnan(domcal.relative_dom_eff):
コード例 #7
0
 def test_LinearFit_equality_default_ctor(self):
     o1 = dataclasses.LinearFit()
     o2 = dataclasses.LinearFit()
     self.assertEqual(o1, o2, "these should be the same.")
コード例 #8
0
    domcal.tau_parameters.p5
    for domcal in allI3DOMCalibrations if not is_nan(domcal.tau_parameters.p5)
]) / len(allI3DOMCalibrations)
tauparam.tau_frac = sum([
    domcal.tau_parameters.tau_frac for domcal in allI3DOMCalibrations
    if not is_nan(domcal.tau_parameters.tau_frac)
]) / len(allI3DOMCalibrations)
newDOMCalib.tau_parameters = tauparam

newDOMCalib.temperature = 275 * I3Units.kelvin  # cascadia basin temperature was 2 degrees celsius
newDOMCalib.fadc_gain = sum([
    domcal.fadc_gain
    for domcal in allI3DOMCalibrations if not is_nan(domcal.fadc_gain)
]) / len(allI3DOMCalibrations)

fadcBaselineFit = dataclasses.LinearFit()
fadcBaselineFit.intercept = sum([
    domcal.fadc_baseline_fit.intercept for domcal in allI3DOMCalibrations
    if not is_nan(domcal.fadc_baseline_fit.intercept)
]) / len(allI3DOMCalibrations)
fadcBaselineFit.slope = sum([
    domcal.fadc_baseline_fit.slope for domcal in allI3DOMCalibrations
    if not is_nan(domcal.fadc_baseline_fit.slope)
]) / len(allI3DOMCalibrations)
newDOMCalib.fadc_baseline_fit = fadcBaselineFit

newDOMCalib.fadc_beacon_baseline = sum([
    domcal.fadc_beacon_baseline for domcal in allI3DOMCalibrations
    if not is_nan(domcal.fadc_beacon_baseline)
]) / len(allI3DOMCalibrations)
newDOMCalib.fadc_delta_t = sum([