physical_samples_from_chain¶
- ell1fit.eccentricity.physical_samples_from_chain(results_row, flat_chain, parameters, labels=None, strict=True)[source]¶
Turn a flattened chain into physical samples of the named parameters.
The sampler works in local coordinates: column
iof the chain holdsdA1, say, the offset from the starting value in units of that parameter’s preconditioned scale. The fit records both numbers needed to undo that,dA1_initialanddA1_factor, so that\[A1 = A1^{\mathrm{initial}} + \mathrm{d}A1 \times \mathrm{factor}.\]- Parameters:
- results_rowastropy.table.Row or dict
One row of a
*_results.ecsvtable.- flat_chainnp.ndarray
Flattened chain, shape
(nsamples, ndim), in local coordinates.- parametersiterable of str
Physical parameter names, e.g.
("A1", "EPS1", "EPS2").- labelslist of str, optional
Parameter name per column, as saved by
ell1fit.mcmc_utils.save_flat_samples(). When absent – an HDF5 chain carries no names – the columns are identified by their recorded percentiles instead.- strictbool
Whether a parameter that was not fitted is an error.
True, the default, suits a caller that needs a specific parameter and has nothing to say without it.Falsesuits one that offers a menu – the orbital summary plot asks for all five orbital parameters and draws whichever the chain actually explored. Either way, a chain that disagrees with the table about a parameter both contain still raises: that means the two files are from different fits, which is never something to skip.
- Returns:
- dict
{parameter: np.ndarray}, in the order requested, holding the physical posterior samples. Parameters skipped understrict=Falseare simply absent.