Estimate#

The main use of stelpar is to estimate stellar parameters using an Estimate instance.

class stelpar.Estimate(target, isochrone='mag', interp_method='true', include_params=None, use_synphot=False, zero_extinction=False, walker_init_tol=1000, meas_phot_kwargs=None, pool=None)[source]#

Automates the data gathering and mcmc simulation to estimate the fit parameters.

Parameters:
  • target (str or Target object) – The target whose parameters are estimated via MCMC simulation.

  • isochrone (str, optional) – If ‘mag’, uses the isochrone that incorporates the effects of magnetic fields (better for young stars). If ‘std’, uses the standard, non-magnetic isochrone. The default is ‘mag’.

  • interp_method (str, optional) – If ‘true’, uses the standard interpolation method of DFInterpolator. If ‘nearest’ uses nearest-neighbor interpolation. If ‘hybrid’ uses nearest-neighbor interpolation for age and DFInterpolator for mass. The default is ‘true’.

  • include_params (list, optional) – Which parameters (stellar and/or free parameters) to include in the final output. Fewer parameters may decrease runtime. if zero_extinction=True, extinction will not be included even if it is listed here. If None, all parameters will be included. The default is None.

  • use_synphot (bool, optional) – Use the built-in synphot methods to calculate extinction or calculate extinction with numpy arrays which is faster. The default is False.

  • zero_extinction (bool, optional) – If True, set extinction to zero (Av=0). The default is False.

  • walker_init_tol (int, optional) – How many attempts should be made to initialize the walker positions before the simulation starts? The deault is 1000.

  • meas_phot_kwargs (dict, optional) – Keyword arguments to pass to :class: stelpar.MeasuredPhotometry. The default is None.

  • pool (multiprocessing.Pool() object or similar, optional.) – This only allows passing a user-controlled pool. Stelpar will try to parallelize regardless. The default is None.

Methods

posterior(sampler[, thin, discard, ...])

Calculates full posterior distributions for the fit parameters and others, including radius, Teff, and density.

run(nwalkers, nsteps[, progress, verbose, ...])

Wrapper for stelpar.MCMC.run which runs MCMC simulation using emcee.

run(nwalkers, nsteps, progress=True, verbose=True, backend=None)[source]#

Wrapper for stelpar.MCMC.run which runs MCMC simulation using emcee.

Parameters:
  • nwalkers (int) – The number of independent walkers in the simulation chain.

  • nsteps (int) – The number of iterations of the simulation.

  • progress (bool, optional) – If True, provides a progress bar during the sumulation. The default is True.

  • verbose (bool, optional) – If True, outputs the current status of the simulation. The defauls is True.

  • backend (emcee.backends.HDFBackend, optional) – Backend to save progress of MCMC. See https://emcee.readthedocs.io/en/stable/tutorials/monitor/ for more information. The default is None.

Returns:

sampleremcee.EnsembleSampler object containing all estimated values and metadata from the simulation.

Return type:

EnsembleSampler

posterior(sampler, thin=1, discard=0, max_prob=False, force_true_interp=False, verbose=True)[source]#

Calculates full posterior distributions for the fit parameters and others, including radius, Teff, and density. Interpolates estimated magnitudes from age and mass obtained from fit. See https://emcee.readthedocs.io/en/stable/tutorials/line/ for more general information.

Parameters:
  • sampler (EnsembleSampler) – emcee.EnsembleSampler object containing all estimated values and metadata from the simulation.

  • thin (int, optional) – Use every thin values of the posterior. The defualt is 1.

  • discard (int, optional) – Remove (burnin) the first discard elements from the posterior. The defult is 0.

  • max_prob (bool, optional) – Whether to calculate maximum-probability parameters. This can be computationally expensive. The default is False.

  • force_true_interp (bool, optional) – If True, the non-fit chains are interpolated using the ‘true’ interpolation method. If False (default), uses the same interpolation method as the MCMC simulation.

  • verbose (bool, optional) – If True, uses print statements to indicate the current status of the simulation. The defauls is True.

Returns:

  • posterior (stelpar.metadata.MetaDataFrame) – The estimated fit parameters and other stellar parameters, including uncertainties.

  • photometry (stelpar.metadata.MetaDataFrame) – The measured and estimated magnitudes and other photometric data.

  • posterior_chains (stelpar.metadata.MetaDataFrame) – The flattened lists of estimated or interpolated values of each parameter (including non-fit parameters) at every step of the simulation (i.e., the posterior distributions).