beetroots.simulations.astro package
Subpackages
- beetroots.simulations.astro.forward_map package
- beetroots.simulations.astro.observation package
- beetroots.simulations.astro.posterior_type package
- beetroots.simulations.astro.real_data package
- Submodules
- beetroots.simulations.astro.real_data.real_data_nn module
SimulationRealDataNNSimulationRealDataNN.DSimulationRealDataNN.D_no_kappaSimulationRealDataNN.LSimulationRealDataNN.NSimulationRealDataNN.Theta_true_scaledSimulationRealDataNN.cloud_nameSimulationRealDataNN.list_lines_fitSimulationRealDataNN.list_lines_validSimulationRealDataNN.list_namesSimulationRealDataNN.list_names_plotSimulationRealDataNN.main()SimulationRealDataNN.map_shaperSimulationRealDataNN.max_workersSimulationRealDataNN.path_data_csvSimulationRealDataNN.path_data_csv_inSimulationRealDataNN.path_data_csv_outSimulationRealDataNN.path_data_csv_out_mcmcSimulationRealDataNN.path_data_csv_out_optim_mapSimulationRealDataNN.path_data_csv_out_optim_mleSimulationRealDataNN.path_imgSimulationRealDataNN.path_output_simSimulationRealDataNN.path_rawSimulationRealDataNN.plots_estimatorSimulationRealDataNN.setup()
- Module contents
- beetroots.simulations.astro.toy_case package
- Submodules
- beetroots.simulations.astro.toy_case.toy_case_nn module
SimulationToyCaseNNSimulationToyCaseNN.DSimulationToyCaseNN.D_no_kappaSimulationToyCaseNN.LSimulationToyCaseNN.NSimulationToyCaseNN.Theta_true_scaledSimulationToyCaseNN.cloud_nameSimulationToyCaseNN.list_lines_fitSimulationToyCaseNN.list_lines_validSimulationToyCaseNN.list_namesSimulationToyCaseNN.list_names_plotSimulationToyCaseNN.main()SimulationToyCaseNN.map_shaperSimulationToyCaseNN.max_workersSimulationToyCaseNN.path_data_csvSimulationToyCaseNN.path_data_csv_inSimulationToyCaseNN.path_data_csv_outSimulationToyCaseNN.path_data_csv_out_mcmcSimulationToyCaseNN.path_data_csv_out_optim_mapSimulationToyCaseNN.path_data_csv_out_optim_mleSimulationToyCaseNN.path_imgSimulationToyCaseNN.path_output_simSimulationToyCaseNN.path_rawSimulationToyCaseNN.plots_estimatorSimulationToyCaseNN.setup()
- beetroots.simulations.astro.toy_case.toy_case_polyreg module
SimulationToyCasePolyRegSimulationToyCasePolyReg.DSimulationToyCasePolyReg.D_no_kappaSimulationToyCasePolyReg.LSimulationToyCasePolyReg.NSimulationToyCasePolyReg.Theta_true_scaledSimulationToyCasePolyReg.cloud_nameSimulationToyCasePolyReg.list_lines_fitSimulationToyCasePolyReg.list_lines_validSimulationToyCasePolyReg.list_namesSimulationToyCasePolyReg.list_names_plotSimulationToyCasePolyReg.main()SimulationToyCasePolyReg.map_shaperSimulationToyCasePolyReg.max_workersSimulationToyCasePolyReg.path_data_csvSimulationToyCasePolyReg.path_data_csv_inSimulationToyCasePolyReg.path_data_csv_outSimulationToyCasePolyReg.path_data_csv_out_mcmcSimulationToyCasePolyReg.path_data_csv_out_optim_mapSimulationToyCasePolyReg.path_data_csv_out_optim_mleSimulationToyCasePolyReg.path_imgSimulationToyCasePolyReg.path_output_simSimulationToyCasePolyReg.path_rawSimulationToyCasePolyReg.plots_estimatorSimulationToyCasePolyReg.setup()
- Module contents
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, thenD_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
.yamlinput file, that depicts the inversion configuration, has a correct structure