chronos package¶
Submodules¶
chronos.chronos module¶
CHRONOS.PY - Automatic isochrone fitting to photometric data
- chronos.chronos.allpars(theta, fixpars, fixparvals)[source]¶
Return values for all 4 parameters dealing with fixed parameters.
- chronos.chronos.autodetectnames(cat, grid, catnames=None, caterrnames=None, isonames=None)[source]¶
Auto-detect column names to use.
- chronos.chronos.cmdfigure(figfile, cat, catnames, iso, isonames, out, annotlabels=None, figsize=10, title=None, verbose=False)[source]¶
Make diagnostic figure.
- Parameters
- figfilestr
Output figure filename.
- catastropy table
Observed photometry table/catalog.
- catnameslist
List of column names for the observed photometry to use.
- gridIsoGrid object
Grid of isochrones.
- isonameslist
- List of column names for the isochrone photometry to compare to the observed
photometry in “catnames”.
- outtable
Catalog of best-fitting values to use for the annotations.
- annotlabelslist, optional
The list of labels to use for the annotation. Default is [‘age’,’metal’,’ext’,’distmod’].
- figsizefloat, optional
Figure size to use. Default is 10 inches.
- titlestr, optional
The figure plot title. Default is “Chronos Isochrone Fit”.
- verboseboolean, optional
Verbose output. Default is True.
- Returns
- Figure is saved to figfile.
- chronos.chronos.emcee_lnlike(theta, x, y, yerr, grid, isonames, fixpars, fixparvals)[source]¶
This helper function calculates the log likelihood for the MCMC portion of fit().
- Parameters
- thetaarray
Input parameters [age, metal, ext,distmod].
- xarray
Array of x-values for y. Not really used.
- yarray
Observed photometry array.
- yerrarray
Uncertainties in the observed photometry data.
- gridIsoGrid object
Grid of isochrones.
- isonameslist
The list of isochrone column names to use.
- fixparslist
Boolean list/array indicating if parameters are fixed or not.
- fixparvals: list
List/array of values to use for fixed parameters.
- chronos.chronos.emcee_lnprior(theta, grid)[source]¶
This helper function calculates the log prior for the MCMC portion of fit(). It’s a flat/uniform prior across the isochrone parameter space covered by the isochrone grid.
- Parameters
- thetaarray
Input parameters [age, metal, ext, distmod]. This needs to be all four.
- gridIsoGrid object
Grid of isochrones.
- chronos.chronos.emcee_lnprob(theta, x, y, yerr, grid, isonames, fixpars, fixparvals)[source]¶
This helper function calculates the log probability for the MCMC portion of fit().
- Parameters
- thetaarray
Input parameters [age, metal, ext, distmod].
- xarray
Array of x-values for y. Not really used.
- yarray
Observed photometry.
- yerrarray
Uncertainties in the observed photometry.
- gridIsoGrid object
Grid of isochrones.
- isonameslist
The list of isochrone column names to use.
- fixparslist
Boolean list/array indicating if parameters are fixed or not.
- fixparvals: list
List/array of values to use for fixed parameters.
- chronos.chronos.fit(cat, catnames=None, isonames=None, grid=None, caterrnames=None, ages=None, metals=None, extinctions=None, distmod=None, initpar=None, fixed=None, extdict=None, msteps=100, cornername=None, figfile=None, mcmc=False, reject=False, nsigrej=3.0, verbose=False)[source]¶
Automated isochrone fitting to photometric data.
- Parameters
- catastropy table
Observed photometry table/catalog.
- catnameslist
List of column names for the observed photometry to use.
- isonameslist
- List of column names for the isochrone photometry to compare to the observed
photometry in “catnames”.
- gridIsoGrid object, optional
Grid of isochrones.
- caterrnameslist, optional
List of photometric uncertainty values corresponding to the “catnames” bands.
- ageslist, optional
List of ages to use in grid search. Default is np.linspace(0.5,12.0,6)*1e9.
- metalslist, optional
List of metals to use in grid search. Default is np.linspace(-2.0,0.0,5).
- extinctionslist, optional
List of extinctions to use in grid search. Default is np.linspace(0.0,1.0,5).
- distmodlist, optional
List of distmod to use in grid search. Default is np.linspace(0,25.0,11).
- initparlist
List of initial estimates for [age, metal, ext, distmod].
- fixeddict, optional
Dictionary of fixed values to use.
- extdictdict, optional
- Dictionary of extinction coefficients to use. (A_lambda/A_V). The column
names must match the isochrone column names.
- mcmcbool, optional
Run MCMC for better uncertainty estimation. Default is False.
- rejectbool, optional
Reject outliers. Default is False.
- nsigrejfloat, optional
Outlier rejection Nsigma. Default is 3.0.
- mstepsint, optional
Number of MCMC steps. Default is 100.
- cornernamestring, optional
Filename for the corner plot.
- figfilestr, optional
Filename for the dianostic CMD plot.
- verbosebool, optional
Verbose output to the screen. Default is False.
- Returns
- outtable
Catalog of best-fitting values and uncertainties
- bestisoIsochrone object
Best-fitting isochrone.
- chronos.chronos.fit_mcmc(cat, catnames, grid, isonames, caterrnames=None, initpar=None, fixed=None, steps=100, extdict=None, cornername=None, verbose=False)[source]¶
Fit isochrone to the observed photometry using MCMC.
- Parameters
- catastropy table
Observed photometry table/catalog.
- catnameslist
List of column names for the observed photometry to use.
- gridIsoGrid object
Grid of isochrones.
- isonameslist
- List of column names for the isochrone photometry to compare to the observed
photometry in “catnames”.
- caterrnameslist, optional
List of photometric uncertainty values corresponding to the “catnames” bands.
- initparnumpy array, optional
Initial estimate for [age, metal, ext, distmod], optional.
- fixeddict, optional
Dictionary of fixed values to use.
- stepsint, optional
Number of steps to use. Default is 100.
- extdictdict, optional
Dictionary of extinction coefficients to use (A_lambda/A_V).
- cornernamestring, optional
Output filename for the corner plot. If a corner plot is requested, then the minimum number of steps used is 500.
- verbosebool, optional
Verbose output of the various steps. This is False by default.
- Returns
- outtable
Table of best-fitting values and uncertainties.
- mcisofloat
Best-fitting isochrone.
- chronos.chronos.fit_mle(cat, catnames, grid, isonames, initpar, caterrnames=None, fixed=None, verbose=False)[source]¶
Isochrone fitting using maximum likelihood estimation (MLE).
- chronos.chronos.funiso(theta, cphot, cphoterr, grid, isonames, fixpars, fixparvals, verbose=False)[source]¶
Return the function and gradient.
- chronos.chronos.gradiso(theta, cphot, cphoterr, grid, isonames, fixpars, fixparvals)[source]¶
Calculate gradient for Isochrone fits.
- chronos.chronos.gridsearch(cat, catnames, grid, isonames, caterrnames=None, ages=None, metals=None, extinctions=None, distmod=None, fixed=None, extdict=None, verbose=False)[source]¶
Grid search.
- Parameters
- catastropy table
Observed photometry table/catalog.
- catnameslist
List of column names for the observed photometry to use.
- gridIsoGrid object
Grid of isochrones.
- isonameslist
- List of column names for the isochrone photometry to compare to the observed
photometry in “catnames”.
- caterrnameslist, optional
List of photometric uncertainty values corresponding to the “catnames” bands.
- ageslist, optional
List of ages to use in grid search. Default is np.linspace(0.5,12.0,6)*1e9.
- metalslist, optional
List of metals to use in grid search. Default is np.linspace(-2.0,0.0,5).
- extinctionslist, optional
List of extinctions to use in grid search. Default is np.linspace(0.0,1.0,5).
- distmodlist, optional
List of distmod to use in grid search. Default is np.linspace(0,25.0,11).
- fixeddict, optional
Dictionary of fixed values to use.
- extdictdict, optional
- Dictionary of extinction coefficients to use. (A_lambda/A_V). The column
names must match the isochrone column names.
- verbosebool, optional
Verbose output of the various steps. This is False by default.
- Returns
- bestvalslist
List of best-fitting parameters [age, metal, ext, distmod].
- bestchisqfloat
Chi-square value for best-fit.
- chronos.chronos.hessiso(theta, cphot, cphoterr, grid, isonames, fixpars, fixparvals, diag=False)[source]¶
Calculate hessian matrix, second derivaties wrt parameters.
- chronos.chronos.isocomparison(cphot, isophot, cphoterr=None)[source]¶
Compare the isochrone to the data.