lst_auto_rta.paths.RecoPathStructure

class lst_auto_rta.paths.RecoPathStructure(base_data_dir: str, night_date: datetime)[source]

Bases: object

Implements the path structures to store RTA data for LST AUTO RTA

base_data_dir

Directory into which all RTA data are written. A Night’s data will be added in sub-directories.

Type:

Path

night_date

Date of the observation night. If in the morning, the date modified to correspond to the previous day (day of the start of the night).

Type:

datetime.datetime

__init__(base_data_dir: str, night_date: datetime)[source]

Methods

__init__(base_data_dir, night_date)

create_night_data_dir()

Create the night's data directory

create_observation_data_dirs(obs_id[, ...])

Create the observation directory and sub-directories

dl1_dir(obs_dir)

Path to the DL1 subdirectory in obs_dir

dl2_dir(obs_dir)

Path to the DL2 subdirectory in obs_dir

dl3_dir(obs_dir)

Path to the DL3 subdirectory in obs_dir

log_dir(obs_dir)

Path to the logs subdirectory in obs_dir

obs_dirs(obs_id)

Get the observation directories with data from observation obs_id

plt_dir(obs_dir)

Path to the plot subdirectory in obs_dir

Attributes

night_data_dir

Path to the night's data directory

create_night_data_dir()[source]

Create the night’s data directory

create_observation_data_dirs(obs_id: str, ensure_unique: bool = False) Path[source]

Create the observation directory and sub-directories

Parameters:
  • obs_id (str) – Observation ID

  • ensure_unique (bool, optional) – If true, makes sure that the created observation directory is unique, otherwise an existing repository can be re-used, by default False

Returns:

obs_data_dir – Path of the observation directory.

Return type:

Path

dl1_dir(obs_dir: Path | str) Path[source]

Path to the DL1 subdirectory in obs_dir

Parameters:

obs_dir (Path or str) – Path to the observation directory

Returns:

Path to the DL1 sub-directory of obs_dir.

Return type:

Path

dl2_dir(obs_dir: Path | str) Path[source]

Path to the DL2 subdirectory in obs_dir

Parameters:

obs_dir (Path or str) – Path to the observation directory

Returns:

Path to the DL2 sub-directory of obs_dir

Return type:

Path

dl3_dir(obs_dir: Path | str) Path[source]

Path to the DL3 subdirectory in obs_dir

Parameters:

obs_dir (Path or str) – Path to the observation directory

Returns:

Path to the DL3 sub-directory of obs_dir

Return type:

Path

log_dir(obs_dir: Path | str) Path[source]

Path to the logs subdirectory in obs_dir

Parameters:

obs_dir (Path or str) – Path to the observation directory

Returns:

Path to the log sub-directory of obs_dir

Return type:

Path

property night_data_dir: Path

Path to the night’s data directory

Returns:

Path of the night’s data directory: base_data_dir/YYYY/MM/DD

Return type:

Path

obs_dirs(obs_id: str) List[Path][source]

Get the observation directories with data from observation obs_id

Since several directories can exists when ensure_unique = True, this function returns a list of all possible directories for an observation.

Parameters:

obs_id (str) – Observation ID.

Returns:

List of Paths to directories containing data from observation obs_id.

Return type:

List[Path]

plt_dir(obs_dir: Path | str) Path[source]

Path to the plot subdirectory in obs_dir

Parameters:

obs_dir (Path or str) – Path to the observation directory

Returns:

Path to the plot sub-directory of obs_dir

Return type:

Path