lstmcpipe.config package

Contents

lstmcpipe.config package#

Subpackages#

Submodules#

lstmcpipe.config.dl1ab_tuning module#

lstmcpipe.config.dl1ab_tuning.create_dl1ab_tuned_config(base_config_path, config_output_path, observed_data_path, mc_path)#

Create a new lstchain config with noise parameters added. If there are noise parameters in the input config, this will fail with an Exception.

Parameters:#

base_config_path: str or Path-like object

Input config. Will not be overwritten.

config_output_path: str or Path-like object

Where to save the new config file.

observed_data_path: str or Path-like object

Path to a dl1 file with observed data from which to calculate the parameters.

observed_mc_path: str or Path-like object

Path to a dl1 file with simulated data from which to calculate the parameters.

Return:#

config_output_path

lstmcpipe.config.paths_config module#

class lstmcpipe.config.paths_config.PathConfig(prod_id)#

Bases: object

Base class to generate a Path configuration for a production

generate()#

Generate the stages paths. They are copied into self.paths and returned.

Returns:

dict

Return type:

paths config

save_yml(filename, overwrite=False, append=False)#

Dump the path config to a file

Parameters:
  • filename (str or Path)

  • overwrite (bool)

  • append (bool)

class lstmcpipe.config.paths_config.PathConfigAllSkyBase(prod_id, dec)#

Bases: PathConfig

Standard paths configuration for a LSTProd2 MC production dataset_type: ‘Training’ or ‘Testing’

dl1_dir(particle, pointing, dataset_type, dec)#
property dl1_to_dl2#
dl2_dir(particle, pointing, dataset_type, dec)#
property dl2_to_irfs#
irf_dir(particle, pointing, dataset_type, dec)#
property merge_dl1#
models_dir()#
r0_dir()#
property r0_to_dl1#
property train_pipe#
class lstmcpipe.config.paths_config.PathConfigAllSkyFull(prod_id, dec_list)#

Bases: PathConfig

property dl1_to_dl2#
property dl2_to_irfs#
property merge_dl1#
plot_pointings(ax=None, projection='polar', add_grid3d=False, train_kwargs=None, test_kwargs=None)#

Produce a scatter plot of the pointings based on parsed pointings paths

Parameters:
  • ax (matplotlib.pyplot.Axis)

  • projection (str or None) – ‘3d’ | ‘aitoff’ | ‘hammer’ | ‘lambert’ | ‘mollweide’ | ‘polar’ | ‘rectilinear’

  • add_grid3d (bool) – add a 3D grid in case of projection=’3d’

  • train_kwargs (dict | None) – kwargs for matplotlib.pyplot.scatter

  • test_kwargs (dict | None) – kwargs for matplotlib.pyplot.scatter

Return type:

matplotlib.pyplot.axis

property r0_to_dl1#
property train_pipe#
class lstmcpipe.config.paths_config.PathConfigAllSkyFullDL1ab(prod_id, source_prod_id, dec_list, run_checker=True)#

Bases: PathConfigAllSkyFull

property dl1ab#
class lstmcpipe.config.paths_config.PathConfigAllSkyFullSplitDiffuse(prod_id, dec_list)#

Bases: PathConfigAllSkyFull

property dl1_to_dl2#
property dl2_to_irfs#
property merge_dl1#
property train_test_split#
class lstmcpipe.config.paths_config.PathConfigAllSkyTesting(prod_id, dec)#

Bases: PathConfigAllSkyBase

dl1_dir(pointing, dec='')#
property dl1_to_dl2#
dl2_dir(pointing)#
dl2_output_file(pointing)#
property dl2_to_irfs#
irf_dir(pointing)#
irf_output_file(pointing)#
load_pointings()#

Load pointings. Azimuth between -pi and pi. Altitude between pi/2 and -pi/2

Return type:

