beetroots.simulations.astro.forward_map package
Submodules
beetroots.simulations.astro.forward_map.abstract_forward_map module
- class beetroots.simulations.astro.forward_map.abstract_forward_map.SimulationForwardMap(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:
AstroSimulation,ABCabstract class for to set up the forward map for an inversion of astrophysical data
- 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
- scale_dict_fixed_params(scaler: Scaler, dict_fixed_params: Dict[str, float | None]) Dict[str, float | None][source]
transforms the fixed parameters from their value in their natural spae to their value in the space in which they are to be sampled.
Note
since the scaler does not accept None or np.NaN, this transformation really needed a dedicated (though simple) method
- Parameters:
scaler (Scaler) – contains the transformation of the physical parameters values from their natural space to their scaled space (in which the sampling happens) and its inverse
dict_fixed_params (Dict[str, Optional[float]]) – contains the value of the fixed parameters in the physical parameter natural space. For example, {“kappa”:None, “Pth”:None, “G0”:None, “AV”:None, “angle”:0.} (the values with None indicate that the parameter is not fixed, so here, only the angle is set, to 0 degree).
- Returns:
contains the value of the fixed parameters in the space in which the physical parameter are to be sampled
- Return type:
Dict[str, Optional[float]]
- abstract setup_forward_map(**kwargs) Tuple[Scaler, ForwardMap][source]
sets up the forward map and the scaler
- Returns:
Scaler – contains the transformation of the Theta values from their natural space to their scaled space (used by the forward map and in which the sampling happens) and its inverse
ForwardMap – forward map to be used in the inversion
beetroots.simulations.astro.forward_map.abstract_nn module
- class beetroots.simulations.astro.forward_map.abstract_nn.SimulationNN(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:
SimulationForwardMapabstract class for to set up the forward map to an already defined neural network for an inversion of astrophysical data
- 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
- setup_forward_map(forward_model_name: str, force_use_cpu: bool, dict_fixed_params: Dict[str, float | None], dict_is_log_scale_params: Dict[str, bool]) Tuple[MyScaler, NeuralNetworkApprox][source]
sets up the forward map and the scaler
- Returns:
Scaler – contains the transformation of the Theta values from their natural space to their scaled space (used by the forward map and in which the sampling happens) and its inverse
ForwardMap – forward map to be used in the inversion
beetroots.simulations.astro.forward_map.abstract_poly_reg module
- class beetroots.simulations.astro.forward_map.abstract_poly_reg.SimulationPolynomialReg(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:
SimulationForwardMapabstract class for to set up the forward map to an already defined polynomial for an inversion of astrophysical data
- 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
- setup_forward_map(forward_model_name: str, dict_fixed_params: Dict[str, float | None], dict_is_log_scale_params: Dict[str, bool]) Tuple[MyScaler, PolynomialApprox][source]
sets up the forward map and the scaler
- Returns:
Scaler – contains the transformation of the Theta values from their natural space to their scaled space (used by the forward map and in which the sampling happens) and its inverse
ForwardMap – forward map to be used in the inversion