brutus

brutus brutus

Distances, extinctions and stellar properties from photometry and astrometry, by evaluating every model on a grid.

What brutus does

Fit individual stars

Fit the distance, extinction and stellar properties of thousands of stars from their photometry and parallaxes, with Galactic and dust-map priors.

Quickstart
Model star clusters

Fit one age, metallicity, distance and extinction to a coeval population, with binaries and outliers.

Star clusters
Map dust in 3D

Combine the distance-extinction posteriors of many stars to measure the dust along a line of sight.

Tutorials

How it works

  1. Evaluate the likelihood of the data for every model in a grid of stellar models.

  2. For each model, fit the distance and extinction that match the data best.

  3. Weight each model by its priors: Galactic structure, dust maps, parallax and initial mass function.

  4. The posterior is the weighted mixture of all models. No sampler, no convergence checks.

How brutus works explains each step.

A first fit

from brutus.analysis import BruteForce
from brutus.core import StarGrid
from brutus.data import fetch_grids, load_models
from brutus.utils import inv_magnitude

models, labels, _ = load_models(fetch_grids(grid="mist_v9"), filters=filters)
fitter = BruteForce(StarGrid(models, labels))

flux, flux_err = inv_magnitude(mag, mag_err)  # brutus fits fluxes, not magnitudes
fitter.fit(
    data=flux, data_err=flux_err, data_mask=mask, data_labels=ids,
    parallax=parallax, parallax_err=parallax_err,  # in mas
    data_coords=coords,  # Galactic (l, b) in degrees
    save_file="results.h5",
)

The Quickstart runs this end to end and reads the results.

Citing brutus

If you use brutus, please cite Speagle et al. (2025), arXiv:2503.02227.