Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 2.42 KB

File metadata and controls

61 lines (41 loc) · 2.42 KB

MOSFiT

Python Version PyPI version Documentation Status ascl:1710.006

MOSFiT (Modular Open-Source Fitter for Transients) is a Python 3.11+ package for fitting, sharing, and estimating the parameters of transients via user-contributed transient models. This is MOSFiT 2.0. Data for a transient can be provided by the user in a wide range of formats (JSON, ASCII tables, CDS, LaTeX).

See CHANGELOG.md for unreleased work and versioned notes.

Installation

Development installs use uv and Python 3.11+:

git clone https://github.com/guillochon/MOSFiT.git
cd MOSFiT
uv sync

Then run MOSFiT with uv run mosfit ..., or activate .venv.

Published installs are also available via conda and pip. conda-forge will ship 2.0 after a feedstock update (see recipe/); astrocats >= 0.5.0 must land on conda-forge first:

conda install -c conda-forge mosfit

or:

pip install mosfit

MPI support (mpi4py) is optional and needs a system MPI library:

uv sync --extra mpi

The SESN SEDONA emulator (sesn_sedona) needs PyTorch. Install that extra with:

uv sync --extra sedona

or, for a published install, pip install 'mosfit[sedona]'. Default models do not require it.

Using MOSFiT

The default sampler is nested sampling with dynesty. Pass local catalog JSON (or ASCII) with -e. Use --max-cores for local process-pool parallelism (no MPI required):

mosfit -e ./my_transient.json -m slsn --max-cores 10
mosfit -e mosfit/tests/PS1-10jh.json -m tde --max-cores 10 -R

Switch to ensemble MCMC with -D ensembler, or UltraNest with -D ultranest. Fits write products under products/ (including walkers.h5, and optionally chain.h5 if run with -c). For detailed instructions, see the documentation on RTD: https://mosfit.readthedocs.io/