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.
Development installs use uv and Python 3.11+:
git clone https://github.com/guillochon/MOSFiT.git
cd MOSFiT
uv syncThen 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 mosfitor:
pip install mosfitMPI support (mpi4py) is optional and needs a system MPI library:
uv sync --extra mpiThe SESN SEDONA emulator (sesn_sedona) needs PyTorch. Install that extra with:
uv sync --extra sedonaor, for a published install, pip install 'mosfit[sedona]'. Default models do not require it.
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 -RSwitch 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/