‘astropy.table.QTable`

property merge_dl1#
plot_pointings(ax=None, projection='polar', add_grid3d=False, **kwargs)#

Produce a scatter plot of the pointings based on parsed pointings paths

Parameters:
  • pointings (2D array of astropy.quantities or numpy array in rad)

  • ax (matplotlib.pyplot.Axis)

  • projection (str or None) – ‘3d’ | ‘aitoff’ | ‘hammer’ | ‘lambert’ | ‘mollweide’ | ‘polar’ | ‘rectilinear’

  • add_grid3d (bool) – add a 3D grid in case of projection=’3d’

  • kwargs (dict) – kwargs for matplotlib.pyplot.scatter

Returns:

ax

Return type:

matplotlib.pyplot.axis

pointing_dirs()#
property pointings#

All pointings in rad. Azimuth between -pi and pi. Altitude between pi/2 and -pi/2

Return type:

astropy.table.QTable

r0_dir(pointing)#
property r0_to_dl1#
testing_merged_dl1(pointing)#
class lstmcpipe.config.paths_config.PathConfigAllSkyTestingDL1ab(prod_id, source_prod_id, dec, run_checker=True)#

Bases: PathConfigAllSkyTesting

check_source_prod()#
property dl1ab#
class lstmcpipe.config.paths_config.PathConfigAllSkyTestingGammaDiffuse(prod_id, dec)#

Bases: PathConfigAllSkyTesting

property dl1_to_dl2#
dl2_output_file(pointing)#
load_pointings()#

Load pointings. Azimuth between -pi and pi. Altitude between pi/2 and -pi/2

Return type:

‘astropy.table.QTable`

property merge_dl1#
testing_merged_dl1(pointing, dec)#
class lstmcpipe.config.paths_config.PathConfigAllSkyTraining(prod_id, dec)#

Bases: PathConfigAllSkyBase

Base class for training all sky production. Handles a single declination from R0 up to RF generation.

dl1_dir(particle, pointing)#
load_pointings(join_type='inner')#

Load and find pointings that exist for all training particles. This is overly complicated because pointings directory names are not consistent particle-wise see node_theta_16.087_az_108.090_ vs node_corsika_theta_16.087_az_108.090_ see testing pointings for a simpler implementation if this get solved

Use join_type to keep only the pointings existing for all training particles or all of them Azimuth between -pi and pi. Altitude between pi/2 and -pi/2

Parameters:

join_type (string) – See astropy.table.join: (‘inner’ | ‘outer’ | ‘left’ | ‘right’ | ‘cartesian’), default is ‘inner’

Return type:

