TorusImaging#

TorusImaging is a Python package that implements Orbital Torus Imaging (OTI), a flexible framework for foliating projections of phase space with orbits and modeling stellar label data. This can be used in data-driven studies of dynamics to infer the mass distribution for the Milky Way without requiring a global model for the Milky Way or detailed modeling of the selection function of the input survey data. For example, see Horta et al. 2024 for a set of applications to data, and Price-Whelan et al. 2024 for a detailed description of the method.


mmm donut

Tutorials#

API#

torusimaging Package#

Classes#

TorusImaging1D(label_func, e_funcs[, ...])

A flexible and customizable interface for fitting and MCMC sampling an Orbital Torus Imaging model.

TorusImaging1DSpline(label_knots, e_knots, ...)

A version of the TorusImaging1D model that uses splines to model the label function and the Fourier coefficient \(e_m\) functions.


torusimaging.data Module#

Utilities for working with kinematic and stellar label data.

Functions#

get_binned_counts(pos, vel, bins[, units])

Bin the data in pixels of phase-space coordinates (pos, vel) and return the number of stars (counts) and log-number of stars (label).

get_binned_label(pos, vel, label, bins[, ...])

Bin the data in pixels of phase-space coordinates (pos, vel) and return the mean (or other moment) of the label values in each pixel.


torusimaging.plot Module#

Utilities for plotting torusimaging models and data.

Functions#

plot_data_models_residual(binned_data, ...)

Make a 4 panel figure showing data (number counts of stars in z-vz), initial model, fitted model, and residual of the fitted model

plot_spline_functions(model, params)

Plot the spline functions used in a TorusImaging1DSpline model.