Accessing spectra through the user interface (Datalink protocol) and from the command line
The Datalink is an IVOA protocol that specifies a service container which can represent or accommodate a variety of services as well as free self-described protocol services.
The support of the Datalink feature in the Euclid archive system is an independent service providing spectra serialization service although it is expected to be extended in the future in order to provide additional services.
See the Datalink specification.
DataLink interface to access 1D Spectra
Please, note that this service is restricted to authenticated users. It follows the same authentication mechanism than in the rest of the archive, so a user already registered through the web interface will no longer need to login again to access this service. However, if a user is not yet logged in the system before, it will require to use its credentials to access this specific service.
From SAS the Datalink service can be used to access and download 1D Spectra data. This service is public and can also be accessed through the main interface of the archive, where a dedicated column datalink_url in the results table, contains the direct access to the content available through Datalink services associated to the individual resource (ID).
In order to retrieve 1D Spectra thorough the UI, we need to open the UI, then go to the tap "ADQL Form" and then introduce our query, for example:
select * from sascat_sc8.mer_final_cat_sc8
where object_id =
'2417660845403252054'
The previous query returns only 1 result. In the job description, the last icon on the right shows two interlocked links, representing associated data indexed by the DataLink protocol.
The following pop-up appears after clicking on it:
Now we need to fill out some of the values of the form:
Select the column id "object_id" in the drop-down menu "IDs Column"
Select the name of the release from the drop-down menu "Data Release"
Click now in "Show Data". A new icon should appear indicating how many spectra files are available for the current search
Click on this icon to start the download of the product.
Access to spectra using the command line
List of steps to follow:
Login into the sas-dd service.
(Optional, only if you don't have a list of source identifiers) Query a list of sources Ids with TAP following the help page describing how to query TAP through command line.
Execute DataLink request with the previous list of source identifiers. The output will be a VO table with a set of links for the individual spectra.
Follow the spectra download links retrieved in the previous step.
To download the spectra first a login to sas-dd service is required (first command below). The Datalink interface described before shows a column Job with the Job identifier. To request all the spectra found in a given job execute the second curl command below (with the adequate job identifier). This is not necessary if you already know the list of source identifiers. With the individual links to the specific products just use the third command below to download the individual spectra for each source. Once finished, the user can log out.
curl -k -c cookies.txt -X POST -d username=USER -d password=PASSWORD -L
"https://eas.esac.esa.int/sas-dd/login"
curl -k -b cookies.txt
'https://eas.esac.esa.int/sas-dd/datalink/links?RETRIEVAL_TYPE=ALL&ID=job:1652720430609TO.object_id&FORMAT=VOTABLE&USE_ZIP_ALWAYS=true&RELEASE=sedm_sc8'
--output out.txt
// Then follow the individual links from the previous query, for each data release + object_id, for instance
curl -k -b cookies.txt
'https://eas.esac.esa.int/sas-dd/data?ID=sedm_sc8+2417660845403252054&RETRIEVAL_TYPE=SPECTRA'
--output
2417660845403252054
.fits
curl -k -b cookies.txt -X POST -d -L
"https://eas.esac.esa.int/sas-dd/logout"
Parameter |
Description |
Mandatory |
Possible values |
ID |
The identifier of the source to be cutouted, or a list of them |
YE |
<data-release>+<source-id> |
RETRIEVAL_TYPE |
Type of the target data |
YES |
SPECTRA |
DATA_STRUCTURE |
Allows to download several spectra in individual files, instead of combining all in the same fits file |
NO |
individual |
When downloading spectra, several objects can be selected at once with the ID parameter, separating each of them by a comma, but they should all belong to the same data release. The data release is also the schema name that appears on the ADQL Form tab, in the left panel, and always starts with 'sedm_'. The default output will be all the spectra combined in the same fits file. The DATA_STRUCTURE=individual parameter can be used to separate each of them in individual fits files. In this case the output will be always a zip file.