示例#1
0
def test_checm_cleaner_average(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

    cleaner = CHECMWaveformCleanerAverage()
    cleaner.apply(data_ped)
示例#2
0
def test_checm_cleaner_average(example_event):
    telid = 11
    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

    cleaner = CHECMWaveformCleanerAverage()
    cleaned = cleaner.apply(data_ped)

    assert_almost_equal(data_ped[0, 0, 0], -2.8, 1)
    assert_almost_equal(cleaned[0, 0, 0], -6.4, 1)
def test_checm_cleaner_average():
    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

    cleaner = CHECMWaveformCleanerAverage(None, None)
    cleaned = cleaner.apply(data_ped)

    assert_almost_equal(data_ped[0, 0, 0], -2.8, 1)
    assert_almost_equal(cleaned[0, 0, 0], -6.4, 1)
def test_checm_cleaner_average(test_event):
    telid = 11
    event = deepcopy(test_event)  # to avoid modifying the 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

    cleaner = CHECMWaveformCleanerAverage()
    cleaned = cleaner.apply(data_ped)

    assert_almost_equal(data_ped[0, 0, 0], -2.8, 1)
    assert_almost_equal(cleaned[0, 0, 0], -6.4, 1)