asgardpy.io.io_dl4 module¶
Basic classes defining Input Config for DL4 files and some functions to retrieve information for the DL4 to DL5 processes.
- pydantic model asgardpy.io.io_dl4.DL4BaseConfig[source]¶
Bases:
BaseConfigConfig section for DL4 Dataset for a given instrument.
- Fields:
-
field dl4_dataset:
InputDL4Config= InputDL4Config(type='MapDataset', input_dir=PosixPath('.'), glob_pattern={}, dl4_format='gadf')¶
-
field spectral_energy_range:
MapAxesConfig= MapAxesConfig(name='energy', axis=EnergyAxisConfig(min=<Quantity 1. GeV>, max=<Quantity 1. TeV>, nbins=5, per_decade=True), axis_custom=EnergyEdgesCustomConfig(edges=[], unit='TeV'))¶
- class asgardpy.io.io_dl4.DL4Files(dl4_dataset_info, log=None)[source]¶
Bases:
objectA general class to retrieve information from given DL4 files.
- fetch_dl4_files_by_filenames(all_dl4_files, obs_ids)[source]¶
Assuming a simple nomenclature from gammapy on storing DL4 datasets names as pha_obs[OBS_ID].fits or obs_[OBS_ID].fits i.e. a single integer in the filename, being the OBS_ID or the DL4 dataset name.
- get_dl4_dataset(observation_config=None)[source]¶
Read the corresponding DL4 dataset with the list of files provided, along with the dataset format and stack them in a Datasets object.
- pydantic model asgardpy.io.io_dl4.InputDL4Config[source]¶
Bases:
BaseConfigConfig section for main information on getting the relevant DL4 files.
- Fields:
-
field dl4_format:
DL4FormatEnum= DL4FormatEnum.gadf¶
-
field input_dir:
Annotated[str|Path] = 'None'¶ - Constraints:
func = <function <lambda> at 0x7f5167d96020>
json_schema_input_type = PydanticUndefined
return_type = <class ‘pathlib.Path’>
when_used = json-unless-none
-
field type:
DatasetTypeEnum= DatasetTypeEnum.MapDataset¶