A Python package for sampling the protostellar mass function (PMF) — the joint distribution of current and final stellar mass during star formation — under a given accretion model, plus tools for computing the resulting accretion and photospheric luminosities. The underlying class is based on the older Python2 code from Gaches & Offner (2018). It built upon the underlying Protostellar Mass Function (PMF) and Protostellar Luminosity Function (PLF) formalisms of McKee & Offner (2010) (MO10) and Offner & McKee (2011) (OM11), respectively.
The original version of the code was a monolithic Python2 script written "to work". The new version has been updated to Python3 standards and optimized for much easier use and quicker calculations.
Installation
pip install ocotillopmf
To also run the example notebooks (requires matplotlib, seaborn, jupyter):
pip install "ocotillopmf[examples]"
Quickstart
from ocotillopmf import PowerLawAccrete, PMF
# Define a tapered turbulent-core accretion model: PowerLawAccrete(j, jf, m0, deltan1)
accretion = PowerLawAccrete(0.5, 0.75, 3.6e-5, deltan1=1.0)
# Build a PMF sampler on top of it (defaults to a Chabrier 2005 IMF)
pmf = PMF(accretion)
# Sample the bivariate (current mass, final mass) distribution for N protostars
m, mf = pmf.PhiInvertSample(N=10_000)
# Instantaneous accretion rate for each sampled star, in Msun/yr
mdot = accretion.acc(m, mf)
The parameters that go into PowerLawAccrete(j, jf, m0, deltan1) define the assumed steady-state accretion model. See the MO10 and OM11 papers for details.
See examples/protoclusterGen.ipynb for a
full walkthrough, including luminosity calculations via LuminosityObject
and convergence checks on the sampler. The cluster generate was vectorized, and has been tested for clusters up to 100,000 protostars. The PMF sampler converges quickly to the analytic, as shown below.
[Caption] Left: Histogram distribution of the current protostar mass of generated clusters between 100 and 100,000 protostars. Right: Histogram distribution of the final masses. Note that they overlap since this is hard defined by a user-prescribed IMF, which is weighted then by the formation timescale.
License
BSD-3-Clause
Author
Brandt Gaches (brandt.gaches@uni-due.de)
Emmy Noether Junior Group Leader
University of Duisburg-Essen
brandt.gaches.space
Release files for ocotillopmf 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ocotillopmf-0.1.0.tar.gz | 9.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ocotillopmf-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.4 kB
Release files / ocotillopmf-0.1.0.tar.gz
| Download URL | ocotillopmf-0.1.0.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e6d3542bea662e6eef5200b7f316926b870fb4b7d6ffb45784b1524b99b5260
|
|
BLAKE2b-256 checksum How to use checksums |
cfab12f78a5cab81953bca10b4982b772068b209d338b35ec793d2a98bc37c35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
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 Sep 22, 2026.
Transparency logRelease files / ocotillopmf-0.1.0-py3-none-any.whl
| Download URL | ocotillopmf-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae3886b4e25a80dddd5ab62097ca9a7cb87ff07defa29fd13a120c4b561c1ea9
|
|
BLAKE2b-256 checksum How to use checksums |
4692961925b95aea7eb3d926ea4228c3cef2dfcfb21f1667ee33be6f9a34531e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
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 Sep 22, 2026.
Transparency log