|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "metadata": {}, |
| 6 | + "source": [ |
| 7 | + "Python package for NAIF WebGeoCalc API\n", |
| 8 | + "======================================\n", |
| 9 | + "\n", |
| 10 | + "In december 2018, [JPL/NAIF](https://naif.jpl.nasa.gov/naif/webgeocalc.html)\n", |
| 11 | + "announced an **experimental**\n", |
| 12 | + "[API RESTful interface](https://naif.jpl.nasa.gov/naif/WebGeocalc_announcement.pdf)\n", |
| 13 | + "for their new \n", |
| 14 | + "[WebGeocalc server](https://wgc2.jpl.nasa.gov:8443/webgeocalc)\n", |
| 15 | + "(which make online SPICE calculations).\n", |
| 16 | + "[Documentation](https://wgc2.jpl.nasa.gov:8443/webgeocalc/documents/api-info.html)\n", |
| 17 | + "and [JavaScript examples](https://wgc2.jpl.nasa.gov:8443/webgeocalc/example/perform-calculation.html)\n", |
| 18 | + "are already available.\n", |
| 19 | + "\n", |
| 20 | + "This package is an **early attempt** to provide a Python interface to\n", |
| 21 | + "make SPICE calculation through this API.\n", |
| 22 | + "\n", |
| 23 | + "\n", |
| 24 | + "Disclaimer\n", |
| 25 | + "----------\n", |
| 26 | + "This project is not supported or endorsed by either JPL, NAIF or NASA.\n", |
| 27 | + "The code is provided *\"as is\"*, use at your own risk." |
| 28 | + ] |
| 29 | + }, |
| 30 | + { |
| 31 | + "cell_type": "code", |
| 32 | + "execution_count": 1, |
| 33 | + "metadata": {}, |
| 34 | + "outputs": [ |
| 35 | + { |
| 36 | + "data": { |
| 37 | + "text/plain": [ |
| 38 | + "'https://wgc2.jpl.nasa.gov:8443/webgeocalc/api'" |
| 39 | + ] |
| 40 | + }, |
| 41 | + "execution_count": 1, |
| 42 | + "metadata": {}, |
| 43 | + "output_type": "execute_result" |
| 44 | + } |
| 45 | + ], |
| 46 | + "source": [ |
| 47 | + "from webgeocalc import API\n", |
| 48 | + "\n", |
| 49 | + "API.url" |
| 50 | + ] |
| 51 | + }, |
| 52 | + { |
| 53 | + "cell_type": "code", |
| 54 | + "execution_count": 2, |
| 55 | + "metadata": {}, |
| 56 | + "outputs": [ |
| 57 | + { |
| 58 | + "data": { |
| 59 | + "text/plain": [ |
| 60 | + "[<KernelSetDetails> Solar System Kernels (id: 1),\n", |
| 61 | + " <KernelSetDetails> Latest Leapseconds Kernel (id: 2),\n", |
| 62 | + " <KernelSetDetails> Latest Planetary Constants Kernel (id: 3),\n", |
| 63 | + " <KernelSetDetails> Ground Stations Kernels (id: 4),\n", |
| 64 | + " <KernelSetDetails> Cassini Huygens (id: 5),\n", |
| 65 | + " <KernelSetDetails> Clementine (id: 6),\n", |
| 66 | + " <KernelSetDetails> Dawn (id: 7),\n", |
| 67 | + " <KernelSetDetails> Deep Impact (Primary mission) (id: 8),\n", |
| 68 | + " <KernelSetDetails> Deep Impact (EPOXI mission) (id: 9),\n", |
| 69 | + " <KernelSetDetails> Deep Space 1 (id: 10),\n", |
| 70 | + " <KernelSetDetails> GRAIL (id: 11),\n", |
| 71 | + " <KernelSetDetails> Hayabusa (id: 12),\n", |
| 72 | + " <KernelSetDetails> JUNO (id: 13),\n", |
| 73 | + " <KernelSetDetails> Lunar Reconnaissance Orbiter (id: 14),\n", |
| 74 | + " <KernelSetDetails> MAVEN (id: 15),\n", |
| 75 | + " <KernelSetDetails> MER1 Rover (Opportunity) (id: 16),\n", |
| 76 | + " <KernelSetDetails> MER2 Rover (Spirit) (id: 17),\n", |
| 77 | + " <KernelSetDetails> MESSENGER (id: 18),\n", |
| 78 | + " <KernelSetDetails> Mars Express (id: 19),\n", |
| 79 | + " <KernelSetDetails> Mars Global Surveyor (id: 20),\n", |
| 80 | + " <KernelSetDetails> Mars Odyssey (id: 21),\n", |
| 81 | + " <KernelSetDetails> Mars Reconnaissance Orbiter (id: 22),\n", |
| 82 | + " <KernelSetDetails> MSL Rover (Curiosity) (id: 23),\n", |
| 83 | + " <KernelSetDetails> NEAR (id: 24),\n", |
| 84 | + " <KernelSetDetails> New Horizons (id: 25),\n", |
| 85 | + " <KernelSetDetails> OSIRIS-REx (id: 26),\n", |
| 86 | + " <KernelSetDetails> Rosetta (id: 27),\n", |
| 87 | + " <KernelSetDetails> Stardust (id: 28),\n", |
| 88 | + " <KernelSetDetails> Venus Climate Orbiter (id: 29),\n", |
| 89 | + " <KernelSetDetails> Venus Express (id: 30),\n", |
| 90 | + " <KernelSetDetails> Viking Orbiters (id: 31),\n", |
| 91 | + " <KernelSetDetails> LADEE (id: 32),\n", |
| 92 | + " <KernelSetDetails> SPICE Class -- CASSINI Remote Sensing Lesson Kernels (id: 33),\n", |
| 93 | + " <KernelSetDetails> SPICE Class -- ExoMars 2016 Remote Sensing Lesson Kernels (id: 34),\n", |
| 94 | + " <KernelSetDetails> SPICE Class -- In-situ Sensing Lesson Kernels (id: 35),\n", |
| 95 | + " <KernelSetDetails> SPICE Class -- Mars Express Geometric Event Finding Lesson Kernels (id: 36),\n", |
| 96 | + " <KernelSetDetails> SPICE Class -- ExoMars 2016 Geometric Event Finding Lesson Kernels (id: 37),\n", |
| 97 | + " <KernelSetDetails> SPICE Class -- Binary PCK Lesson Kernels (Moon) (id: 38),\n", |
| 98 | + " <KernelSetDetails> SPICE Class -- Binary PCK Lesson Kernels (Earth) (id: 39)]" |
| 99 | + ] |
| 100 | + }, |
| 101 | + "execution_count": 2, |
| 102 | + "metadata": {}, |
| 103 | + "output_type": "execute_result" |
| 104 | + } |
| 105 | + ], |
| 106 | + "source": [ |
| 107 | + "kernels = API.kernel_sets() # /kernel-sets\n", |
| 108 | + "kernels" |
| 109 | + ] |
| 110 | + }, |
| 111 | + { |
| 112 | + "cell_type": "code", |
| 113 | + "execution_count": 3, |
| 114 | + "metadata": {}, |
| 115 | + "outputs": [ |
| 116 | + { |
| 117 | + "data": { |
| 118 | + "text/plain": [ |
| 119 | + "1" |
| 120 | + ] |
| 121 | + }, |
| 122 | + "execution_count": 3, |
| 123 | + "metadata": {}, |
| 124 | + "output_type": "execute_result" |
| 125 | + } |
| 126 | + ], |
| 127 | + "source": [ |
| 128 | + "kernel = kernels[0]\n", |
| 129 | + "int(kernel) # kernelSetId" |
| 130 | + ] |
| 131 | + }, |
| 132 | + { |
| 133 | + "cell_type": "code", |
| 134 | + "execution_count": 4, |
| 135 | + "metadata": {}, |
| 136 | + "outputs": [ |
| 137 | + { |
| 138 | + "data": { |
| 139 | + "text/plain": [ |
| 140 | + "'Solar System Kernels'" |
| 141 | + ] |
| 142 | + }, |
| 143 | + "execution_count": 4, |
| 144 | + "metadata": {}, |
| 145 | + "output_type": "execute_result" |
| 146 | + } |
| 147 | + ], |
| 148 | + "source": [ |
| 149 | + "str(kernel) # Caption" |
| 150 | + ] |
| 151 | + }, |
| 152 | + { |
| 153 | + "cell_type": "code", |
| 154 | + "execution_count": 5, |
| 155 | + "metadata": {}, |
| 156 | + "outputs": [ |
| 157 | + { |
| 158 | + "data": { |
| 159 | + "text/plain": [ |
| 160 | + "'Generic kernels for planets, satellites, and some asteroids covering from 1950-01-01 to 2050-01-01.'" |
| 161 | + ] |
| 162 | + }, |
| 163 | + "execution_count": 5, |
| 164 | + "metadata": {}, |
| 165 | + "output_type": "execute_result" |
| 166 | + } |
| 167 | + ], |
| 168 | + "source": [ |
| 169 | + "kernel.description" |
| 170 | + ] |
| 171 | + }, |
| 172 | + { |
| 173 | + "cell_type": "code", |
| 174 | + "execution_count": 6, |
| 175 | + "metadata": {}, |
| 176 | + "outputs": [ |
| 177 | + { |
| 178 | + "data": { |
| 179 | + "text/plain": [ |
| 180 | + "dict_keys(['caption', 'sclkId', 'description', 'kernelSetId', 'missionId'])" |
| 181 | + ] |
| 182 | + }, |
| 183 | + "execution_count": 6, |
| 184 | + "metadata": {}, |
| 185 | + "output_type": "execute_result" |
| 186 | + } |
| 187 | + ], |
| 188 | + "source": [ |
| 189 | + "kernel.keys()" |
| 190 | + ] |
| 191 | + }, |
| 192 | + { |
| 193 | + "cell_type": "code", |
| 194 | + "execution_count": 7, |
| 195 | + "metadata": {}, |
| 196 | + "outputs": [ |
| 197 | + { |
| 198 | + "data": { |
| 199 | + "text/plain": [ |
| 200 | + "dict_values(['Solar System Kernels', '0', 'Generic kernels for planets, satellites, and some asteroids covering from 1950-01-01 to 2050-01-01.', '1', 'gen'])" |
| 201 | + ] |
| 202 | + }, |
| 203 | + "execution_count": 7, |
| 204 | + "metadata": {}, |
| 205 | + "output_type": "execute_result" |
| 206 | + } |
| 207 | + ], |
| 208 | + "source": [ |
| 209 | + "kernel.values()" |
| 210 | + ] |
| 211 | + } |
| 212 | + ], |
| 213 | + "metadata": { |
| 214 | + "kernelspec": { |
| 215 | + "display_name": "Python 3", |
| 216 | + "language": "python", |
| 217 | + "name": "python3" |
| 218 | + }, |
| 219 | + "language_info": { |
| 220 | + "codemirror_mode": { |
| 221 | + "name": "ipython", |
| 222 | + "version": 3 |
| 223 | + }, |
| 224 | + "file_extension": ".py", |
| 225 | + "mimetype": "text/x-python", |
| 226 | + "name": "python", |
| 227 | + "nbconvert_exporter": "python", |
| 228 | + "pygments_lexer": "ipython3", |
| 229 | + "version": "3.6.6" |
| 230 | + } |
| 231 | + }, |
| 232 | + "nbformat": 4, |
| 233 | + "nbformat_minor": 2 |
| 234 | +} |
0 commit comments