beetroots.simulations.astro package

Subpackages

Submodules

beetroots.simulations.astro.abstract_astro_simulation module

class beetroots.simulations.astro.abstract_astro_simulation.AstroSimulation(simu_name: str, cloud_name: str, max_workers: int, params_names: Dict[str, str], list_lines_fit: List[str], yaml_file: str, path_data: str, path_outputs: str, path_models: str, forward_model_fixed_params: Dict[str, float | None], pixels_of_interest: Dict[int, str] = {}, small_size: int = 16, medium_size: int = 20, bigger_size: int = 24)[source]

Bases: Simulation

Parameters:
  • simu_name (str) – name of the full inversion procedure, used to name the outputs folder

  • cloud_name (str) – name of the observed cloud

  • max_workers (int, optional) – maximum number of workers to run the program

  • params_names (Dict[str, str]) – pairs of names for each parameter, with first the standard name (to be found as title of column in DataFrames) and second a latex name (to be displayed in figures). For instance, for the thermal pressure “P”: r”$P_{th}$)”

  • list_lines_fit (List[str]) – names of the observables used for the inversion

  • max_workers – maximum number of workers that can be used for inversion or results extraction, by default 10

  • small_size (int, optional) – size for basic text, axes titles, xticks and yticks, by default 16

  • medium_size (int, optional) – size of the axis labels, by default 20

  • bigger_size (int, optional) – size of the figure title, by default 24

  • path_outputs (str) – path to the output folder to be created

D

total number of physical parameters involved in the forward map

Type:

int

DATA_PATH

path to the folder containing the yaml input files and the observation data

Type:

str

D_no_kappa

number of physical parameters excluding the scaling parameter \(\kappa\) (used in astrophysical applications). When “kappa” is not in list_names, then D_no_kappa = D

D_sampling

number of physical parameters to be sampled

Type:

int

L

number of observables per component \(n\) used for inversion, e.g., per pixel

Type:

int

MODELS_PATH

path to the folder containing all the already defined and saved models (i.e., polynomials or neural networks)

Type:

str

cloud_name

name of the observed cloud

Type:

str

list_fixed_values

List[float | None] list of values for the physical parameters that are not to be samples

list_idx_sampling

indices of the physical parameters that are to be sampled (the other ones are fixed)

Type:

List[int]

list_lines_fit

names of the observables used for inversion

Type:

List[str]

list_names

names of the physical parameters in files, e.g., as titles of a DataFrame column, e.g., P_th or P for the thermal pressure

Type:

List[str]

list_names_plots

names of the physical parameters in figures, e.g., $P_{th}$ for the thermal pressure

Type:

List[str]

max_workers

maximum number of workers that can be used for inversion or results extraction

Type:

int

classmethod parse_args() Tuple[str, str, str, str][source]

parses the inputs of the command-line, that should contain

  • the name of the input YAML file

  • path to the data folder

  • path to the models folder

  • path to the outputs folder to be created (by default ‘.’)

Returns:

  • str – name of the input YAML file

  • str – path to the data folder

  • str – path to the models folder

  • str – path to the outputs folder to be created (by default ‘.’)

pixels_of_interest

pairs of (index, name) for pixels of interest that are to be highlighted in maps

Type:

Dict[int, str]

simu_name

name of the full inversion procedure, used to name the outputs folder

Type:

str

beetroots.simulations.astro.data_validation module

contains the validation schema that ensures that the .yaml input file, that depicts the inversion configuration, has a correct structure.

beetroots.simulations.astro.data_validation.schema = {'simu_init': {'required': True, 'schema': {'cloud_name': {'required': True, 'type': 'string'}, 'max_workers': {'max': 20, 'min': 1, 'required': True, 'type': 'number'}, 'simu_name': {'required': True, 'type': 'string'}}, 'type': 'dict'}, 'spatial_prior': {'required': False, 'schema': {'initial_regu_weights': {'type': 'list'}, 'name': {'allowed': ['L2-laplacian', 'L2-gradient'], 'type': 'string'}, 'use_next_nearest_neighbors': {'type': 'boolean'}}, 'type': 'dict'}, 'to_run_mcmc': {'required': True, 'type': 'boolean'}, 'to_run_optim_map': {'required': True, 'type': 'boolean'}, 'with_spatial_prior': {'required': True, 'type': 'boolean'}}

validation schema that ensures that the .yaml input file, that depicts the inversion configuration, has a correct structure

Module contents