Analysis#
The Analysis class is the main entry point of the ForMoSA package.
It orchestrates the full forward-modelling workflow: loading data, adapting
models, running nested sampling, and plotting results.
- class ForMoSA.analysis.Analysis(config_path, adapted=False, fitted=False, logger=None, log_level='info')[source]#
Bases:
objectForMoSA data analysis class.
- Parameters:
config_path (
ConfigPath) – Instance of class ConfigPath representing the configuration paths.adapted (
bool) – Whether the model is adapted to the data, by default False. Can be set to True if the model has already been adapted to the datafitted (
bool) – Whether the data have already been fitted forlogger (
Logger) – Loggerlog_level (
str) – Log level of the handler, by default'info'for all important informations.
Notes
Authors: Allan Denis
- property config_path: ConfigPath#
ConfigLoader.
- property observations: ObservationSet#
Set of observations.
- property parameters: ParameterSet#
Set of parameters.
- property subgrids: SubGridSet#
Set of subgrids.
- property ns: NestedSampling#
Nested Sampling.
- property ns_analysis: NSAnalysis#
NSAnalysis.
- adapt(config_adapt, config_inversion, to_json=False)[source]#
Adapt the grid of model to each observation.
- Parameters:
config_adapt (
ConfigAdapt) – Instance of ConfigAdaptconfig_inversion (ConfigInversion)
to_json (bool)
- Return type:
Notes
Authors: Simon Petrus, Matthieu Ravet and Allan Denis
- nested_sampling(config_parameters, config_adapt=ConfigAdapt(method='linear', emulator=['NA'], target_res_obs=['obs'], target_res_mod=['obs'], wav_cont=['NA'], res_cont=['NA'], backend='loky', n_jobs=4), config_inversion=ConfigInversion(logL_type=['chi2'], wav_fit=['0.9, 5.0'], ns_algo='pymultinest', npoints=50, hc_lower_bounds_lsq=['NA'], hc_higher_bounds_lsq=['NA']), config_NS=Config_NS(nestle=ConfigNestle(method='single', update_interval=None, npdim=None, maxiter=None, maxcall=None, dlogz=None, decline_factor=None, rstate=None), pymultinest=ConfigPyMultiNest(importance_nested_sampling=True, multimodal=True, const_efficiency_mode=False, evidence_tolerance=0.5, sampling_efficiency=0.8, n_iter_before_update=100, null_log_evidence=-1e+90, max_modes=100, mode_tolerance=-1e+90, seed=-1, verbose=True, resume=False, context=0, log_zero=-1e+100, max_iter=0, init_MPI=False, wrapped_params=None, dump_callback=None, use_MPI=True), ultranest=ConfigUltraNest(wrapped_params=None, vectorized=False, resume=True, run_num=None, num_bootstraps=30, storage_backend='hdf5', warmstart_max_tau=-1, dlogz=0.5, max_iters=None, max_ncalls=None, min_ess=400, frac_remain=0.01, cluster_num_live_points=40, Lepsilon=0.001)))[source]#
Launch nested sampling.
- Parameters:
config_adapt (
ConfigAdapt) – Instance of class ConfigAdaptconfig_inversion (
ConfigInversion) – Instance of class ConfigInversionconfig_parameters (
ConfigParameters) – Instance of class ConfigParametersconfig_NS (Config_NS)
- Return type:
Notes
Authors: Allan Denis
- plot(results, save=True, plot_native_model=False)[source]#
Plot the results.
- Parameters:
- Return type:
Notes
Authors: Allan Denis
- plot_ccf(rv_grid, save_fig=True, save_results=False)[source]#
Compute and optionally plot the Cross-Correlation Function (CCF).
- Parameters:
- Return type:
Notes
Authors: Bhavesh Rajpoot (adapted from Allan Denis)