asgardpy.data.dataset_1d module

Basic overview

The class asgardpy.data.dataset_1d.Datasets1DAnalysisStep gathers information for a list of instruments by using the class asgardpy.data.dataset_1d.Dataset1DGeneration.

The main config for this dataset is defined by asgardpy.data.dataset_1d.Dataset1DConfig which is simply a collection of basic information as defined in asgardpy.data.dataset_1d.Dataset1DBaseConfig. This collection is a combination of asgardpy.io.io.InputConfig and asgardpy.data.dataset_1d.Dataset1DInfoConfig information.

Classes

Main classes to define 1D Dataset Config, 1D Dataset Analysis Step and to generate 1D Datasets from given Instruments’ DL3 data from the config.

pydantic model asgardpy.data.dataset_1d.Dataset1DBaseConfig[source]

Bases: BaseConfig

Config section for 1D DL3 Dataset base information for each instrument.

Fields:
field dataset_info: Dataset1DInfoConfig = Dataset1DInfoConfig(name='dataset-name', geom=GeomConfig(wcs=WcsConfig(skydir=SkyPositionConfig(frame='icrs', lon=<Quantity 0. deg>, lat=<Quantity 0. deg>, radius=<Quantity 0. deg>), binsize=<Quantity 0.1 deg>, proj='TAN', map_frame_shape=MapFrameShapeConfig(width=<Quantity 5. deg>, height=<Quantity 5. deg>), binsize_irf=<Quantity 0.2 deg>), selection=SelectionConfig(offset_max=<Quantity 2.5 deg>), axes=[MapAxesConfig(name='energy', axis=EnergyAxisConfig(min=<Quantity 1. GeV>, max=<Quantity 1. TeV>, nbins=5, per_decade=True), axis_custom=EnergyEdgesCustomConfig(edges=[], unit='TeV'))], from_events_file=True, reco_psf=False), observation=ObservationsConfig(obs_ids=[], event_type=[], obs_file=PosixPath('.'), obs_time=[], obs_cone=SkyPositionConfig(frame='icrs', lon=<Quantity 0. deg>, lat=<Quantity 0. deg>, radius=<Quantity 0. deg>), required_irfs=['aeff']), background=BackgroundConfig(method='reflected', region_finder_method='wobble', parameters={}, exclusion=ExclusionRegionsConfig(target_source=True, regions=[], exclusion_file=PosixPath('.'))), safe_mask=SafeMaskConfig(methods=[], parameters={}), on_region=SkyPositionConfig(frame='icrs', lon=<Quantity 0. deg>, lat=<Quantity 0. deg>, radius=<Quantity 0. deg>), containment_correction=True, map_selection=[])
field dl4_dataset_info: DL4BaseConfig = DL4BaseConfig(dl4_dataset=InputDL4Config(type='MapDataset', input_dir=PosixPath('.'), glob_pattern={}, dl4_format='gadf'), spectral_energy_range=MapAxesConfig(name='energy', axis=EnergyAxisConfig(min=<Quantity 1. GeV>, max=<Quantity 1. TeV>, nbins=5, per_decade=True), axis_custom=EnergyEdgesCustomConfig(edges=[], unit='TeV')))
field input_dl3: list[InputDL3Config] = [InputDL3Config(type='type', input_dir=PosixPath('.'), glob_pattern={})]
field input_dl4: bool = False
field name: str = 'Instrument-name'
pydantic model asgardpy.data.dataset_1d.Dataset1DConfig[source]

Bases: BaseConfig

Config section for a list of all 1D DL3 Datasets information.

