def make_total_event_list(): """Make total event list. TODO: move this function to the datastore class and the sky box selection to the `make_counts_image` function. """ data_store = DataStore(dir=HESSFITS_MPP) observation_selection = dict(type='sky_box', frame='galactic', lon=Quantity([-120, 70], 'deg'), lat=Quantity([-5, 5], 'deg'), border=Quantity(2, 'deg')) observation_table = data_store.make_observation_table( observation_selection) # For testing, only process a small subset of observations # observation_table = observation_table.select_linspace_subset(num=1000) event_list_files = data_store.make_table_of_files(observation_table, filetypes=['events']) ds = EventListDataset.vstack_from_files(event_list_files['filename']) print('Total number of events: {}'.format(len(ds.event_list))) print('Total number of GTIs: {}'.format(len(ds.good_time_intervals))) print('Converting EventListDataset to HDUList ...') hdu_list = ds.to_fits() print('Writing {}'.format(TOTAL_EVENTS_FILE)) hdu_list.writeto(TOTAL_EVENTS_FILE, clobber=True)
def make_total_event_list(): """Make total event list. TODO: move this function to the datastore class and the sky box selection to the `make_counts_image` function. """ data_store = DataStore(dir=HESSFITS_MPP) observation_selection = dict(type='sky_box', frame='galactic', lon=Quantity([-120, 70], 'deg'), lat=Quantity([-5, 5], 'deg'), border=Quantity(2, 'deg') ) observation_table = data_store.make_observation_table(observation_selection) # For testing, only process a small subset of observations # observation_table = observation_table.select_linspace_subset(num=1000) event_list_files = data_store.make_table_of_files(observation_table, filetypes=['events']) ds = EventListDataset.vstack_from_files(event_list_files['filename']) print('Total number of events: {}'.format(len(ds.event_list))) print('Total number of GTIs: {}'.format(len(ds.good_time_intervals))) print('Converting EventListDataset to HDUList ...') hdu_list = ds.to_fits() print('Writing {}'.format(TOTAL_EVENTS_FILE)) hdu_list.writeto(TOTAL_EVENTS_FILE, clobber=True)
"""Eventlist coordinate check. """ from gammapy.data import EventListDataset from gammapy.datasets import gammapy_extra filename = gammapy_extra.filename( 'test_datasets/unbundled/hess/run_0023037_hard_eventlist.fits.gz') event_list = EventListDataset.read(filename) print(event_list.info) event_list.check() """ TODO: figure out the origin of this offset: ALT / AZ not consistent with RA / DEC. Max separation: 726.6134257108188 arcsec """
"""Eventlist coordinate check. """ from gammapy.data import EventListDataset from gammapy.datasets import gammapy_extra filename = gammapy_extra.filename('test_datasets/unbundled/hess/run_0023037_hard_eventlist.fits.gz') event_list = EventListDataset.read(filename) print(event_list.info) event_list.check() """ TODO: figure out the origin of this offset: ALT / AZ not consistent with RA / DEC. Max separation: 726.6134257108188 arcsec """