‘astropy.table.QTable`

property merge_dl1#
plot_pointings(ax=None, projection='polar', add_grid3d=True, **kwargs)#

Produce a scatter plot of the pointings based on parsed pointings paths

Parameters:
  • pointings (2D array of astropy.quantities or numpy array in rad)

  • ax (matplotlib.pyplot.Axis)

  • projection (str or None) – ‘3d’ | ‘aitoff’ | ‘hammer’ | ‘lambert’ | ‘mollweide’ | ‘polar’ | ‘rectilinear’

  • add_grid3d (bool) – add a 3D grid in case of projection=’3d’

  • kwargs (dict) – kwargs for matplotlib.pyplot.scatter

Returns:

ax

Return type:

matplotlib.pyplot.axis

pointing_dirs(particle)#
property pointings#

All pointings in rad. Azimuth between -pi and pi. Altitude between pi/2 and -pi/2.

Return type:

astropy.quantity

r0_dir(particle, pointing)#
property r0_to_dl1#
property train_pipe#
training_merged_dl1(particle)#
class lstmcpipe.config.paths_config.PathConfigAllSkyTrainingDL1ab(prod_id, source_prod_id, dec, run_checker=True)#

Bases: PathConfigAllSkyTraining

check_source_prod()#
property dl1ab#
class lstmcpipe.config.paths_config.PathConfigAllSkyTrainingWithSplit(prod_id, dec)#

Bases: PathConfigAllSkyTraining

dl1_diffuse_test_dir(pointing)#
dl1_diffuse_train_dir(pointing)#
property merge_dl1#
property train_test_split#
class lstmcpipe.config.paths_config.PathConfigAllTrainTestDL1b(prod_id, source_prod_id, dec_list, run_checker=True)#

Bases: PathConfigAllSkyFullDL1ab

check_source_prod()#

Check that merged dl1 files for training exist in the source prod. Otherwise, remove the dec from the list of decs to be processed and warn the user.

property dl1_to_dl2#
property train_pipe#
class lstmcpipe.config.paths_config.PathConfigProd5Trans80(prod_id, zenith='zenith_20deg')#

Bases: PathConfig

Standard paths configuration for a prod5_trans_80 MC production

dl1_dir(particle, gamma_src_offset='off0.4deg')#
property dl1_to_dl2#
dl2_dir(particle, gamma_src_offset='off0.4deg')#
dl2_output_file(particle, gamma_src_offset='off0.4deg')#
property dl2_to_irfs#
property dl2_to_sensitivity#
irf_dir(gamma_src_offset='diffuse')#
property merge_dl1#
merge_output_file(particle, step, gamma_src_offset='off0.4deg')#
models_path()#
property particles#
property plot_irfs#
r0_dir(particle, gamma_src_offset='off0.4deg')#
property r0_to_dl1#
sensitivity_file(offset)#
test_dir(particle, gamma_src_offset='off0.4deg')#
train_dir(particle, gamma_src_offset='off0.4deg')#
property train_pipe#
property train_test_split#
class lstmcpipe.config.paths_config.PathConfigProd5Trans80DL1ab(prod_id, source_prod_id, zenith='zenith_20deg', run_checker=True)#

Bases: PathConfigProd5Trans80

check_source_prod()#
property dl1ab#
starting_dl1(particle, step, gamma_src_offset='off0.4deg')#

lstmcpipe.config.pipeline_config module#

lstmcpipe.config.pipeline_config.complete_lstmcpipe_config(loaded_config)#

Completes (and get default values) of some entries of the lstmcpipe config

Parameters:

loaded_config (dict) – Loaded config generated by lstmcpipe PathConfig

Returns:

config – Dictionary with all the key:values completed along the r0_to_dl3 workflow

Return type:

dict

lstmcpipe.config.pipeline_config.config_valid(loaded_config)#

Test if the given dictionary contains valid values for the r0_to_dl3 processing.

Not all combinations are sensible!

Parameters:#

loaded_config: dict

Dictionary with the values in the config file

Returns:#

True if config is valid

lstmcpipe.config.pipeline_config.load_config(config_path)#

Load the pipeline config, test for invalid values and set paths to the data files/directories.

Parameters:#

config_path: str or Path-like object

Path to the config file

Returns:#

config: dict

Dictionary with parameters for the r0_to_dl3 processing

Module contents#

lstmcpipe.config.create_dl1ab_tuned_config(base_config_path, config_output_path, observed_data_path, mc_path)#

Create a new lstchain config with noise parameters added. If there are noise parameters in the input config, this will fail with an Exception.

Parameters:#

base_config_path: str or Path-like object

Input config. Will not be overwritten.

config_output_path: str or Path-like object

Where to save the new config file.

observed_data_path: str or Path-like object

Path to a dl1 file with observed data from which to calculate the parameters.

observed_mc_path: str or Path-like object

Path to a dl1 file with simulated data from which to calculate the parameters.

Return:#

config_output_path

lstmcpipe.config.load_config(config_path)#

Load the pipeline config, test for invalid values and set paths to the data files/directories.

Parameters:#

config_path: str or Path-like object

Path to the config file

Returns:#

config: dict

Dictionary with parameters for the r0_to_dl3 processing