Fields:
field instruments: list[Dataset1DBaseConfig] = [Dataset1DBaseConfig(name='Instrument-name', input_dl3=[InputDL3Config(type='type', input_dir=PosixPath('.'), glob_pattern={})], input_dl4=False, dataset_info=Dataset1DInfoConfig(name='dataset-name', geom=GeomConfig(wcs=WcsConfig(skydir=SkyPositionConfig(frame='icrs', lon=<Quantity 0. deg>, lat=<Quantity 0. deg>, radius=<Quantity 0. deg>), binsize=<Quantity 0.1 deg>, proj='TAN', map_frame_shape=MapFrameShapeConfig(width=<Quantity 5. deg>, height=<Quantity 5. deg>), binsize_irf=<Quantity 0.2 deg>), selection=SelectionConfig(offset_max=<Quantity 2.5 deg>), axes=[MapAxesConfig(name='energy', axis=EnergyAxisConfig(min=<Quantity 1. GeV>, max=<Quantity 1. TeV>, nbins=5, per_decade=True), axis_custom=EnergyEdgesCustomConfig(edges=[], unit='TeV'))], from_events_file=True, reco_psf=False), observation=ObservationsConfig(obs_ids=[], event_type=[], obs_file=PosixPath('.'), obs_time=[], obs_cone=SkyPositionConfig(frame='icrs', lon=<Quantity 0. deg>, lat=<Quantity 0. deg>, radius=<Quantity 0. deg>), required_irfs=['aeff']), background=BackgroundConfig(method='reflected', region_finder_method='wobble', parameters={}, exclusion=ExclusionRegionsConfig(target_source=True, regions=[], exclusion_file=PosixPath('.'))), safe_mask=SafeMaskConfig(methods=[], parameters={}), on_region=SkyPositionConfig(frame='icrs', lon=<Quantity 0. deg>, lat=<Quantity 0. deg>, radius=<Quantity 0. deg>), containment_correction=True, map_selection=[]), dl4_dataset_info=DL4BaseConfig(dl4_dataset=InputDL4Config(type='MapDataset', input_dir=PosixPath('.'), glob_pattern={}, dl4_format='gadf'), spectral_energy_range=MapAxesConfig(name='energy', axis=EnergyAxisConfig(min=<Quantity 1. GeV>, max=<Quantity 1. TeV>, nbins=5, per_decade=True), axis_custom=EnergyEdgesCustomConfig(edges=[], unit='TeV'))))]
field type: ReductionTypeEnum = ReductionTypeEnum.spectrum
class asgardpy.data.dataset_1d.Dataset1DGeneration(log, config_1d_dataset, config_full)[source]

Bases: object

Class for 1D dataset creation based on the config or AsgardpyConfig information provided on the 1D dataset and the target source.

Runs the following steps:

  1. Read the DL3 files of 1D datasets into DataStore object.

  2. Perform any Observation selection, based on Observation IDs or time intervals.

  3. Create the base dataset reference, including the main counts geometry.

  4. Prepare standard data reduction makers using the parameters passed in the config.

  5. Generate the final dataset.

run()[source]

Main function to run the creation of 1D dataset.

update_dataset(observations)[source]

Update the datasets generated by DatasetsMaker with names as per the Observation ID and if a custom safe energy mask is provided in the config, apply it to each dataset accordingly.

pydantic model asgardpy.data.dataset_1d.Dataset1DInfoConfig[source]

Bases: BaseConfig

Config section for 1D DL3 Dataset Reduction for each instrument.

Fields:
field background: BackgroundConfig = BackgroundConfig(method='reflected', region_finder_method='wobble', parameters={}, exclusion=ExclusionRegionsConfig(target_source=True, regions=[], exclusion_file=PosixPath('.')))
field containment_correction: bool = True
field geom: GeomConfig = GeomConfig(wcs=WcsConfig(skydir=SkyPositionConfig(frame='icrs', lon=<Quantity 0. deg>, lat=<Quantity 0. deg>, radius=<Quantity 0. deg>), binsize=<Quantity 0.1 deg>, proj='TAN', map_frame_shape=MapFrameShapeConfig(width=<Quantity 5. deg>, height=<Quantity 5. deg>), binsize_irf=<Quantity 0.2 deg>), selection=SelectionConfig(offset_max=<Quantity 2.5 deg>), axes=[MapAxesConfig(name='energy', axis=EnergyAxisConfig(min=<Quantity 1. GeV>, max=<Quantity 1. TeV>, nbins=5, per_decade=True), axis_custom=EnergyEdgesCustomConfig(edges=[], unit='TeV'))], from_events_file=True, reco_psf=False)
field map_selection: list[MapSelectionEnum] = []
field name: str = 'dataset-name'
field observation: ObservationsConfig = ObservationsConfig(obs_ids=[], event_type=[], obs_file=PosixPath('.'), obs_time=[], obs_cone=SkyPositionConfig(frame='icrs', lon=<Quantity 0. deg>, lat=<Quantity 0. deg>, radius=<Quantity 0. deg>), required_irfs=['aeff'])
field on_region: SkyPositionConfig = SkyPositionConfig(frame='icrs', lon=<Quantity 0. deg>, lat=<Quantity 0. deg>, radius=<Quantity 0. deg>)
field safe_mask: SafeMaskConfig = SafeMaskConfig(methods=[], parameters={})
class asgardpy.data.dataset_1d.Datasets1DAnalysisStep(config, log=None, overwrite=True)[source]

Bases: AnalysisStepBase

From the given config information, prepare the full list of 1D datasets, iterating over all the Instruments’ information by running the Dataset1DGeneration function.

tag = 'datasets-1d'