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 git+https://github.com/NunotaKansuke/SingleLensFitter.git
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.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 | Provenance | Actions |
|---|---|---|---|---|
| singlelensfitter-0.1.0.tar.gz | 2.1 MB | With provenance | Details for singlelensfitter-0.1.0.tar.gz |
Release files / singlelensfitter-0.1.0.tar.gz
| Download URL | singlelensfitter-0.1.0.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
734b93bd483c82b2056ad286b124b7db764e86fb19e4883a7817a0ca519af7e6
|
|
BLAKE2b-256 checksum How to use checksums |
44b80ab3e51e7f7a1e046f3b02fdaee7ff60ea968ce43a62edea17976ea83457
|
| 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 logSecurity for SingleLensFitter 0.1.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.1.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 logA 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.