Skip to main content

ALeRCE Client

Project description

imagecodecovimage

ALeRCE Python Client

ALeRCE client is a Python library to interact with ALeRCE services and databases.

This README highlights installation, quickstart usage and migration notes for the multi-survey client (ZTF and LSST). For the full reference and tutorials, see the official documentation at https://alerce.readthedocs.io/en/latest/

Key features

  • Multi-survey support: query ZTF and LSST data through a unified client.
  • Access to objects, lightcurves (detections / non-detections / forced photometry), stamps, classifiers, crossmatches (catsHTM) and more.
  • Return formats: json (default), pandas, and votable where applicable.

Installing

Install from PyPI:

pip install alerce

Or install from source:

git clone https://github.com/alercebroker/alerce_client.git
cd alerce_client
python setup.py install

Quickstart

Basic usage with the Alerce client:

from alerce.core import Alerce
client = Alerce()

# Query objects (must specify survey for multi-survey API)
ztf_objects = client.query_objects(survey="ztf", classifier="lc_classifier", class_name="SN", probability=0.8, format="pandas")

# Query a lightcurve (detections/non-detections/forced photometry)
lightcurve = client.query_lightcurve(oid="ZTF18abbuksn", survey="ztf", format="json")

# Query detections only
detections = client.query_detections(oid="ZTF18abbuksn", survey="ztf", format="pandas")

# Get stamps for an object (first detection by default or use measurement_id)
stamps = client.get_stamps(oid="ZTF18abkifng", survey="ztf")

# Crossmatch (catsHTM conesearch)
ra, dec, radius = 10.0, 20.0, 1000  # radius in arcsec
cone = client.catshtm_conesearch(ra, dec, radius, "GAIA/DR1", format="pandas")

See the documentation for many more examples and parameters.

Multi-survey notes / Migration from ZTF-only API

The client supports multiple surveys. Most query methods now require an explicit survey parameter. Supported surveys:

  • ztf — Zwicky Transient Facility
  • lsst — Legacy Survey of Space and Time (Rubin Observatory)

Backward compatibility: many methods default to survey="ztf" when omitted, but this behavior is deprecated and will be removed in a future release. Update your code to always pass survey="ztf" or survey="lsst" explicitly.

Object ID formats differ between surveys:

  • ZTF: string IDs like "ZTF18abbuksn"
  • LSST: numeric-like IDs such as 45121627560013211

Contributing

Please read CONTRIBUTING.rst for the project's contribution guidelines.

License

This project is licensed under the terms in LICENSE.txt.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alerce-2.1.0.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alerce-2.1.0-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file alerce-2.1.0.tar.gz.

File metadata

  • Download URL: alerce-2.1.0.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for alerce-2.1.0.tar.gz
Algorithm Hash digest
SHA256 ea6d6ebe196ee8d4d97a76a8b5769d48d30a8ee4cc3a1728ce11800e47d7c4d8
MD5 7f22fd54aa80e66f8634e9eaa6833e21
BLAKE2b-256 976396a69dd5ae5bef51d21ac17a35dd7cc0069909b3714c62e64f6b805f4649

See more details on using hashes here.

File details

Details for the file alerce-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: alerce-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for alerce-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58a1dd32bbd467c0cba03c775905e429a26550f12414ba076faeed9d7981fb5b
MD5 0209d3116b920fb7ca5265d109a0e973
BLAKE2b-256 c66783fa9543a43ec4c62de23d07e86428887707667d4e3cbac1353fb0d9d31b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page