def test_get_event(): dataset = get_datasets_path("gamma_test.simtel.gz") file = HessioFileReader(None, None, input_path=dataset) event = file.get_event(2) assert event.count == 2 assert event.dl0.event_id == 803 event = file.get_event(803, True) assert event.count == 2 assert event.dl0.event_id == 803
def test_get_event(): dataset = get_datasets_path("gamma_test.simtel.gz") file = HessioFileReader(None, None, input_path=dataset) event = file.get_event(2) assert event.count == 2 assert event.r0.event_id == 803 event = file.get_event(803, True) assert event.count == 2 assert event.r0.event_id == 803
def setup(self): self.log_format = "%(levelname)s: %(message)s [%(name)s.%(funcName)s]" data_config = self.config.copy() data_config['WaveformCleanerFactory'] = Config(cleaner='CHECMWaveformCleanerLocal') mc_config = self.config.copy() data_kwargs = dict(config=data_config, tool=self) mc_kwargs = dict(config=mc_config, tool=self) filepath = '/Volumes/gct-jason/data/170330/onsky-mrk501/Run05477_r1.tio' reader = TargetioFileReader(input_path=filepath, **data_kwargs) filepath = '/Users/Jason/Software/outputs/sim_telarray/meudon_cr/simtel_proton_nsb50_thrs30_1petal_rndm015_heide.gz' # filepath = '/Users/Jason/Software/outputs/sim_telarray/meudon_cr/simtel_proton_nsb50_thrs30.gz' reader_mc = HessioFileReader(input_path=filepath, **mc_kwargs) calibrator = CameraCalibrator(origin=reader.origin, **data_kwargs) calibrator_mc = CameraCalibrator(origin=reader_mc.origin, **mc_kwargs) first_event = reader.get_event(0) telid = list(first_event.r0.tels_with_data)[0] pos = first_event.inst.pixel_pos[telid] foclen = first_event.inst.optical_foclen[telid] geom = CameraGeometry.guess(*pos, foclen) first_event = reader_mc.get_event(0) telid = list(first_event.r0.tels_with_data)[0] pos_mc = first_event.inst.pixel_pos[telid] foclen = first_event.inst.optical_foclen[telid] geom_mc = CameraGeometry.guess(*pos_mc, foclen) d1 = dict(type='Data', reader=reader, calibrator=calibrator, pos=pos, geom=geom, t1=20, t2=10) d2 = dict(type='MC', reader=reader_mc, calibrator=calibrator_mc, pos=pos_mc, geom=geom_mc, t1=20, t2=10) self.reader_df = pd.DataFrame([d1, d2]) p_kwargs = data_kwargs p_kwargs['script'] = "checm_paper_hillas" p_kwargs['figure_name'] = "all_images" self.p_allimage = AllImagePlotter(**p_kwargs) p_kwargs['figure_name'] = "all_peak_time_images" self.p_alltimeimage = PeakTimePlotter(**p_kwargs) p_kwargs['figure_name'] = "all_mc_images" self.p_allmcimage = AllImagePlotter(**p_kwargs) p_kwargs['figure_name'] = "zero_width_images" self.p_zwimage = ZeroWidthImagePlotter(**p_kwargs) p_kwargs['figure_name'] = "zero_width_mc_images" self.p_zwmcimage = ZeroWidthImagePlotter(**p_kwargs) p_kwargs['figure_name'] = "muon_images" self.p_muonimage = MuonImagePlotter(**p_kwargs) p_kwargs['figure_name'] = "bright_images" self.p_brightimage = BrightImagePlotter(**p_kwargs) p_kwargs['figure_name'] = "count_image" self.p_countimage = CountPlotter(**p_kwargs) p_kwargs['figure_name'] = "whole_distribution" self.p_whole_dist = WholeDist(**p_kwargs, shape='wide') p_kwargs['figure_name'] = "width_vs_length" self.p_widthvslength = WidthVsLength(**p_kwargs, shape='wide') p_kwargs['figure_name'] = "size_vs_length" self.p_sizevslength = SizeVsLength(**p_kwargs, shape='wide') p_kwargs['figure_name'] = "width_div_length" self.p_widthdivlength = WidthDivLength(**p_kwargs, shape='wide') p_kwargs['figure_name'] = "length_div_size" self.p_lengthdivsize = LengthDivSize(**p_kwargs, shape='wide') p_kwargs['figure_name'] = "pair_plot" self.p_pair = PairPlotter(**p_kwargs, shape='wide') p_kwargs['figure_name'] = "pair_mc_plot" self.p_mc_pair = PairPlotter(**p_kwargs, shape='wide') p_kwargs['figure_name'] = "length" self.p_length = LengthPlotter(**p_kwargs, shape='wide') p_kwargs['figure_name'] = "width" self.p_width = WidthPlotter(**p_kwargs, shape='wide')