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.

Getting ztfquery running involves three things: installing the package itself, setting the $ZTFDATA environment variable that tells ztfquery where to store downloaded data, and making sure your Python environment meets the version requirements. This page walks through each step in order.

Requirements

ztfquery requires Python 3.8 or later. All other dependencies are installed automatically when you install via pip.

Installation

1

Install the package

Install ztfquery using pip (recommended) or by cloning the repository for the latest development version.
pip install ztfquery
The pip release is the stable version. Install from source only if you need unreleased features or want to contribute to development.
2

Set the $ZTFDATA environment variable

ztfquery saves all data it downloads from IRSA (and other services) into the directory pointed to by the $ZTFDATA environment variable, mirroring the IRSA directory structure. You should add this variable to your shell startup file so it is available in every session.
If $ZTFDATA is not set, ztfquery falls back to saving files under ./Data/ relative to your current working directory. This means downloaded files will end up scattered across different locations depending on where you launch Python. Always set $ZTFDATA to a stable, dedicated directory to keep your ZTF data organised and avoid redundant downloads.
export ZTFDATA="/path/to/your/ztf/data/"
After editing the file, reload your shell configuration:
source ~/.bash_profile   # or source ~/.zshrc / source ~/.cshrc
3

Verify the installation

Open a Python interpreter and confirm that ztfquery imports correctly and that the data path is resolved as expected:
import ztfquery
from ztfquery import io

print(ztfquery.__version__)   # e.g. 1.28.0
print(io.LOCALSOURCE)         # should show your $ZTFDATA path
If io.LOCALSOURCE prints ./Data/ instead of your chosen directory, the environment variable was not picked up — check that you reloaded your shell config and that you are running the correct Python environment.

Data Directory Structure

Once $ZTFDATA is set, downloaded files are organised automatically beneath it:
ServiceLocal path
IRSA science images$ZTFDATA/sci/
IRSA raw images$ZTFDATA/raw/
IRSA calibration frames$ZTFDATA/cal/
IRSA reference images$ZTFDATA/ref/
Fritz spectra$ZTFDATA/fritz/spectra/
Fritz light curves$ZTFDATA/fritz/lightcurves/
Fritz alerts$ZTFDATA/fritz/alerts/
SEDM reduced data$ZTFDATA/sedm/redux/DATE/

Dependencies

The following packages are installed automatically by pip. You do not need to install them manually unless you are setting up a custom environment.
PackageMinimum versionPurpose
numpyArray operations throughout the library
pandasMetadata tables and query results
matplotlibPlotting utilities
requests≥ 2.28HTTP requests to IRSA and other services
shapely≥ 2.0Spatial queries and field geometry
cryptography≥ 39.0Encrypted credential storage in ~/.ztfquery
dask≥ 2023.3Parallel and delayed file downloads
astropyFITS I/O, coordinate handling, progress bars
ztffields≥ 0.4.3ZTF field and CCD geometry
On Python 3.9 and earlier, importlib_resources is also installed automatically. It is not required on Python 3.10+.

Build docs developers (and LLMs) love