Spectra Web Services

GET /api/v0.1/spectra/([a-zA-Z0-9_]+)/plot/?

Handler for DataDelivery Bokeh queries.

Get curated Spectra plots for particular exoplanet

This web method uses the archive webservice to request curated spectra for a given exoplanet.

Parameters:
  • exoplanet (string) – Exoplanet name or id
  • embed (bool) – This flag tells the request render a html page or return components to embed
Returns:

Bokeh spectra plots or JSON with plots and information

Example request:

GET /api/v0.1/spectra/HAT-P-11%20b/plot/?embed HTTP/1.1
Host: exo.mast.stsci.edu

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript

{
  "resources": {"js": ..., "css": ...},
  "dvplots": {
    "script": script,
    "divs": [plotdiv1,plotdiv2,],
    "filenames": filenames,
    "bibcodes": bibcodes
  }
}
Status Codes:
GET /api/v0.1/spectra/([0-9A-Za-z.-% ]+)/filelist/?

Get the list of Spectra datafiles

This web method pulls a list of available datafiles for a given planet. The user may then call the /file/ method to retrieve the data.

Parameters:
  • planet_name (string) – Name or ID of the planet to get the file list for
Returns:

text/plain list of filenames with newlines in between

Example request:

GET /api/v0.1/spectra/WASP-101b/filelist/ HTTP/1.1
Host: exo.mast.stsci.edu

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/json

{"filenames": ["WASP-101b_transmission_Wakeford2017.txt"]}
statuscode 200:no error
statuscode 404:planet not found
statuscode 501:unknown error while fetching file list
GET /api/v0.1/spectra/([0-9A-Za-z.-_ ]+)/file/([0-9A-Za-z.-_ ]+)/?

Get the Spectra datafile

This web method pulls a States datafile off of the filesystem and retrieves it for the caller. This is used in the UI when a user wants to retrieve the source data for one of our spectra plots.

Parameters:
  • filename (string) – States data filename
Returns:

text/plain file with the data

Example request:

GET /api/v0.1/spectra/WASP-101b/file/WASP-101b_transmission_Wakeford2017.txt HTTP/1.1
Host: exo.mast.stsci.edu

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/plain

...
statuscode 200:no error
statuscode 501:unknown error while fetching state file