Further access options are discussed below
For a list of all services and tables belonging to this service's resource, see Information on resource 'SP_ACE spectral analysis tool'
This service's API is relatively easy to operate from user programs or scripts. The parameters available are identical to those of the interactive service except for the upload modalities. A parameter definition in a machine-readable VOTable is produced by the service itself at http://dc.zah.uni-heidelberg.de/sp_ace/q/c/api?MAXREC=0
To run the program offline, please refer to our download page
To run it, upload your radial-velocity-corrected continuum-normalised (!) spectrum (example) giving wavelengths in Angstrom vs. flux. Spectra of resolutions outside of the 2000 .. 20000 range will probably not yield reliable results.
Using curl, this would look like this:
curl -FUPLOAD=spectrum,param:up -Fup=@zw.asc\ http://dc.zah.uni-heidelberg.de/sp_ace/q/c/api
Alternative functions or programs may, of course, be used as well. Further parameters would just add more -F options (but take care to use proper shell quoting).
This will give you VOTables, which are nice if the result is going to be processed with TOPCAT or astropy or similar. To get CSV, add a RESPONSEFORMAT parameter:
curl -FUPLOAD=spectrum,param:up -Fup=@zw.asc\ -FRESPONSEFORMAT=csv\ http://dc.zah.uni-heidelberg.de/sp_ace/q/c/api
For convenient processing of multiple spectra, we recommend using Python with astropy and the requests package. The following code will print the abundances and global parameters for a spectrum in tmp/space/fast_spectrum.txt:
from cStringIO import StringIO from astropy.io.votable import parse_single_table import requests r = requests.post("http://dc.g-vo.org/sp_ace/q/c/api", data = { "UPLOAD": "spectrum,param:file", "compute_errors": "False"}, files = { "file": open("tmp/space/fast_spectrum.txt")}) t = parse_single_table(StringIO(r.content)) print t.array for p in t.params: print p.name, p.value
If you get messages about bad units, don't worry. By VOUnit, Astropy's wrong and we are right.
An additional hint: If you don't absolutely need the errors, don't make sp_ace compute them -- it's much faster without them, so that's the default. If you need errors, pass -Fcompute_errors=True.
You can access this service using:
This resource is not (directly) published. This can mean that it was deemed too unimportant, for internal use only, or is just a helper for a published service. Equally likely, however, it is under development, abandoned in development or otherwise unfinished. Exercise some caution.
Other services provided on the underlying data include:
VOResource XML (that's something exclusively for VO nerds)