Skip to main content

saltjax

Fast, batched SALT2 lightcurve fitting with JAX, reproducing sncosmo's fit_lc.

saltjax fits SALT2 to thousands of lightcurves at once. It uses the same model as sncosmo (same interpolation kernel, model covariance and Milky Way dust), and gives the same parameters and errors (to ~1e-2 sigma at worst) one to two orders of magnitude faster.

Install

git clone https://github.com/MickaelRigault/saltjax.git
cd saltjax
pip install .

Quick start

import saltjax

# data: lightcurves, indexed by (target, observation), with columns
#       time (or mjd), band, flux, fluxerr, zp [, zpsys]
# targets: one row per target with z [, t0, x1, c, mwebv]
results = saltjax.fit_salt(data, targets, modelcov=True, progress_bar=True)
results[["t0", "x0", "x1", "c", "t0_err", "x0_err", "x1_err", "c_err"]]

saltjax is used by skysurvey through skysurvey.lcfit.fit_salt_jax(dataset).

How it reproduces sncosmo

  • Interpolation. sncosmo interpolates the SALT2 surfaces with a separable bicubic-convolution kernel. Band integration is linear, so saltjax band-integrates the surfaces at the native phase nodes and applies the same kernel in phase. This is exact.
  • Colour and dust. The colour law and the Milky Way extinction (CCM89, observer frame) are written as an exact band-mean factor times power series truncated below machine precision.
  • Redshift tables. The band integrals are tabulated on a fine redshift grid. This is the only approximation: relative flux differences are below 1e-6.
  • Model covariance. modelcov=True follows sncosmo.fit_lc. The model covariance (a diagonal plus one block per band) is inverted exactly with the Woodbury identity.
  • Errors. Errors are 2 H^-1, with H the exact Hessian of the chi2 (as Minuit HESSE).

Limitations

  • SALT2 sources only (sncosmo.SALT2Source).
  • The only effect supported is Milky Way CCM89 dust in the observer frame.
  • AB magnitude system only.
  • No parameter bounds.
  • Fixed redshift.

Metadata

Release files for saltjax 0.1.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 saltjax 0.1.0
File Size Uploaded
saltjax-0.1.0.tar.gz 25.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for saltjax 0.1.0
File Interpreter ABI Platform
saltjax-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.2 kB

Release files / saltjax-0.1.0.tar.gz

Download URL saltjax-0.1.0.tar.gz
Size 25.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4a6b599997815fa04c8bd3aca62a4ad0af460885f12dab9c0174b6540cd0cfbf
BLAKE2b-256 checksum
How to use checksums
fcb784502dc12bb9012d04286530beb13ea6dd96a9b5efdd88ffe9047998d8a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / saltjax-0.1.0-py3-none-any.whl

Download URL saltjax-0.1.0-py3-none-any.whl
Size 24.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6dca6115da432db9ec2f1dd3e7f7b1660b6c84764ddb36fac0300edcfc843123
BLAKE2b-256 checksum
How to use checksums
021ca36481385af7fcb0a5fb9bc230a06670dee8e7177f2d264e2ddb0c54084a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 This release

2 release files

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