Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/MickaelRigault/ztfquery/llms.txt

Use this file to discover all available pages before exploring further.

ztfquery is a Python library maintained by M. Rigault (CNRS/IN2P3) and S. Reusch (DESY) that provides a unified interface to the Zwicky Transient Facility (ZTF) data ecosystem. Whether you need science images from IRSA, photometric light curves, spectra from Fritz or the Marshal, SEDM IFU cubes, or observing logs, ztfquery wraps the underlying web APIs so you can focus on your science.

Installation

Install ztfquery with pip and configure your environment in minutes.

Authentication

Set up credentials for IRSA, Fritz, Marshal, and Pharos securely.

Query IRSA

Search ZTF science images, raw data, and reference images via the IRSA API.

Fritz Integration

Download light curves, spectra, alerts, and source data from Fritz (SkyPortal).

What ztfquery provides

ztfquery covers the full ZTF data ecosystem through dedicated modules:

IRSA Query

Metadata queries and data download for science, raw, reference, and calibration products.

Light Curves

Retrieve IRSA epochal catalog light curves by sky position or source ID.

Fritz / SkyPortal

Access photometry, spectra, alerts, and group sources from fritz.science.

Marshal

Query the ZTF-I Growth Marshal for target tables, spectra, and light curves.

SEDM Spectroscopy

Download SEDM IFU cubes and extracted spectra from the Pharos archive.

Alerts

Load and visualise ZTF alert packets in Avro format.

Observing Logs

Access ZTF nightly observing logs via SkyVision’s CompletedLog.

Field Tools

Work with ZTF field geometry, CCD/quadrant layouts, and sky visualisation.

Get started in three steps

1

Install ztfquery

pip install ztfquery
Requires Python ≥ 3.8. See Installation for environment setup.
2

Set up credentials

On the first call to any authenticated service, ztfquery will prompt for your username and password and store them encrypted in ~/.ztfquery. You can also set them programmatically:
from ztfquery import io
io.set_account("irsa")   # also: "fritz", "marshal", "pharos"
3

Query and download data

from ztfquery import query
zquery = query.ZTFQuery()
zquery.load_metadata(radec=[276.107960, 44.130398], size=0.01,
                     sql_query="seeing<2 and obsjd>2458252.5")
zquery.download_data("sciimg.fits", show_progress=True)
If you use ztfquery in published research, please cite Rigault 2018 and include the ERC acknowledgment text described in the Introduction.

Build docs developers (and LLMs) love