Skip to content

Instantly share code, notes, and snippets.

@seignovert
Created November 23, 2017 16:19
Show Gist options
  • Save seignovert/ed5b551639330fbd1f61fa681cf2bcb0 to your computer and use it in GitHub Desktop.
Save seignovert/ed5b551639330fbd1f61fa681cf2bcb0 to your computer and use it in GitHub Desktop.
[OPUS] API super powers

OPUS API and its super powers

The NASA PDS Rings Node data search tool OPUS is very useful and user-friendly to extract valuable information from the Planetary Data System (PDS) with a very nice design graphic interface to make complex query on the PDS image database.

And other very powerful tool, which is a little be hidden, is its Application programming interface, known as API. The full user guide is available here.

Here a list of example to make your own crazy queries to extract quickly the information you are seeking for!

How it works

Basically you can start with a web browser and go to:

http://tools.pds-rings.seti.org/opus/api/data.json?surfacegeometrytargetname=TITAN

Then you should get something like:

{
  "count": 100,
  "labels": [
    "Ring Observation ID",
    "Planet",
    "Intended Target Name",
    "Observed Phase Angle",
    "Observed Phase Angle 2",
    "Observation Time 1 (UTC)",
    "Observation Time 2 (UTC)"
  ],
  "order": "obs_general.time1",
  "limit": 100,
  "columns": [
    "Ring Observation ID",
    "Planet",
    "Intended Target Name",
    "Observed Phase Angle",
    "Observed Phase Angle 2",
    "Observation Time 1 (UTC)",
    "Observation Time 2 (UTC)"
  ],
  "page": [
    [
      "S_IMG_VG1_ISS_3250013_N",
      "SAT",
      "SATURN",
      14.562,
      15.114,
      "1980-08-23T12:43:45",
      "1980-08-23T12:43:46"
    ],
    [
      "S_IMG_VG1_ISS_3250015_N",
      "SAT",
      "SATURN",
      14.562,
      15.114,
      "1980-08-23T12:45:19",
      "1980-08-23T12:45:22"
    ],
    ...
  ],
  "page_no": 1}

Every requests need to start with the http://tools.pds-rings.seti.org/opus/api/, then to get some data in a json format you only need to add data.json. Some other output format are also available, such as html, zip and csv.

You query (identical to the one from the graphic user interface) just need to be add at the end after the ? sign. In this case ?surfacegeometrytargetname=TITAN to search for images where

By default, only 100 results are available par page. To increase of decrease the number of results, you just need to add the keyword limit with the new limit, for example:

http://tools.pds-rings.seti.org/opus/api/data.json?surfacegeometrytargetname=TITAN&limit=2

Getting Data

Its very simple, you just need to add adapt your research query. For example:

  • Target Name: TITAN
  • Instrument ID: Cassini ISS
  • Filter: MT3
  • Titan center resolution min: 5 km
  • Titan center resolution max: 10 km

Which will be translated in one single line as:

http://tools.pds-rings.seti.org/opus/api/data.json?instrumentid=Cassini+ISS&surfacegeometrytargetname=TITAN&FILTER=MT3&TITANcenterresolution1=5&TITANcenterresolution2=10

Format output infos

Finally, if you need specific output informations on the selected images, you need to add the keyword cols with the list of parameter you want. For example:

http://tools.pds-rings.seti.org/opus/api/data.json?instrumentid=Cassini+ISS&surfacegeometrytargetname=TITAN&FILTER=MT3&TITANcenterresolution1=5&TITANcenterresolution2=10&limit=300&cols=ringobsid,time1,TITANcenterresolution1,TITANphase1,primaryfilespec

Here:

  • ringobsid: Ring Observation ID
  • time1: Observation Time (UTC)
  • TITANcenterresolution1: Body Center Resolution
  • TITANphase1: Observed Phase Angle
  • primaryfilespec: Primary File Spec (PDS key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment