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#

core.Clustering

Perform HDBSCAN clustering with optional hyper-parameter search.

core.HDBSCANEstimator

Sklearn-compatible wrapper around hdbscan.HDBSCAN.

io.DataLoader

Load and filter EROTICA-compatible catalogues.

preprocess.DataPreprocessor

Wrap preprocessing steps commonly applied to EROTICA-ready tables.

utils.compare_datasets

Compare one, two, or four QTable datasets to identify overlaps, missing entries, and value discrepancies by source_id.

Analysis#

ClusterAnalyzer

High-level helper around Clustering and plotting utilities.

ClusterDynamicsAnalyzer

Stateful facade for cluster dynamical and Galactic-radius estimates.

ClusterInferenceAnalyzer

Probability-thresholded Bayesian summaries for a cluster source table.

ClusterStructureAnalyzer

Stateful structural analysis facade for a cluster source table.

ClusterFigureBuilder

Plotting facade around a cluster source table.

IsochroneFitter

Bayesian isochrone fitting using a MIST forward model and PyMC NUTS.

PhotometricMassEstimator

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_metadata

Build a reproducibility record for a result.

write_metadata

Write build_metadata() to path as indented JSON.

git_provenance

Return the git commit and dirty flag for the tree containing path.

file_checksum

Content digest and size of one input file.

dependency_versions

Installed versions of the packages that can change a number.

store_trace_results

Append summarized trace statistics and optionally write the full trace to NetCDF.

load_results

Load summarized CSV results and optionally the associated NetCDF trace.

summarize_trace

Summarize all posterior variables in an ArviZ InferenceData object.

posterior_mode

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.

king_unbinned

Fit a King profile to stellar radii directly, without binning.

eff_unbinned

Fit an EFF profile to stellar radii, without binning.

compare_radial_profiles

Compare radial-profile families by Bayes factor.

king_profile

Projected King profile shape, plus an additive background.

eff_surface_density

EFF (Elson, Fall & Freeman 1987) surface density with a background.

king_expected_count

Expected number of stars inside a circular field, in closed form.

king_expected_count_weighted

Expected detected count when completeness varies with radius.

eff_expected_count

Expected count inside a circular field for the EFF profile, in closed form.

radial_density_profile

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.

fractal_cluster

Generate a box-fractal star cluster (Goodwin & Whitworth 2004).

radial_profile_of

Measure the radial surface (or volume) density of a realization.