print("filename = {}".format(filename)) source = hessio_event_source( filename, # for now use only identical telescopes... allowed_tels=TelDict[args.teltype], max_events=args.max_events) for event in source: if len(event.dl0.tels_with_data) < 2: continue print('Scanning input file... count = {}'.format(event.count)) print('available telscopes: {}'.format(event.dl0.tels_with_data)) seed = MCShower() seed.energy = event.mc.energy seed.alt = event.mc.alt + .1 * u.rad seed.az = event.mc.az # + 10 * u.deg seed.core_x = event.mc.core_x seed.core_y = event.mc.core_y # if not done yet, add the height of the shower maximum as a field to the shower container try: seed.add_item("h_shower_max") except AttributeError: pass # find the height of the shower maximum and set it in the shower container seed.h_shower_max = fit.shower_max_estimator.find_shower_max_height( event.mc.energy, event.mc.h_first_int, event.mc.alt)
if __name__ == '__main__': parser = argparse.ArgumentParser(description='Perform simple Hillas Reco') parser.add_argument('filename', metavar='EVENTIO_FILE', nargs='?', default=get_example_simtelarray_file()) args = parser.parse_args() source = hessio_event_source(args.filename) container = Container("hessio_container") container.meta.add_item('pixel_pos', dict()) container.add_item("dl0", RawData()) container.add_item("mc", MCShowerData()) container.add_item("trig", CentralTriggerData()) container.add_item("count") tel,cam,opt = ID.load(filename=args.filename) ev = 0 efficiency = list() efficiency.append(list()) efficiency.append(list()) efficiency.append(list()) efficiency.append(list()) impact = list() geom = 0 for event in source:
source = hessio_event_source(filename, # for now use only identical telescopes... allowed_tels=TelDict[args.teltype], max_events=args.max_events) for event in source: if len(event.dl0.tels_with_data) < 2: continue print('Scanning input file... count = {}'.format(event.count)) print('available telscopes: {}'.format(event.dl0.tels_with_data)) seed = MCShower() seed.energy = event.mc.energy seed.alt = event.mc.alt + .1 * u.rad seed.az = event.mc.az # + 10 * u.deg seed.core_x = event.mc.core_x seed.core_y = event.mc.core_y # if not done yet, add the height of the shower maximum as a field to the shower container try: seed.add_item("h_shower_max") except AttributeError: pass # find the height of the shower maximum and set it in the shower container seed.h_shower_max = fit.shower_max_estimator.find_shower_max_height(event.mc.energy, event.mc.h_first_int, event.mc.alt) fit.seed = seed