Simple Spectral Access (SSA) Examples
Simple Spectral Access (SSA) service
This page details more advanced usage of the SSA service.
The examples provided below make heavy use of the pyvo, astropy, specutils and matplotlib Python modules.
The last example below shows how to use TOPCAT and SPLAT together to quickly preview spectra from SSA results.
The SSA service is particularly powerful when combined with queries to survey catalogues directly using the DataCentral API.
The Wigglez example and the interactive GALAH example below both make use of the API.
Please refer to the accompanying page:
for details on the parameters and basic usage.
Please contact us if any of the following is unclear or you require further assistance in using the SSA service.
Access from Python
The SSA service can be accessed from your own Python scripts in various ways.
This page contains some example approaches with Python 3 that may be useful.
You may copy the code from the following linked pages (you can use the Copy button at top right of each code example) or you can download them from this gitlab repository.
Many of these examples make use of the SSA capabilities of the pyvo module found. More details can be found in the data access layer documentation for pyvo.
Simple Access to the SSA service:
Advanced access using the PyVO module
The pyvo Python module offers a better interface to querying the SSA service than specifying a long query url.
The following examples demonstrate more advanced usage of the SSA service:
- Plotting Time Series OzDES Spectra
- Fitting Gaussian Emission Lines in Time Series Spectra
- 6dF Galaxy Survey Spectra and Image Cutouts from Target Names
- GAMA Survey Spectra and Image Cutouts from Multiple Sky Positions
- GALAH DR3
- GALAH DR3 Interactive Spectra Explorer enhanced by the Data Central API
- Wigglez Spectra enhanced by the Data Central API
Important: While the SSA service does not require the latest development version of the pyvo module, it is needed to use the Data Central SIA2 service. It is available from the pyvo github page.
You may need to uninstall any previous pyvo installations you have before installing the latest version.
Some technical details on specifying parameters with pyvo: Our typical usage below of SSA with pyvo involves creating a dictionary custom that contains parameters we would ordinarily pass to the SSA query URL. The custom dictionary is then passed to the pyvo SSA search function as the **keywords argument. This is a convenient and simple way to specify the parameters. Note that standard SSA parameters may be passed as normal arguments to the search function (e.g. band=...), but custom SSA parameters (e.g. BANDREST) may only be specified via **keywords. For more details see the data access layer documentation for pyvo.
Access from TOPCAT
The TOPCAT application is a versatile tool that allows for many operations to be performed on the VOTable results of the SSA service.
You can load a VOTable file saved to disk from an SSA service query or you can load the query URL directly into the Location: field of the Load New Table dialogue.
More advanced usage of TOPCAT with the SSA service is also possible: