Esempio n. 1
0
def test_nb_peak_integration(example_event):
    telid = list(example_event.r0.tel)[0]
    data = example_event.r0.tel[telid].waveform
    nsamples = data.shape[2]
    ped = example_event.mc.tel[telid].pedestal
    data_ped = data - np.atleast_3d(ped / nsamples)
    data_ped = np.array([data_ped[0], data_ped[0]])  # Test LG functionality
    geom = example_event.inst.subarray.tel[telid].camera
    nei = geom.neighbor_matrix_where

    integrator = NeighbourPeakIntegrator()
    integrator.neighbours = nei
    integration, peakpos, window = integrator.extract_charge(data_ped)
Esempio n. 2
0
def test_nb_peak_integration():
    telid = 11
    event = get_test_event()
    data = event.r0.tel[telid].adc_samples
    nsamples = data.shape[2]
    ped = event.mc.tel[telid].pedestal
    data_ped = data - np.atleast_3d(ped/nsamples)
    data_ped = np.array([data_ped[0], data_ped[0]])  # Test LG functionality
    geom = event.inst.subarray.tel[telid].camera
    nei = geom.neighbor_matrix_where

    integrator = NeighbourPeakIntegrator(None, None)
    integrator.neighbours = nei
    integration, peakpos, window = integrator.extract_charge(data_ped)

    assert_almost_equal(integration[0][0], -64, 0)
    assert_almost_equal(integration[1][0], -64, 0)
    assert peakpos[0][0] == 20
    assert peakpos[1][0] == 20
def test_nb_peak_integration(test_event):
    telid = 11
    event = deepcopy(test_event)
    data = event.r0.tel[telid].waveform
    nsamples = data.shape[2]
    ped = event.mc.tel[telid].pedestal
    data_ped = data - np.atleast_3d(ped / nsamples)
    data_ped = np.array([data_ped[0], data_ped[0]])  # Test LG functionality
    geom = event.inst.subarray.tel[telid].camera
    nei = geom.neighbor_matrix_where

    integrator = NeighbourPeakIntegrator()
    integrator.neighbours = nei
    integration, peakpos, window = integrator.extract_charge(data_ped)

    assert_almost_equal(integration[0][0], -64, 0)
    assert_almost_equal(integration[1][0], -64, 0)
    assert peakpos[0][0] == 20
    assert peakpos[1][0] == 20
Esempio n. 4
0
 def setup(self):
     kwargs = dict(config=self.config, tool=self)
     self.dl0 = CameraDL0Reducer(**kwargs)
     self.dl1 = CameraDL1Calibrator(**kwargs)
     self.cal = CameraCalibrator(r1_product=self.calibrator)
     self.cross = CrossCorrelation()
     self.glob_peak = GlobalPeakIntegrator()
     self.local_peak = LocalPeakIntegrator()
     self.neighbour = NeighbourPeakIntegrator()
     self.aver = AverageWfPeakIntegrator()
Esempio n. 5
0
def test_nb_peak_integration():
    telid = 11
    event = get_test_event()
    data = event.r0.tel[telid].adc_samples
    nsamples = data.shape[2]
    ped = event.mc.tel[telid].pedestal
    data_ped = data - np.atleast_3d(ped/nsamples)
    data_ped = np.array([data_ped[0], data_ped[0]])  # Test LG functionality
    geom = CameraGeometry.guess(*event.inst.pixel_pos[telid],
                                event.inst.optical_foclen[telid])
    nei = geom.neighbors

    integrator = NeighbourPeakIntegrator(None, None)
    integrator.neighbours = nei
    integration, peakpos, window = integrator.extract_charge(data_ped)

    assert_almost_equal(integration[0][0], -64, 0)
    assert_almost_equal(integration[1][0], -64, 0)
    assert peakpos[0][0] == 20
    assert peakpos[1][0] == 20
Esempio n. 6
0
def test_nb_peak_integration(camera_waveforms):
    waveforms, camera = camera_waveforms
    nei = camera.neighbor_matrix_where
    integrator = NeighbourPeakIntegrator()
    integrator.neighbours = nei
    charge, _, _ = integrator.extract_charge(waveforms)

    assert_allclose(charge[0][0], 94.671, rtol=1e-3)
    assert_allclose(charge[1][0], 426.887, rtol=1e-3)

    integrator.lwt = 4
    integration, _, _ = integrator.extract_charge(waveforms)

    assert_allclose(integration[0][0], 220.418657, rtol=1e-3)
    assert_allclose(integration[1][0], 426.887, rtol=1e-3)