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: object

ForMoSA 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 data

  • fitted (bool) – Whether the data have already been fitted for

  • logger (Logger) – Logger

  • log_level (str) – Log level of the handler, by default 'info' for all important informations.

Notes

Authors: Allan Denis

property adapted: bool#

Whether data and model are adapted.

property fitted: bool#

Whether models have been fitted to the data.

property logger: Logger#

Logger.

property config_path: ConfigPath#

ConfigLoader.

property observations: ObservationSet#

Set of observations.

property grid: ModelGrid#

ModelGrid.

property parameters: ParameterSet#

Set of parameters.

property paths: Paths#

ForMoSAPaths.

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:
Return type:

None

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:
Return type:

None

Notes

Authors: Allan Denis

plot(results, save=True, plot_native_model=False)[source]#

Plot the results.

Parameters:
  • results (NSResults) – An instance of NSResults

  • save (bool) – Whether to save the results

  • plot_native_model (bool) – Whether to plot the native model

Return type:

None

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:
  • rv_grid (ndarray) – Grid of radial velocity values (in km/s)

  • save_fig (bool) – Whether to save the figure

  • save_results (bool) – Whether to save the results of the CCF computation

Return type:

None

Notes

Authors: Bhavesh Rajpoot (adapted from Allan Denis)

plot_rv_vsini_map(rv_grid, vsini_grid, save_fig=True, save_results=False)[source]#

Compute and optionally plot the RV vs v.sin(i) loglikelihood map.

Parameters:
  • rv_grid (ndarray) – Grid of radial velocity values (in km/s)

  • vsini_grid (ndarray) – Grid of v.sin(i) values (in km/s)

  • save_fig (bool) – Whether to save the figure

  • save_results (bool) – Whether to save the results of the RV-vsini map computation

Return type:

None

Notes

Authors: Bhavesh Rajpoot (adapted from Allan Denis)