dace-query 3.0.0 Migration Guide#
With version dace-query==3.0.0, we introduce a new backend for the Spectroscopy module, which has led to changes in the available parameters and their names.
This document provides a guide to migrating your code from previous versions of the dace-query package to version 3.0.0 and onwards.
Timeframe for migration#
First of all, we will maitain the old backend for a transition period, so that you can update your code at your own pace. During this transition period we will keep ingesting instrument data into both backends (until September 2026).
Changes in DRS Format#
New format :#
The new backend standardizes all DRS versions into the following format:
DRS-X.Y.Z-METHOD
X.Y.Z: Major, minor, and patch versions.METHOD: Name of the DRS or post-process used.
Legacy formats :#
Previously, inconsistent formats (e.g., DRS-3.5 vs DRS-3.3.10) complicated sorting and filtering. Older versions are now renamed to match the new standard:
D̶R̶S̶-̶3̶.̶5̶ → DRS-0.3.5-CCF
Usage in the API :#
Internally, version strings are split into four fields for robust sorting: drs_major, drs_minor, drs_patch, and rv_extraction_method.
You can simply pass the full string (e.g., DRS-3.3.10-CCF) or latest to the drs_version parameter. The API automatically parses it to handle the underlying filtering.
Changes in query_database()#
The query_database() method now returns a list of raw frames (observations), matching the behavior of the DACE spectroscopy database.
Unlike previous versions, which returned available points per instrument and DRS version, raw frames are now independent of the DRS. They represent a single observation of a target with a given instrument at a specific time.
Key updates:
Automatic name resolution:
target_nameis automatically resolved using SIMBAD. If resolution fails, it matches the exact target name in the raw frame’s.fitsheader.Calibration frames: These are now included by default and can be filtered using
dpr_catg='CALIB'ordpr_catg='SCIENCE'.
Example query for raw frames (observations) of HD69830 with HARPS:
from dace_query.spectroscopy import Spectroscopy
filters : dict = {
'target_name': { 'contains': ['HD69830'] },
'instrument_name': { 'contains': ['HARPS'] }
}
raw_frames = Spectroscopy.query_database(filters=filters)
These raw frames can be used to identify points in get_timeseries() or preview/download specific files via download() or browse_products().
Changes in download() functionalities#
With version 3.0.0 we have reworked the download functionalities of the Spectroscopy module to simplify the download process and make it more efficient.
The old download_files() is now deprecated in favor of :
browse_products()to preview files for a given observationdownload()to download the files of your choice
Both of these methods accept the same filters as query_database()
Handling DRS versions#
You can now specify the DRS version of the data you want to download using the new drs_version parameter
in both download() and browse_products() methods.
You may use drs_version='latest' to get reduced products from the latest DRS version available for each instrument.
Or you can specify a specific DRS version (e.g. drs_version='DRS-3.3.10').
Changes in get_timeseries()#
Radial Velocity Sources#
Use the new rv_source parameter to select data from specific processing pipelines (e.g., PUBLICATIONS, SKY_SUBTRACTED, TELLURIC_CORRECTED). By default, it returns both STANDARD_PROCESSING and PUBLICATION data.
from dace_query.spectroscopy import Spectroscopy, Source
# Access telluric corrected RVs (e.g., for NIRPS)
ts_telluric = Spectroscopy.get_timeseries(target='HD69830', rv_source=Source.TELLURIC_CORRECTED)
# Exclude publication data by asking for only standard processing
ts_standard = Spectroscopy.get_timeseries(target='HD69830', rv_source=Source.STANDARD_PROCESSING)
Handling DRS versions#
Specify the DRS version via the drs_version parameter. Use latest for the most recent standard pipeline, or an exact string. When specifying an exact version, providing an explicit instrument prevents ambiguity.
from dace_query.spectroscopy import Spectroscopy
# Latest DRS version per instrument
ts_latest = Spectroscopy.get_timeseries(target='HD69830', drs_version='latest')
# Specific DRS version
ts_specific = Spectroscopy.get_timeseries(target='HD69830', drs_version='DRS-3.3.10')
Changes in parameters#
As we introduce a new backend, the names of some parameters have changed, and some new parameters have been added. The following table summarizes the changes:
Old name |
New name |
Description |
|---|---|---|
|
|
Bisector Span of the CCF |
|
|
Uncertainty on the Bisector Span |
|
|
Drift Noise |
|
|
Full Width at Half Maximum (FWHM) of the CCF |
|
|
Uncertainty on the CCF FWHM |
|
|
Barycentric Earth Radial Velocity (BERV) |
|
|
Contrast of the CCF |
|
|
Uncertainty on the CCF Contrast |
|
|
Calcium activity index |
|
|
Uncertainty on Calcium activity index |
|
|
H Alpha activity index |
|
|
Uncertainty on H Alpha activity index |
|
|
Sodium activity index |
|
|
Uncertainty on Sodium activity index |
|
|
The name of the instrument used for the observation. Some instruments are split into versions (e.g. |
|
|
Whether the data is publicly available (If |
|
|
Signal to Noise ratio at order 20 |
|
|
Signal to Noise ratio at order 50 |
|
|
Mount Wilson S activity index |
|
|
Uncertainty on Mount Wilson S activity index |
|
|
Drift Used |
|
|
The name of the raw frame in the file system, for example |
|
|
The program code. Resolved to a |
|
|
ThAr Lamp Offset |
|
|
ThAr Lamp Offset 1 |
|
|
ThAr Lamp Offset 2 |
|
|
Replaced by separate fields (major, minor, patch, extraction method) for easier filtering and sorting. |
|
|
Used internally by DACE, Unique identifier of a given DRS version. |
|
|
Method used by the DRS for radial velocity extraction (e.g. |
|
|
Major version of the DRS software. |
|
|
Minor version of the DRS software. |
|
|
Patch version of the DRS software. |