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.
ztfquery.sedm module provides access to data from the SED Machine (SEDM), a low-resolution integral field spectrograph mounted at the Palomar 60-inch telescope. SEDM is the primary classification instrument for ZTF transient alerts, and its reduced data — IFU cubes and extracted 1D spectra — are hosted on the Pharos archive at Caltech. SEDMQuery handles authentication, nightly index management, and file downloads, saving everything under $ZTFDATA/sedm/redux/YYYYMMDD/.
A Pharos account is required. If you are a ZTF collaboration member and do not yet have one, email Richard Walters at rsw@astro.caltech.edu to request access.
SEDMQuery Class
SEDMQuery is the primary interface for fetching SEDM data. Instantiating it loads the local Pharos index; no arguments are needed for typical use.
Constructor parameters
Constructor parameters
Load the local PharosIO index on instantiation. Set to
False only if you intend to manage the index manually.Downloading target data
Usedownload_target_data to fetch files associated with a named ZTF target. The kind argument selects the data product type.
The ZTF target identifier, e.g.
"ZTF18abqlpgq".Type of data product to retrieve. Common values:
"e3d"/"cube"— 3-D IFU data cubes (.fits)"spec"/"spectra"— extracted 1-D spectra (.fitsby default)
File extension filter. Use
"txt" to retrieve the plain-text ASCII spectrum format used by the ZTF marshal.Number of parallel download processes.
download_target_data directly and specify kind explicitly:
Retrieving local file paths
Once data has been downloaded,get_target_cubes and get_target_spectra return the local paths of matching files.
exist=True default).
What Files and the Pharos Index
Pharos maintains per-night summary files called “what files” — plain-text lists that record every target observed during a given night and its corresponding raw IFU filename.ztfquery downloads these automatically and stores them locally under $ZTFDATA/sedm/whatfiles/ as Parquet files, with a merged index kept at $ZTFDATA/sedm/whatfiles/stored_data.parquet.
First-use warning: The very first time you use the
sedm module, ztfquery downloads what files for every night since SEDM operations began (June 2018). This can take several minutes depending on your connection. All subsequent runs only fetch the dates that are missing — typically just the most recent nights.PharosIO class, which SEDMQuery wraps. You can inspect it directly if needed:
update() downloads missing what files, rebuilds the merged DataFrame, and writes the updated index back to disk.
Reading Cubes and Spectra with pysedm
ztfquery handles downloading; reading the data products requires pysedm, the dedicated SEDM data-reduction and analysis package.cube.show(interactive=True) launches an interactive viewer that lets you click on individual spaxels and inspect the corresponding spectrum.
Citation
If you use a SEDM spectrum obtained since July 2018, please cite the pysedm paper:
Rigault et al. 2019, arXiv:1902.08526.
pysedm is the pipeline responsible for all SEDM reductions from that date forward.