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.

Benchmarks

The development version fit 1,000 observations in 0.81 ms for a point source and 1.64–3.04 ms for finite sources, starting from supplied parameters on one CPU core.

Benchmark results and light curves · Automatic fits and other benchmarks

Metadata

Release files for SingleLensFitter 0.2.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.2.0
File Size Uploaded Provenance Actions
singlelensfitter-0.2.0.tar.gz 2.2 MB With provenance Details for singlelensfitter-0.2.0.tar.gz

Release files / singlelensfitter-0.2.0.tar.gz

Download URL singlelensfitter-0.2.0.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
2eba4ec8bb0ee9f8ceae2d001f8891e6464890afb82805126373d30e02dee86a
BLAKE2b-256 checksum
How to use checksums
05a406c64094e4450d4b0352d69807175777f1a8836cd6c5dfeebb29514a59e4
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 27, 2026.

Transparency log

Security for SingleLensFitter 0.2.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.2.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 Nov 27, 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