Skip to main content

3D-Barolo logo

Documentation Status License: GPL-3.0 Python: 3.11+ Language: Python

BBarolo 2 is a GPL-licensed pure-Python version of 3D-Barolo (BBarolo), the code that fits 3D tilted-ring models to emission-line datacubes to derive the kinematics of galaxies: rotation curves, velocity dispersions and the geometry of the disc. Fitting the whole datacube rather than a 2D velocity field, it is not biased by beam smearing and works on data of low spatial resolution. It ports the C++ BBarolo 1.8 and its Python wrapper pyBBarolo: the same tasks (3DFIT, GALMOD, SEARCH, 2DFIT, moment maps, PV slices, ...), the same parameter files and the same outputs, with nothing to compile. The numerical kernels are compiled at run time with numba; the rest uses numpy, scipy, astropy and matplotlib. 3DFIT has three methods: CLASSIC (BBarolo 1.x, ring by ring), GLOBAL (all the rings together, at the maximum of the likelihood) and BAYESIAN (METHOD BAYESIAN: the posterior of the ring parameters, sampled with nested sampling, nautilus included in the package). SLITFIT fits long-slit spectra, with the methods GLOBAL and BAYESIAN.

Status: BBarolo 2.0.1 (November 2026), the first release of the Python BBarolo.

Website and full documentation

You can find the documentation at bbarolo.readthedocs.io: installation, a first fit, every task with its parameters and how it works, examples, and the differences from BBarolo 1.8.

Installation

BBarolo 2 needs Python 3.11 or later. Install it from PyPI with pip:

pip install bbarolo

This installs the package bbarolo and the command BBarolo, with numpy, scipy, astropy, numba and matplotlib: everything the tasks need, the Bayesian methods included. The optional extra bayesian adds the samplers dynesty and nautilus-sampler (SAMPLER DYNESTY and NAUTILUS), corner (the corner plot) and threadpoolctl.

pip install "bbarolo[bayesian]"

Note: pip puts the command BBarolo in the bin folder of the Python environment (Scripts on Windows), which is in the PATH when a conda or virtual environment is active. With pip install --user or a system Python, pip may warn that the script "is installed in '...' which is not on PATH". Add that folder to the PATH, e.g. in ~/.bashrc or ~/.zshrc, then open a new terminal (or source ~/.bashrc):

export PATH="$HOME/.local/bin:$PATH"                  # Linux
export PATH="$HOME/Library/Python/3.12/bin:$PATH"     # macOS, with Python 3.12

or run BBarolo as python -m bbarolo -p param.par, which needs no change to the PATH. If the terminal has already run another BBarolo (e.g. the C++ 1.8), open a new one or type hash -r (rehash in zsh and tcsh); BBarolo -v shows which version runs.

The development version, from the main branch of this repository:

pip install git+https://github.com/editeodoro/bbarolo2

To work on the code, install a copy of the repository in editable mode.

git clone https://github.com/editeodoro/bbarolo2
cd bbarolo2
pip install -e ".[bayesian,test]"

Example

A 3D fit of the HI datacube of NGC 2403 (examples/ngc2403.fits, 5 MB). From the command line, with a parameter file as for the C++ BBarolo:

cd examples
BBarolo -p ngc2403_3DFIT.par

In Python, a 3D fit of the rotation curve and the velocity dispersion:

import numpy as np
from bbarolo import FitMod3D

f = FitMod3D("ngc2403.fits", radii=np.arange(15, 1200, 30), xpos=77, ypos=77, vsys=132.8,
             vrot=120, vdisp=8, z0=10, inc=60, pa=123.7, free="VROT VDISP", mask="SEARCH")
res = f.run()                     # in memory: res.rings (the fitted rings), res.model (the model cube)
res.write("output/")              # the files and plots of the command line

More examples, from radio cubes of nearby galaxies to ALMA data at high redshift, a protoplanetary disk and a long-slit spectrum, with global and Bayesian fits, are on the example pages of the documentation. Their data and parameter files are in examples/, with the notebook examples/examples.ipynb, which runs them all in Python and shows their plots.

Attribution

A paper describing BBarolo's methods and its tests has been published in the Monthly Notices of the Royal Astronomical Society. A draft of the paper is also available on arXiv. Please cite the paper if you find BBarolo helpful in your research.

@ARTICLE{2015MNRAS.451.3021D,
   author = {{Di Teodoro}, E.~M. and {Fraternali}, F.},
    title = "{$^{3D}$BAROLO: a new 3D algorithm to derive rotation curves of galaxies}",
  journal = {MNRAS},
     year = 2015,
   volume = 451,
    pages = {3021-3033},
      doi = {10.1093/mnras/stv1213}
}

3DFIT and SLITFIT with METHOD BAYESIAN sample the posterior with nautilus (Lange 2023): if you use them, please cite nautilus as well.

@article{nautilus,
    author = {Lange, Johannes U},
    title = "{nautilus: boosting Bayesian importance nested sampling with deep learning}",
    journal = {Monthly Notices of the Royal Astronomical Society},
    volume = {525},
    number = {2},
    pages = {3181-3194},
    year = {2023},
    month = {08},
    doi = {10.1093/mnras/stad2441},
    url = {https://doi.org/10.1093/mnras/stad2441},
}

License

BBarolo 2 is licensed under the GNU General Public License v3.0 or later (see LICENSE.md). It includes a modified copy of nautilus 1.0.6 (bbarolo/bayesian/nautilus), licensed under the MIT License, Copyright (c) 2022 Johannes U. Lange.

Metadata

Release files for bbarolo 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bbarolo 2.0.1
File Size Uploaded Provenance Actions
bbarolo-2.0.1.tar.gz 657.6 kB With provenance Details for bbarolo-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bbarolo 2.0.1
File Interpreter ABI Platform Actions
bbarolo-2.0.1-py3-none-any.whl Python 3 none any Details for bbarolo-2.0.1-py3-none-any.whl

Total release size: 1.2 MB

Release files / bbarolo-2.0.1.tar.gz

Download URL bbarolo-2.0.1.tar.gz
Size 657.6 kB
Tags Source
SHA-256 checksum
How to use checksums
60b84ff5e8401b2abb4837e9c3a8db158b506325927cfb94f3548530bdaf0d59
BLAKE2b-256 checksum
How to use checksums
9d01505b057d92d0360f8969cc72e7dfef789453fdebcda7fc1a91ddba00ee9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / bbarolo-2.0.1-py3-none-any.whl

Download URL bbarolo-2.0.1-py3-none-any.whl
Size 576.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2215f6cec14d69a133e30ab37fada394c915530146df18cf9a625f27c4cd7f9
BLAKE2b-256 checksum
How to use checksums
da8d3433f6106292e25387194a80bc9efa04660d1a4ec40c4c61b54089d3bfb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for bbarolo 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bbarolo-2.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page