SIAP only has very few standard parameters (e.g., no time constraints), and even SSAP’s rich parameter set is insufficient for, e.g., theoretical spectra.
SIAP and SSAP services can define custom parameters. Discover them using a FORMAT=METADATA URL parameter.
The input parameters are given as VOTable params in the root VOTable RESOURCE, where their names are prefixed with INPUT:. You can figure out names, units, descriptions, and, if the service operators do a good job, even hints as to what you should pass in when you want to get data back.
PyVO doesn’t yet have some API that would properly hide this (not terribly pretty) implementation detail. Worse, it’s not totally trivial to get these PARAMs with astronomer-level PyVO.
To make amends, this course comes with a script viewparams.py that has a function and a UI to retrieve metadata. To see how an example works, try
python viewparams.py "http://dc.g-vo.org/bgds/q/sia/siap.xml?"
Pass custom parameters as keyword arguments to search:
svc.search((107, -10), (0.1, 0.1), dateObs="57050/58050", bandpassId="SDSS i'")
The attached script siapextra.py that lets you look at this in practice uses extra trickery we’ve not seen yet to avoid downloading entire datasets. This is using a standard called datalink that we’ll look at later.
Syntax trouble: Old-style VO services (parameters usually declared as char[*] or double) write intervals with slashes.
New-style (SIAv2, datalink...) have interval xtypes and type double[2]. Their intervals are written with a blank.
We’re sorry about this, but not all standards work out well on the first attempt. In defence of the early standards authors that came up with the wretched slash syntax: There was prior un-art for this from the geospatial community.
(1)
There is a spectral service with the access URL
http://dc.g-vo.org/theossa/q/ssa/ssap.xml?
It houses theoretical spectra mostly of hot, compact stars (think central stars of planetary nebula or perhaps young white dwarfs).
Start from trivialsiap.py to write a little script querying the service.
Inspect its custom parameters using the attached viewparams.py script and see if you can retrieve three spectra for stars with log˙g (if you don’t know what that is: viewparams.py will tell you) between 4.5 and 5.5, an effective temperature between 7 ×104 and 105 Kelvin, and a Nitrogen mass fraction (that that’s in “dex” – decadic logarithm of ratio to the solar value – goes without saying for people in the field; the metadata could explain that better, yes) larger than 0.015 (write +Inf for “no upper limit”).
Use TOPCAT to convince yourself that you actually retrieved spectra.
Hint: Remember dal.ssa.SSAService.
Hint: To stop at three spectra, enumerate is a nifty thing.
Hint: Due to SSA breakage, this service will return each spectrum as both text and VOTable. To retrieve each spectrum just once (and in VOTable), pass FORMAT=’VOTable’ to search.