Skip to main content

SingleLensFitter

Fit single-band gravitational microlensing light curves with a point lens and either a point source (PSPL) or a finite source (FSPL). Both fitters 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)

How the fit works

For a point source, an FFT template search finds starting values for the peak time, Einstein time, and impact parameter. For a finite source, the fitter uses the observed peak width to try combinations of source radius (rho) and scaled impact parameter (u0/rho), and ranks these starting points by chi-square.

The fitter refines multiple starting points by weighted least squares using model derivatives. At each step it solves for the source and blend fluxes analytically.

See the API guide for point-source fits, limb darkening, parallax, and derivatives.

Metadata

Release files for SingleLensFitter 0.1.2

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.1.2
File Size Uploaded Provenance Actions
singlelensfitter-0.1.2.tar.gz 2.1 MB With provenance Details for singlelensfitter-0.1.2.tar.gz

Release files / singlelensfitter-0.1.2.tar.gz

Download URL singlelensfitter-0.1.2.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
76f72bd3de3808822e3ea63dcd92b143879280be9fd3b13c7741b2cf77f3e1c1
BLAKE2b-256 checksum
How to use checksums
d1abf1991111898666e51e87964387ba21fe7cb845216ae994376adb636a5c5f
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.1.2

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.1.2.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