{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Python package for OPUS-Seti API (NASA-PDS Rings Node)\n", "\n", "This guide describes the `opus-seti` python package to use the API that drives [OPUS, an outer planets data search tool](http://pds-rings-tools.seti.org/opus) produced by the [NASA PDS Rings Node](http://pds-rings.seti.org/). Any search that can be performed in OPUS can also be requested as an API call. Below are several examples.\n", "\n", "A `command line intergration` (CLI) is also available, and examples can be found [here](https://nbviewer.jupyter.org/github/seignovert/python-opus-seti/blob/master/jupyter_notebooks/cli.ipynb).\n", "\n", "_(The source code of this python package can be found on [github](https://github.com/seignovert/python-opus-seti). Contributions and feedbacks are welcome.)_\n", "\n", "__IMPORTANT:__ I have no current affiliation with NASA or SETI. This package is provided _as is_, use at your own risk." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Getting data" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Number of Image/Cube found: 68173\n" ] } ], "source": [ "from opus import api\n", "\n", "## Get result count for the number of `Images` taken by the `CASSINI-VIMS`\n", "## instrument targeting `TITAN` with at least 2 pixels width/length.\n", "count = api.count(\n", " instrumentid = 'Cassini+VIMS',\n", " target = 'TITAN',\n", " COVIMSswathlength1 = 2,\n", " COVIMSswathwidth1 = 2\n", ")\n", "print('Number of Image/Cube found:', count)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "OPUS API Data objects (with 10 elements):\n", " - COVIMS_0004-2004136T030633_2004143T032556-v1463887830_1_IR\n", " - COVIMS_0004-2004136T030633_2004143T032556-v1463887830_1_VIS\n", " - COVIMS_0004-2004136T030633_2004143T032556-v1463887846_1_IR\n", " - COVIMS_0004-2004136T030633_2004143T032556-v1463887846_1_VIS\n", " - COVIMS_0004-2004136T030633_2004143T032556-v1463887879_1_IR\n", " - COVIMS_0004-2004136T030633_2004143T032556-v1463887879_1_VIS\n", " - COVIMS_0004-2004136T030633_2004143T032556-v1463887895_1_IR\n", " - COVIMS_0004-2004136T030633_2004143T032556-v1463887895_1_VIS\n", " - COVIMS_0004-2004136T030633_2004143T032556-v1463887928_1_IR\n", " - COVIMS_0004-2004136T030633_2004143T032556-v1463887928_1_VIS\n" ] } ], "source": [ "## Get the first 10 cubes (sorted by time) and retreiving: \n", "# - the intended target name\n", "# - Saturn orbit number\n", "# - the observation start time (int UTC)\n", "# - the primary file specification\n", "# - the channel (VIS/IR)\n", " \n", "cubes = api.data(\n", " instrumentid = 'Cassini+VIMS',\n", " target = 'TITAN',\n", " COVIMSswathlength1 = 2,\n", " COVIMSswathwidth1 = 2,\n", " order = 'time1',\n", " cols = 'opusid,target,revno,time1,primaryfilespec',\n", " limit = 10,\n", " page = 1\n", ")\n", "print(cubes)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__Note:__ If `limit` parameter is set to `None` the query will retreive all the cubes found." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/plain": [ "OPUS ID: COVIMS_0004-2004136T030633_2004143T032556-v1463887830_1_IR\n", " - Intended Target Name: Titan\n", " - Saturn Orbit Number: 000\n", " - Observation Start Time (UTC): 2004-05-22T03:06:38.211\n", " - Primary File Spec: COVIMS_0004/data/2004136T030633_2004143T032556/v1463887830_1.qub" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Show a single cube from the previous query:\n", "cubes['COVIMS_0004-2004136T030633_2004143T032556-v1463887830_1_IR']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Metadata" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "OPUS API Metadata Ring observation: COVIMS_0004-2004136T030633_2004143T032556-v1463887830_1_IR\n", "\n", "=> GENERAL constraints\n", " - planet: Saturn\n", " - target: Titan\n", " - targetclass: Regular Satellite\n", " - mission: Cassini\n", " - insthost: Cassini\n", " - instrument: Cassini VIMS\n", " - time1: 2004-05-22 03:06:38.211000\n", " - time2: 2004-05-22 03:06:41.934000\n", " - timesec1: 138510430.211\n", " - timesec2: 138510433.934\n", " - observationduration: 3.7229999899864197\n", " - spatialsampling: 2-D\n", " - wavelengthsampling: Yes\n", " - quantity: Reflectivity\n", " - rightasc1: 33.597013\n", " - rightasc2: 33.781802\n", " - declination1: 9.564464\n", " - declination2: 9.746636\n", " - opusid: COVIMS_0004-2004136T030633_2004143T032556-v1463887830_1_IR\n", " - ringobsid: S_CUBE_CO_VIMS_1463887830_IR\n", "\n", "=> PDS constraints\n", " - volumeid: COVIMS_0004\n", " - datasetid: CO-E/V/J/S-VIMS-2-QUBE-V1.0\n", " - productid: 1/1463887830_1\n", " - productcreationtime: 2018-04-26 16:00:00\n", " - productcreationtimesec: 578073637.0\n", " - primaryfilespec: COVIMS_0004/data/2004136T030633_2004143T032556/v1463887830_1.qub\n", "\n", "=> IMAGE constraints\n", " - duration: 0.08\n", " - greaterpixelsize: 6\n", " - lesserpixelsize: 6\n", " - levels: 4096\n", " - imagetype: Raster Scan\n", "\n", "=> WAVELENGTH constraints\n", " - wavelength1: 0.8842\n", " - wavelength2: 5.1225\n", " - waveres1: 0.01662\n", " - waveres2: 0.01662\n", " - waveno1: 1952.1717911176186\n", " - waveno2: 11309.658448314862\n", " - wavenores1: 6.3338399547827855\n", " - wavenores2: 212.583717949551\n", " - specflag: Yes\n", " - specsize: 256\n", " - polarizationtype: None\n", "\n", "=> SATURN_SURFACE_GEOMETRY constraints\n", " - SURFACEGEOsaturnsubsolarplanetographiclatitude: -29.543\n", " - SURFACEGEOsaturnsubobserverplanetographiclatitude: -19.825\n", " - SURFACEGEOsaturnsubsolarplanetocentriclatitude: -24.757\n", " - SURFACEGEOsaturnsubobserverplanetocentriclatitude: -16.348\n", " - SURFACEGEOsaturnsubsolarIAUlongitude: 42.915\n", " - SURFACEGEOsaturnsubobserverIAUlongitude: 115.068\n", " - SURFACEGEOsaturncenterdistance: 21435312.517\n", " - SURFACEGEOsaturncenterresolution: 10610.0\n", " - SURFACEGEOsaturncenterphaseangle: 67.361\n", "\n", "=> TITAN_SURFACE_GEOMETRY constraints\n", " - SURFACEGEOtitansubsolarplanetographiclatitude: -24.699\n", " - SURFACEGEOtitansubobserverplanetographiclatitude: -16.231\n", " - SURFACEGEOtitansubsolarplanetocentriclatitude: -24.699\n", " - SURFACEGEOtitansubobserverplanetocentriclatitude: -16.231\n", " - SURFACEGEOtitansubsolarIAUlongitude: 209.735\n", " - SURFACEGEOtitansubobserverIAUlongitude: 285.075\n", " - SURFACEGEOtitancenterdistance: 21722296.753\n", " - SURFACEGEOtitancenterresolution: 10753.0\n", " - SURFACEGEOtitancenterphaseangle: 70.272\n", "\n", "=> RING_GEOMETRY constraints\n", " - RINGGEOringradius1: 1155776.141\n", " - RINGGEOringradius2: 1269499.724\n", " - RINGGEOJ2000longitude1: 317.627\n", " - RINGGEOJ2000longitude2: 328.377\n", " - RINGGEOsubsolarringlong: 288.83\n", " - RINGGEOsolarhourangle1: 208.797\n", " - RINGGEOsolarhourangle2: 219.547\n", " - RINGGEOsubobserverringlong: 216.677\n", " - RINGGEOlongitudeWRTobserver1: 100.95\n", " - RINGGEOlongitudeWRTobserver2: 111.7\n", " - RINGGEOringazimuthWRTobserver1: 104.075\n", " - RINGGEOringazimuthWRTobserver2: 114.909\n", " - RINGGEOrangetoringintercept1: 21675806.237\n", " - RINGGEOringcenterdistance: 21435312.517\n", " - RINGGEOrangetoringintercept2: 21917939.068\n", " - RINGGEOresolution1: 10730.0\n", " - RINGGEOresolution2: 10849.0\n", " - RINGGEOprojectedradialresolution1: 14007.0\n", " - RINGGEOprojectedradialresolution2: 19298.0\n", " - RINGGEOphase1: 70.199\n", " - RINGGEOphase2: 70.344\n", " - RINGGEOincidence1: 65.224\n", " - RINGGEOincidence2: 65.226\n", " - RINGGEOemission1: 73.838\n", " - RINGGEOemission2: 74.022\n", " - RINGGEOnorthbasedincidence1: 114.774\n", " - RINGGEOnorthbasedincidence2: 114.776\n", " - RINGGEOnorthbasedemission1: 105.978\n", " - RINGGEOnorthbasedemission2: 106.162\n", " - RINGGEOsolarringelev1: -24.776\n", " - RINGGEOsolarringelev2: -24.774\n", " - RINGGEOobserverringelevation1: -16.162\n", " - RINGGEOobserverringelevation2: -15.978\n", " - RINGGEOringcenterphase: 67.361\n", " - RINGGEOringcenterincidence: 65.243\n", " - RINGGEOringcenteremission: 73.652\n", " - RINGGEOringcenternorthbasedincidence: 114.757\n", " - RINGGEOringcenternorthbasedemission: 106.348\n", " - RINGGEOsolarringopeningangle: -24.757\n", " - RINGGEOobserverringopeningangle: -16.348\n", " - RINGGEOedgeonradius1: 1102060.665\n", " - RINGGEOedgeonradius2: 1170445.679\n", " - RINGGEOedgeonJ2000longitude1: 303.414\n", " - RINGGEOedgeonJ2000longitude2: 303.605\n", " - RINGGEOedgeonsolarhourangle1: 194.584\n", " - RINGGEOedgeonsolarhourangle2: 194.774\n", " - RINGGEOrangetoedgeonpoint1: 21361720.688\n", " - RINGGEOrangetoedgeonpoint2: 21383145.545\n", " - RINGGEOedgeonradialresolution1: 10574.0\n", " - RINGGEOedgeonradialresolution2: 10585.0\n", " - RINGGEOedgeonaltitude1: -153111.275\n", " - RINGGEOedgeonaltitude2: -81461.096\n", "\n", "=> CASSINI_MISSION constraints\n", " - CASSINIobsname: VIMS_000TI_LIGHTC065\n", " - CASSINIactivityname: LIGHTC\n", " - CASSINImissionphasename: Approach Science\n", " - CASSINItargetcode: TI (Titan)\n", " - CASSINIrevno: 000\n", " - CASSINIrevnoint: -1\n", " - CASSINIprimeinst: VIMS\n", " - CASSINIisprime: Yes\n", " - CASSINIsequenceid: S01\n", " - CASSINIspacecraftclockcount1: 1/1463887830.223\n", " - CASSINIspacecraftclockcount2: 1/1463887834.153\n", " - CASSINIspacecraftclockcountdec1: 1463887830.8710938\n", " - CASSINIspacecraftclockcountdec2: 1463887834.5976562\n", "\n", "=> CASSINI_VIMS constraints\n", " - COVIMSchannel: IR\n", " - COVIMSvissamplingmode: Normal\n", " - COVIMSvisexposure: 480.0\n", " - COVIMSirsamplingmode: Normal\n", " - COVIMSirexposure: 80.0\n", " - COVIMSswathwidth: 6\n", " - COVIMSswathlength: 6\n", " - COVIMSspectralsumming: No\n", " - COVIMSspectralediting: No\n", " - COVIMSinstrumentmode: IMAGE\n", " - COVIMSstartracking: Off\n" ] } ], "source": [ "## Get all the metadata for a knwon `Ring Observation ID`:\n", "meta = api.metadata('COVIMS_0004-2004136T030633_2004143T032556-v1463887830_1_IR')\n", "print(meta)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/plain": [ "=> GENERAL constraints\n", " - planet: Saturn\n", " - target: Titan\n", " - targetclass: Regular Satellite\n", " - mission: Cassini\n", " - insthost: Cassini\n", " - instrument: Cassini VIMS\n", " - time1: 2004-05-22 03:06:38.211000\n", " - time2: 2004-05-22 03:06:41.934000\n", " - timesec1: 138510430.211\n", " - timesec2: 138510433.934\n", " - observationduration: 3.7229999899864197\n", " - spatialsampling: 2-D\n", " - wavelengthsampling: Yes\n", " - quantity: Reflectivity\n", " - rightasc1: 33.597013\n", " - rightasc2: 33.781802\n", " - declination1: 9.564464\n", " - declination2: 9.746636\n", " - opusid: COVIMS_0004-2004136T030633_2004143T032556-v1463887830_1_IR\n", " - ringobsid: S_CUBE_CO_VIMS_1463887830_IR" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Extract only the `General` constraints:\n", "meta['GENERAL']" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/plain": [ "datetime.datetime(2004, 5, 22, 3, 6, 38, 211000)" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Extract the starting time of the observation:\n", "meta['GENERAL']['time1']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Image previews" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/plain": [ "OPUS API Image object: COISS_2001-1459551663_1459568594-N1459551972_1" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Get image previews for a single observation (`size`: thumb, small, med, full)\n", "preview = api.image('COISS_2001-1459551663_1459568594-N1459551972_1', size='med')\n", "preview" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/plain": [ "'https://pds-rings.seti.org/holdings/previews/COISS_2xxx/COISS_2001/data/1459551663_1459568594/N1459551972_1_med.jpg'" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Get the url on the OPUS website:\n", "preview.url" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/plain": [ "'../tests/data/N1459551972_1_med.jpg'" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Download the preview:\n", "preview.download(out='../tests/data/N1459551972_1_med.jpg')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![COISS_2001-1459551663_1459568594-N1459551972_1](../tests/data/N1459551972_1_med.jpg)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "OPUS API Image objects (with 10 med images):\n", " - COISS_2008-1479919543_1480697632-N1480614021_1\n", " - COISS_2009-1488178711_1488202381-N1488190255_1\n", " - COISS_2010-1488210352_1488278467-N1488273311_4\n", " - COISS_2010-1488302267_1488638384-N1488368442_1\n", " - COISS_2010-1488302267_1488638384-N1488485562_1\n", " - COISS_2010-1488302267_1488638384-N1488551713_1\n", " - COISS_2010-1488638456_1488792254-N1488711044_1\n", " - COISS_2010-1488638456_1488792254-N1488745124_1\n", " - COISS_2010-1488792273_1488818205-N1488812400_1\n", " - COISS_2010-1488818242_1488893120-N1488826725_1\n" ] } ], "source": [ "## Get all the previews for a specic query:\n", "previews = api.images(planet='Saturn', target='pan', size='med', limit=10)\n", "print(previews)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/plain": [ "OPUS API Image object: COISS_2008-1479919543_1480697632-N1480614021_1" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Show a single image from the previous query:\n", "previews['COISS_2008-1479919543_1480697632-N1480614021_1']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Image files" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/plain": [ "OPUS API Files for observation: COISS_2001-1459551663_1459568594-N1459551972_1\n", "\n", "=> FULL-SIZE\n", " - full: https://pds-rings.seti.org/holdings/previews/COISS_2xxx/COISS_2001/data/1459551663_1459568594/N1459551972_1_full.jpg\n", "\n", "=> MEDIUM\n", " - med: https://pds-rings.seti.org/holdings/previews/COISS_2xxx/COISS_2001/data/1459551663_1459568594/N1459551972_1_med.jpg\n", "\n", "=> SMALL\n", " - small: https://pds-rings.seti.org/holdings/previews/COISS_2xxx/COISS_2001/data/1459551663_1459568594/N1459551972_1_small.jpg\n", "\n", "=> THUMBNAIL\n", " - thumb: https://pds-rings.seti.org/holdings/previews/COISS_2xxx/COISS_2001/data/1459551663_1459568594/N1459551972_1_thumb.jpg\n", "\n", "=> CALIBRATED_DATA\n", " - IMG: https://pds-rings.seti.org/holdings/calibrated/COISS_2xxx/COISS_2001/data/1459551663_1459568594/N1459551972_1_CALIB.IMG\n", " - LBL: https://pds-rings.seti.org/holdings/calibrated/COISS_2xxx/COISS_2001/data/1459551663_1459568594/N1459551972_1_CALIB.LBL\n", "\n", "=> PLANET_GEOMETRY_INDEX\n", " - TAB: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2001/COISS_2001_saturn_summary.tab\n", " - LBL: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2001/COISS_2001_saturn_summary.lbl\n", "\n", "=> RAW_DATA\n", " - IMG: https://pds-rings.seti.org/holdings/volumes/COISS_2xxx/COISS_2001/data/1459551663_1459568594/N1459551972_1.IMG\n", " - LBL: https://pds-rings.seti.org/holdings/volumes/COISS_2xxx/COISS_2001/data/1459551663_1459568594/N1459551972_1.LBL\n", " - prefix2: https://pds-rings.seti.org/holdings/volumes/COISS_2xxx/COISS_2001/label/prefix2.fmt\n", " - tlmtab: https://pds-rings.seti.org/holdings/volumes/COISS_2xxx/COISS_2001/label/tlmtab.fmt\n", "\n", "=> RING_GEOMETRY_INDEX\n", " - TAB: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2001/COISS_2001_ring_summary.tab\n", " - LBL: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2001/COISS_2001_ring_summary.lbl\n", "\n", "=> SATELLITE_GEOMETRY_INDEX\n", " - TAB: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2001/COISS_2001_moon_summary.tab\n", " - LBL: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2001/COISS_2001_moon_summary.lbl\n", "\n", "=> TARGET_BODY_INVENTORY\n", " - TAB: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2001/COISS_2001_inventory.tab\n", " - LBL: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2001/COISS_2001_inventory.lbl" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Get the files (previews, raw, calibrated data if availables) for a single observation:\n", "file = api.file('COISS_2001-1459551663_1459568594-N1459551972_1')\n", "file" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/plain": [ " - IMG: https://pds-rings.seti.org/holdings/calibrated/COISS_2xxx/COISS_2001/data/1459551663_1459568594/N1459551972_1_CALIB.IMG\n", " - LBL: https://pds-rings.seti.org/holdings/calibrated/COISS_2xxx/COISS_2001/data/1459551663_1459568594/N1459551972_1_CALIB.LBL" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# List of the calibrated images:\n", "file['CALIBRATED_DATA']" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/plain": [ "'../tests/data/N1459551972_1.LBL'" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Download the raw label file (`LBL`):\n", "file['RAW_DATA']['LBL'].download(out='../tests/data/')" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "OPUS API File objects (with 10 files):\n", " - COISS_2008-1479919543_1480697632-N1480614021_1\n", " - COISS_2009-1488178711_1488202381-N1488190255_1\n", " - COISS_2010-1488210352_1488278467-N1488273311_4\n", " - COISS_2010-1488302267_1488638384-N1488368442_1\n", " - COISS_2010-1488302267_1488638384-N1488485562_1\n", " - COISS_2010-1488302267_1488638384-N1488551713_1\n", " - COISS_2010-1488638456_1488792254-N1488711044_1\n", " - COISS_2010-1488638456_1488792254-N1488745124_1\n", " - COISS_2010-1488792273_1488818205-N1488812400_1\n", " - COISS_2010-1488818242_1488893120-N1488826725_1\n" ] } ], "source": [ "## Get all files for a search:\n", "files = api.files(planet='Saturn', target='pan', limit=10)\n", "print(files)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/plain": [ "OPUS API Files for observation: COISS_2008-1479919543_1480697632-N1480614021_1\n", "\n", "=> FULL-SIZE\n", " - full: https://pds-rings.seti.org/holdings/previews/COISS_2xxx/COISS_2008/data/1479919543_1480697632/N1480614021_1_full.jpg\n", "\n", "=> MEDIUM\n", " - med: https://pds-rings.seti.org/holdings/previews/COISS_2xxx/COISS_2008/data/1479919543_1480697632/N1480614021_1_med.jpg\n", "\n", "=> SMALL\n", " - small: https://pds-rings.seti.org/holdings/previews/COISS_2xxx/COISS_2008/data/1479919543_1480697632/N1480614021_1_small.jpg\n", "\n", "=> THUMBNAIL\n", " - thumb: https://pds-rings.seti.org/holdings/previews/COISS_2xxx/COISS_2008/data/1479919543_1480697632/N1480614021_1_thumb.jpg\n", "\n", "=> CALIBRATED_DATA\n", " - IMG: https://pds-rings.seti.org/holdings/calibrated/COISS_2xxx/COISS_2008/data/1479919543_1480697632/N1480614021_1_CALIB.IMG\n", " - LBL: https://pds-rings.seti.org/holdings/calibrated/COISS_2xxx/COISS_2008/data/1479919543_1480697632/N1480614021_1_CALIB.LBL\n", "\n", "=> PLANET_GEOMETRY_INDEX\n", " - TAB: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2008/COISS_2008_saturn_summary.tab\n", " - LBL: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2008/COISS_2008_saturn_summary.lbl\n", "\n", "=> RAW_DATA\n", " - IMG: https://pds-rings.seti.org/holdings/volumes/COISS_2xxx/COISS_2008/data/1479919543_1480697632/N1480614021_1.IMG\n", " - LBL: https://pds-rings.seti.org/holdings/volumes/COISS_2xxx/COISS_2008/data/1479919543_1480697632/N1480614021_1.LBL\n", " - prefix2: https://pds-rings.seti.org/holdings/volumes/COISS_2xxx/COISS_2008/label/prefix2.fmt\n", " - tlmtab: https://pds-rings.seti.org/holdings/volumes/COISS_2xxx/COISS_2008/label/tlmtab.fmt\n", "\n", "=> RING_GEOMETRY_INDEX\n", " - TAB: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2008/COISS_2008_ring_summary.tab\n", " - LBL: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2008/COISS_2008_ring_summary.lbl\n", "\n", "=> SATELLITE_GEOMETRY_INDEX\n", " - TAB: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2008/COISS_2008_moon_summary.tab\n", " - LBL: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2008/COISS_2008_moon_summary.lbl\n", "\n", "=> TARGET_BODY_INVENTORY\n", " - TAB: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2008/COISS_2008_inventory.tab\n", " - LBL: https://pds-rings.seti.org/holdings/metadata/COISS_2xxx/COISS_2008/COISS_2008_inventory.lbl" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Show a single image from the previous query:\n", "files['COISS_2008-1479919543_1480697632-N1480614021_1']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Getting Information about Data" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "OPUS API Multiple choice for field: `target`\n", " - Aegaeon : 1389\n", " - Albiorix : 3426\n", " - Anthe : 1684\n", " - Atlas : 1649\n", " - Bebhionn : 2204\n", " - Bergelmir : 582\n", " - Bestla : 2076\n", " - Calibration : 1073\n", " - Calypso : 1173\n", " - Daphnis : 958\n", " - Dark : 358\n", " - Dione : 17550\n", " - Dust : 176\n", " - Enceladus : 45158\n", " - Epimetheus : 2245\n", " - Erriapus : 3080\n", " - Fornjot : 951\n", " - Greip : 563\n", " - Hati : 704\n", " - Helene : 2260\n", " - Hyperion : 6495\n", " - Hyrrokkin : 1271\n", " - Iapetus : 16682\n", " - Ijiraq : 3678\n", " - Interstellar Medium : 3\n", " - Io : 70\n", " - Janus : 2977\n", " - Jarnsaxa : 82\n", " - Kari : 155\n", " - Kiviuq : 5231\n", " - Loge : 838\n", " - Methone : 1496\n", " - Mimas : 9292\n", " - Mundilfari : 106\n", " - Narvi : 511\n", " - Other : 4\n", " - Paaliaq : 3757\n", " - Pallene : 1293\n", " - Pan : 1636\n", " - Pandora : 1829\n", " - Phoebe : 3246\n", " - Pluto : 65\n", " - Polydeuces : 966\n", " - Prometheus : 4185\n", " - Rhea : 21576\n", " - S Rings : 284282\n", " - S/2004 S 12 : 145\n", " - S/2004 S 13 : 13\n", " - Saturn : 395306\n", " - Siarnaq : 1878\n", " - Skathi : 2403\n", " - Skoll : 795\n", " - Sky : 106917\n", " - Solar Wind : 19822\n", " - Star : 2760\n", " - Sun : 81137\n", " - Surtur : 491\n", " - Suttungr : 403\n", " - System : 112\n", " - Tarqeq : 3737\n", " - Tarvos : 2122\n", " - Telesto : 1224\n", " - Tethys : 14978\n", " - Thrymr : 2678\n", " - Titan : 179474\n", " - Unknown : 13478\n", " - Ymir : 1818\n" ] } ], "source": [ "## Returns all possible values for a given multiple choice field, given a search, and the result count for each value:\n", "targets = api.mults('target', planet='Saturn')\n", "print(targets)" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Number of Image/Cube found on TITAN: 179474\n" ] } ], "source": [ "# Get the count of targets on `TITAN`.\n", "print('Number of Image/Cube found on TITAN:', targets['Titan'])" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "OPUS API Range endpoints for field: `RINGGEOringradius1`\n", " - min : 90.707\n", " - max : 12900000.0\n", " - null : 125531" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Get range endpoints for a field, given a search\n", "api.range('RINGGEOringradius1', target='Saturn')" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "OPUS ID (opusid):\n", " => Category General Constraints / Slug: opusid" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Get information about a particular field\n", "api.field('opusid')" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Number of field categories available: 247\n" ] } ], "source": [ "## Get list of all fields available\n", "fields = api.fields()\n", "print('Number of field categories available:', len(fields))" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "OPUS ID (opusid):\n", " => Category General Constraints / Slug: opusid" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Global fields:\n", "fields['opusid']" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['coisscompressiontype',\n", " 'couviscompressiontype',\n", " 'gossicompressiontype',\n", " 'nhlorriinstrumentcompressiontype',\n", " 'nhmvicinstrumentcompressiontype',\n", " 'ringgeoresolution1',\n", " 'ringgeoresolution2',\n", " 'ringgeoprojectedradialresolution1',\n", " 'ringgeoprojectedradialresolution2',\n", " 'ringgeoedgeonradialresolution1',\n", " 'ringgeoedgeonradialresolution2',\n", " 'surfacegeofinestresolution1',\n", " 'surfacegeofinestresolution2',\n", " 'surfacegeocoarsestresolution1',\n", " 'surfacegeocoarsestresolution2',\n", " 'surfacegeocenterresolution',\n", " 'waveres1',\n", " 'waveres2',\n", " 'wavenores1',\n", " 'wavenores2']" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Find a field:\n", "fields.find('res')" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "OPUS API list of all categories (5):\n", " - General Constraints (obs_general)\n", " - PDS Constraints (obs_pds)\n", " - Image Constraints (obs_type_image)\n", " - Wavelength Constraints (obs_wavelength)\n", " - Ring Geometry Constraints (obs_ring_geometry)" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## List category names:\n", "api.categories()" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "OPUS API list of all categories (5):\n", " - General Constraints (obs_general)\n", " - PDS Constraints (obs_pds)\n", " - Image Constraints (obs_type_image)\n", " - Wavelength Constraints (obs_wavelength)\n", " - Ring Geometry Constraints (obs_ring_geometry)" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Get all fields categories:\n", "api.categories()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.5" } }, "nbformat": 4, "nbformat_minor": 2 }