snat_sim.data_paths

The data_paths module is responsible for pointing at local file paths by the parent package.

The DataPaths provides a single access point for retrieving all external file paths used by the parent package. Default paths are assumed automatically, unless customized options are defined in the working environment (see the docs for more details.)

Usage Example

To identify the current paths as defined in the working environemt:

>>> from snat_sim.data_paths import DataPaths
>>>
>>> current_paths = DataPaths()
>>> spectra_dir = current_paths.stellar_spectra_dir
>>> print(type(spectra_dir))
<class 'pathlib.PosixPath'>

A record is kept of any custom paths defined in the working environment at the time of package instantiation. These paths are available as an instance of the DataPaths class:

>>> from snat_sim.data_paths import paths_at_init
>>>
>>> print(type(paths_at_init))
<class 'snat_sim.data_paths.DataPaths'>

Module Docs

class snat_sim.data_paths.DataPaths[source]

Points to the location of on disk data used by the parent package

__init__()[source]

Establish the location of package data on the local machine

property pwv_config_path: Path

The path of the PWV configuration file

Return type:

Path

property stellar_spectra_dir: Path

Directory with stellar spectra

Return type:

Path

property stellar_flux_dir: Path

Directory with stellar flux values

Return type:

Path

get_filters_dir(survey=None)[source]

Directory with filter profiles

Parameters:

survey (Optional[str]) – Return subdirectory for the given filter

Return type:

Path

get_plasticc_dir(cadence=None, model=None)[source]

Directory with PLAsTICC simulation data

Parameters:
  • cadence (Optional[str]) – Return subdirectory for the given simulation cadence

  • model (Optional[int]) – Return subdirectory for the given simulation model

Return type:

Path