Skip to main content

SingleLensFitter

Fit point-source (PSPL) and finite-source (FSPL) microlensing light curves directly from single-band photometry. SingleLensFitter uses magnification templates and fast Fourier transforms to find initial parameters, then refines them with Levenberg–Marquardt optimization using analytic derivatives. Both support annual and satellite parallax. Finite-source models also support linear limb darkening. SingleLensFitter began as the single-lens fitting code in jacscanomaly.

Install

Requires Python 3.10+ and a C++17 compiler with OpenMP. On macOS, set SINGLELENSFITTER_DISABLE_OPENMP=1 to build with Apple Clang.

python -m pip install SingleLensFitter

Fit a light curve

Pass one-dimensional arrays of observation times in days, fluxes, and positive one-sigma flux uncertainties.

from singlelensfitter import FSPLFitter

fit = FSPLFitter().fit(time, flux, flux_err)
print(fit.optimizer_success, dict(zip(fit.param_names, fit.params)))
print(fit.chi2, fit.fs, fit.fb)

See the API guide for point-source fits, limb darkening, parallax, and derivatives. How the fitter works describes the FFT search and optimization.

Benchmarks

On three simulated events from RMDC26 with about 7,700 observations each, seeded fits took 2.49–4.96 ms on one CPU core.

RMDC26 benchmark results and light curves

Metadata

Release files for SingleLensFitter 0.3.0

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

Source distribution (sdist)

Source distribution for SingleLensFitter 0.3.0
File Size Uploaded Provenance Actions
singlelensfitter-0.3.0.tar.gz 2.2 MB With provenance Details for singlelensfitter-0.3.0.tar.gz

Release files / singlelensfitter-0.3.0.tar.gz

Download URL singlelensfitter-0.3.0.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
d4dbd0b933eaa9abe769637525ee19ed33d483d8991e9fbfb10208a8d0d3d92d
BLAKE2b-256 checksum
How to use checksums
184c703de3d441c933532906e54705f1cd2c4db4e650843bdb55dae41a8c1fd2
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 Dec 1, 2026.

Transparency log

Security for SingleLensFitter 0.3.0

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

1 file in this release has been uploaded with provenance metadata.

Attestation for singlelensfitter-0.3.0.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 Dec 1, 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.

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