def test_check_r1_empty(example_event): calibrator = CameraCalibrator() telid = list(example_event.r0.tel)[0] waveform = example_event.r1.tel[telid].waveform.copy() with pytest.warns(UserWarning): example_event.r1.tel[telid].waveform = None calibrator._calibrate_dl0(example_event, telid) assert example_event.dl0.tel[telid].waveform == None assert calibrator._check_r1_empty(None) is True assert calibrator._check_r1_empty(waveform) is False
def test_check_r1_empty(example_event): calibrator = CameraCalibrator() telid = list(example_event.r0.tel)[0] waveform = example_event.r1.tel[telid].waveform.copy() with pytest.warns(UserWarning): example_event.r1.tel[telid].waveform = None calibrator._calibrate_dl0(example_event, telid) assert example_event.dl0.tel[telid].waveform == None assert calibrator._check_r1_empty(None) is True assert calibrator._check_r1_empty(waveform) is False
def test_check_r1_empty(example_event): calibrator = CameraCalibrator() telid = list(example_event.r0.tel)[0] waveform = example_event.r1.tel[telid].waveform.copy() with pytest.warns(UserWarning): example_event.r1.tel[telid].waveform = None calibrator._calibrate_dl0(example_event, telid) assert example_event.dl0.tel[telid].waveform is None assert calibrator._check_r1_empty(None) is True assert calibrator._check_r1_empty(waveform) is False calibrator = CameraCalibrator(image_extractor=FullWaveformSum()) event = DataContainer() event.dl0.tel[telid].waveform = np.full((2048, 128), 2) with pytest.warns(UserWarning): calibrator(event) assert (event.dl0.tel[telid].waveform == 2).all() assert (event.dl1.tel[telid].image == 2 * 128).all()