API reference#
EROTICA’s public API — a curated selection, not an exhaustive one, and the difference is stated here rather than left for a reader to discover.
This page lists 32 names: the 12 in erotica.__all__ plus 20 more drawn from
erotica.analysis.__all__, which itself exports 118. So roughly 90 public names in the
analysis layer are importable and supported but not listed on this page — among them
distance_model, fit_parallax_model, lambda_msr, half_mass_relaxation_time,
coulomb_argument_from_mass_function and identifiability_report.
Warning
An earlier version of this paragraph called these “the classes and functions re-exported at
the top level of the package (``erotica.__all__``)”. That was wrong in both directions at
once: the page lists more than erotica.__all__ contains, and far less than the
analysis layer exports. Do not read absence from this page as evidence that a name is private —
check __all__. Genuinely private names are prefixed with an underscore.
Clustering & data#
Perform HDBSCAN clustering with optional hyper-parameter search. |
|
Sklearn-compatible wrapper around |
|
Load and filter EROTICA-compatible catalogues. |
|
Wrap preprocessing steps commonly applied to EROTICA-ready tables. |
Compare one, two, or four QTable datasets to identify overlaps, missing entries, and value discrepancies by source_id. |
Analysis#
High-level helper around |
|
Stateful facade for cluster dynamical and Galactic-radius estimates. |
|
Probability-thresholded Bayesian summaries for a cluster source table. |
|
Stateful structural analysis facade for a cluster source table. |
|
Plotting facade around a cluster source table. |
|
Bayesian isochrone fitting using a MIST forward model and PyMC NUTS. |
|
Mass-assignment facade for sampled isochrones and CMD source tables. |
Reproducibility#
A result is reproducible only if you can say what code, what inputs and what randomness
produced it. build_metadata() records all three; saving a trace with
store_trace_results() writes it as a JSON sidecar automatically. See
Decision log — why the code is the way it is for what each field is for and why.
Build a reproducibility record for a result. |
|
Write |
|
Return the git commit and dirty flag for the tree containing path. |
|
Content digest and size of one input file. |
|
Installed versions of the packages that can change a number. |
|
Append summarized trace statistics and optionally write the full trace to NetCDF. |
|
Load summarized CSV results and optionally the associated NetCDF trace. |
|
Summarize all posterior variables in an ArviZ InferenceData object. |
|
Estimate posterior mode with ArviZ KDE if available, else histogram mode. |
Radial structure#
Radial-profile fitting is an unbinned inhomogeneous Poisson point process: the likelihood is
sum(log lambda(r_i)) - Lambda, with no binning step to choose and no Gaussian approximation to
break in the sparse outer bins that set R_t. King and EFF share that machinery, so
compare_radial_profiles() can put a Bayes factor between them. See
Is a King profile the right model for NGC 6383? for what the fits can and cannot identify.
Fit a King profile to stellar radii directly, without binning. |
|
Fit an EFF profile to stellar radii, without binning. |
|
Compare radial-profile families by Bayes factor. |
|
Projected King profile shape, plus an additive |
|
EFF (Elson, Fall & Freeman 1987) surface density with a background. |
|
Expected number of stars inside a circular field, in closed form. |
|
Expected detected count when completeness varies with radius. |
|
Expected count inside a circular field for the EFF profile, in closed form. |
|
Return a typed radial-density profile for a cluster source table. |
Synthetic clusters#
Validation data. Drawing from a smooth King or EFF profile begs the question when the thing being
validated is a profile fit, so fractal_cluster() generates substructure by the Goodwin &
Whitworth (2004) box-fractal construction instead.
Generate a box-fractal star cluster (Goodwin & Whitworth 2004). |
|
Measure the radial surface (or volume) density of a realization. |