Getting ztfquery running involves three things: installing the package itself, setting theDocumentation 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.
$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
Install the package
Install ztfquery using pip (recommended) or by cloning the repository for the latest development version.The pip release is the stable version. Install from source only if you need unreleased features or want to contribute to development.
Set the $ZTFDATA environment variable
ztfquery saves all data it downloads from IRSA (and other services) into the directory pointed to by the After editing the file, reload your shell configuration:
$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.Verify the installation
Open a Python interpreter and confirm that ztfquery imports correctly and that the data path is resolved as expected: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:
| Service | Local 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.| Package | Minimum version | Purpose |
|---|---|---|
numpy | — | Array operations throughout the library |
pandas | — | Metadata tables and query results |
matplotlib | — | Plotting utilities |
requests | ≥ 2.28 | HTTP requests to IRSA and other services |
shapely | ≥ 2.0 | Spatial queries and field geometry |
cryptography | ≥ 39.0 | Encrypted credential storage in ~/.ztfquery |
dask | ≥ 2023.3 | Parallel and delayed file downloads |
astropy | — | FITS I/O, coordinate handling, progress bars |
ztffields | ≥ 0.4.3 | ZTF field and CCD geometry |
On Python 3.9 and earlier,
importlib_resources is also installed automatically. It is not required on Python 3.10+.