{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "**Previous:** Use [WebGeoCalc API](api.ipynb)\n", "\n", "---\n", "\n", "# Make a calculation\n", "\n", "__See:__ [Documentation](https://webgeocalc.readthedocs.io/en/stable/calculation.html) for more details on [optional arguments setup](https://webgeocalc.readthedocs.io/en/stable/calculation.html#inputs-examples-and-payloads) and [job submission](https://webgeocalc.readthedocs.io/en/stable/calculation.html#submit-payload-and-retrieve-results)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Generic calculation\n", "Webgeocalc calculation: ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#generic-calculation))" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation submit] Phase: LOADING_KERNELS (id: 1618ab17-dd1b-40e2-8a02-5ce205c4a7cc)\n", "[Calculation update] Phase: LOADING_KERNELS (id: 1618ab17-dd1b-40e2-8a02-5ce205c4a7cc)\n", "[Calculation update] Phase: COMPLETE (id: 1618ab17-dd1b-40e2-8a02-5ce205c4a7cc)\n" ] }, { "data": { "text/plain": [ "{'DATE': '2012-10-19 08:24:00.000000 UTC',\n", " 'LONGITUDE': 46.18900522,\n", " 'LATITUDE': 21.26337134,\n", " 'ALTITUDE': 694259.8921163,\n", " 'D_LONGITUDE_DT': 0.00888655,\n", " 'D_LATITUDE_DT': -0.00031533,\n", " 'D_ALTITUDE_DT': 4.77080305,\n", " 'SPEED': 109.34997994,\n", " 'TIME_AT_TARGET': '2012-10-19 08:24:00.000000 UTC',\n", " 'LIGHT_TIME': 2.51438831}" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import Calculation\n", "\n", "Calculation(\n", " kernels = 5,\n", " times = '2012-10-19T08:24:00.000',\n", " calculation_type = 'STATE_VECTOR',\n", " target = 'CASSINI',\n", " observer = 'SATURN',\n", " reference_frame = 'IAU_SATURN',\n", " aberration_correction = 'NONE',\n", " state_representation = 'PLANETOGRAPHIC',\n", ").run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By default, if no `api` option is provided, the query is sent to the `WGC_URL` API (if set in the global environment variables) or `JPL` API (if not).\n", "To query on the ESA WGC API, you need to add the `ESA` key to the any `Calculation` parameters:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation submit] Phase: COMPLETE (id: b1c189c8-2824-43a8-a682-24613d6e6dae)\n" ] }, { "data": { "text/plain": [ "{'DATE': '2014-01-01 01:23:45.000000 UTC',\n", " 'LONGITUDE': -4.5904441,\n", " 'LATITUDE': -39.43153956,\n", " 'RADIUS': 10514625.76042228,\n", " 'D_LONGITUDE_DT': -0.00806197,\n", " 'D_LATITUDE_DT': 7.01746089e-08,\n", " 'D_RADIUS_DT': -0.813433,\n", " 'SPEED': 1142.73632133,\n", " 'TIME_AT_TARGET': '2014-01-01 01:23:45.000000 UTC',\n", " 'LIGHT_TIME': 35.07301628}" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Calculation(\n", " api = 'ESA',\n", " kernels = 13,\n", " times = '2014-01-01T01:23:45.000',\n", " calculation_type = 'STATE_VECTOR',\n", " target = '67P/CHURYUMOV-GERASIMENKO (1969 R1)',\n", " observer = 'ROSETTA ORBITER',\n", " reference_frame = '67P/C-G_CK',\n", " aberration_correction = 'NONE',\n", " state_representation = 'LATITUDINAL',\n", ").run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To query a 3-rd party API, you can either set `WGC_URL` on your system to use it a your main entry point (as mention before), or you can provide directly its `url` to the `api` parameter." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ " https://wgc.obspm.fr/webgeocalc/api" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Calculation(\n", " api = 'https://wgc.obspm.fr/webgeocalc/api',\n", " kernels = 6,\n", " times = '2014-01-01T01:23:45.000',\n", " calculation_type = 'STATE_VECTOR',\n", " target = '67P/CHURYUMOV-GERASIMENKO (1969 R1)',\n", " observer = 'ROSETTA ORBITER',\n", " reference_frame = '67P/C-G_CK',\n", " aberration_correction = 'NONE',\n", " state_representation = 'LATITUDINAL',\n", ").api" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Alternatively, the user can also create a custom `Api` object and use it directly:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ " https://wgc.obspm.fr/webgeocalc/api" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import Api\n", "\n", "obs_api = Api('https://wgc.obspm.fr/webgeocalc/api')\n", "\n", "Calculation(\n", " api = obs_api,\n", " kernels = 6,\n", " times = '2014-01-01T01:23:45.000',\n", " calculation_type = 'STATE_VECTOR',\n", " target = '67P/CHURYUMOV-GERASIMENKO (1969 R1)',\n", " observer = 'ROSETTA ORBITER',\n", " reference_frame = '67P/C-G_CK',\n", " aberration_correction = 'NONE',\n", " state_representation = 'LATITUDINAL',\n", ").api" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In each cases, every new API is cached to improve the kernels loading performances." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## State Vector\n", "\n", "Calculates the position of one body relative to another, calculated in a desired reference frame: ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#state-vector))" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation submit] Phase: COMPLETE (id: 026506ff-340c-407d-bdd6-3fc6db7b156e)\n" ] }, { "data": { "text/plain": [ "{'DATE': '2012-10-19 09:00:00.000000 UTC',\n", " 'DISTANCE': 764142.65053372,\n", " 'SPEED': 111.54765158,\n", " 'X': 298293.06093747,\n", " 'Y': -651606.39373107,\n", " 'Z': 265225.08895284,\n", " 'D_X_DT': -98.80322113,\n", " 'D_Y_DT': -51.73215012,\n", " 'D_Z_DT': -2.14166057,\n", " 'TIME_AT_TARGET': '2012-10-19 08:59:57.451094 UTC',\n", " 'LIGHT_TIME': 2.54890552}" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import StateVector\n", "\n", "StateVector(\n", " kernels = 5,\n", " times = '2012-10-19T09:00:00',\n", " target = 'CASSINI',\n", " observer = 'SATURN',\n", " reference_frame = 'IAU_SATURN',\n", ").run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Angular Separation\n", "\n", "Calculates the angular separation of `TWO_TARGETS` as seen by an observer body: ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#angular-separation))" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation submit] Phase: COMPLETE (id: 18cc2eeb-8f89-40f4-bf58-6557fcf1108e)\n" ] }, { "data": { "text/plain": [ "{'DATE': '2012-10-19 08:24:00.000000 UTC', 'ANGULAR_SEPARATION': 175.17072258}" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import AngularSeparation\n", "\n", "AngularSeparation(\n", " kernel_paths = ['pds/wgc/kernels/lsk/naif0012.tls', 'pds/wgc/kernels/spk/de430.bsp'],\n", " times = '2012-10-19T08:24:00.000',\n", " target_1 = 'VENUS',\n", " target_2 = 'MERCURY',\n", " observer = 'SUN',\n", ").run()" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "Calculates the angular separation of `TWO_DIRECTIONS`: ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#angular-separation)) " ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "ExecuteTime": { "end_time": "2025-03-04T13:28:44.424317Z", "start_time": "2025-03-04T13:28:42.241069Z" }, "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation submit] Phase: COMPLETE (id: 9528a534-a5de-45f4-ae14-d2de0bf5ec55)\n" ] }, { "data": { "text/plain": [ "{'DATE': '2012-10-19 08:24:00.000000 UTC', 'ANGULAR_SEPARATION': 90.10114616}" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import AngularSeparation\n", "\n", "AngularSeparation(\n", " spec_type = 'TWO_DIRECTIONS',\n", " kernels = 5,\n", " times = '2012-10-19T08:24:00.000',\n", " direction_1 = {\n", " \"direction_type\": \"VECTOR\",\n", " \"direction_vector_type\": \"REFERENCE_FRAME_AXIS\",\n", " \"direction_frame\": \"CASSINI_RPWS_EDIPOLE\",\n", " \"direction_frame_axis\": \"Z\"\n", " },\n", " direction_2 = {\n", " \"direction_type\": \"POSITION\",\n", " \"target\": \"SUN\",\n", " \"shape\": \"POINT\",\n", " \"observer\": \"CASSINI\"\n", " },\n", ").run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Angular Size\n", "\n", "Calculates the angular size of a target as seen by an observer: ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#state-size))" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation submit] Phase: COMPLETE (id: 1da914a8-7e61-43a1-9137-7b362cf1d269)\n" ] }, { "data": { "text/plain": [ "{'DATE': '2012-10-19 08:24:00.000000 UTC', 'ANGULAR_SIZE': 0.03032491}" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import AngularSize\n", "\n", "AngularSize(\n", " kernels = 5,\n", " times = '2012-10-19T08:24:00.000',\n", " target = 'ENCELADUS',\n", " observer = 'CASSINI',\n", " aberration_correction = 'CN+S',\n", ").run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Frame Transformation\n", "\n", "Calculate the transformation from one reference frame (Frame 1) to another reference frame (Frame 2): ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#frame-transformation))" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation submit] Phase: COMPLETE (id: 047d013a-75c3-4a0a-aab9-1f0f4c9a159f)\n" ] }, { "data": { "text/plain": [ "{'DATE': '2012-10-19 08:24:00.000000 UTC',\n", " 'ANGLE3': -19.59511576,\n", " 'ANGLE2': -0.00533619,\n", " 'ANGLE1': -0.00345332,\n", " 'AV_X': -2.8406831e-07,\n", " 'AV_Y': 1.83751477e-07,\n", " 'AV_Z': -0.00633942,\n", " 'AV_MAG': 0.00633942}" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import FrameTransformation\n", "\n", "FrameTransformation(\n", " kernels = 5,\n", " times = '2012-10-19T08:24:00.000',\n", " frame_1 = 'IAU_SATURN',\n", " frame_2 = 'IAU_ENCELADUS',\n", " aberration_correction = 'NONE',\n", ").run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Illumination Angles\n", "\n", "Calculate the emission, phase and solar incidence angles at a point on a target as seen from an observer: ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#illumination-angles))" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation submit] Phase: COMPLETE (id: bad25967-14c7-4a2e-87f0-d5607e39ac2c)\n" ] }, { "data": { "text/plain": [ "{'DATE': '2012-10-19 08:24:00.000000 UTC',\n", " 'INCIDENCE_ANGLE': 25.51886414,\n", " 'EMISSION_ANGLE': 26.31058362,\n", " 'PHASE_ANGLE': 1.00106425,\n", " 'OBSERVER_ALTITUDE': 967670.28784259,\n", " 'TIME_AT_POINT': '2012-10-19 08:23:56.772199 UTC',\n", " 'LIGHT_TIME': 3.22780064,\n", " 'LTST': '13:19:56'}" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import IlluminationAngles\n", "\n", "IlluminationAngles(\n", " kernels = 5,\n", " times = '2012-10-19T08:24:00.000',\n", " target = 'ENCELADUS',\n", " target_frame = 'IAU_ENCELADUS',\n", " observer = 'CASSINI',\n", " aberration_correction = 'CN+S',\n", " latitude = 0.0,\n", " longitude = 0.0,\n", ").run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Phase Angle\n", "\n", "Calculate the phase angle defined by the centers of an illumination source, a target and an observer: ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#phase-angle))" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation submit] Phase: COMPLETE (id: 8019634b-98c2-4216-8a2a-3294b00d2197)\n" ] }, { "data": { "text/plain": [ "{'DATE': '2012-10-19 08:24:00.000000 UTC', 'PHASE_ANGLE': 0.99571442}" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import PhaseAngle\n", "\n", "PhaseAngle(\n", " kernels = 5,\n", " times = '2012-10-19T08:24:00.000',\n", " target = 'ENCELADUS',\n", " observer = 'CASSINI',\n", " illuminator = 'SUN',\n", " aberration_correction = 'CN+S',\n", ").run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Pointing Direction\n", "\n", "Calculates the pointing direction in a user specified reference frame and output it as a unit or full magnitude vector represented in a user specified coordinate system: ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#pointing-direction))" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation update] Phase: COMPLETE (id: e966681b-5433-4814-b494-e42a6b2a1391)\n" ] }, { "data": { "text/plain": [ "{'DATE': ['2012-10-19 08:24:00.000000 UTC',\n", " '2012-10-19 08:24:00.000000 UTC',\n", " '2012-10-19 08:24:00.000000 UTC',\n", " '2012-10-19 08:24:00.000000 UTC'],\n", " 'BOUNDARY_POINT_NUMBER': [1.0, 2.0, 3.0, 4.0],\n", " 'RIGHT_ASCENSION': [209.67659835, 209.39258312, 209.60578464, 209.88990474],\n", " 'DECLINATION': [-9.57807208, -9.78811104, -10.06810257, -9.85788588],\n", " 'RANGE': [1.0, 1.0, 1.0, 1.0]}" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import PointingDirection\n", "\n", "PointingDirection(\n", " kernels = 5,\n", " times = '2012-10-19T08:24:00.000',\n", " direction = {\n", " 'direction_type': 'VECTOR',\n", " 'observer': 'Cassini',\n", " 'direction_vector_type': 'INSTRUMENT_FOV_BOUNDARY_VECTORS',\n", " 'direction_instrument': 'CASSINI_ISS_NAC',\n", " 'aberration_correction': 'CN',\n", " },\n", " reference_frame='J2000',\n", " coordinate_representation='RA_DEC',\n", ").run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Sub Solar Point\n", "\n", "Calculates the sub-solar point on a target as seen from an observer: ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#sub-solar-point))" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation submit] Phase: COMPLETE (id: 62023c10-3bef-4736-bdf9-92b50fabc5c1)\n" ] }, { "data": { "text/plain": [ "{'DATE': '2012-10-19 08:24:00.000000 UTC',\n", " 'X': 232.15437562,\n", " 'Y': -81.18742303,\n", " 'Z': 67.66010394,\n", " 'SUB_POINT_RADIUS': 255.07830453,\n", " 'OBSERVER_ALTITUDE': 967644.95641522,\n", " 'INCIDENCE_ANGLE': 1.10177646e-14,\n", " 'EMISSION_ANGLE': 0.99615507,\n", " 'PHASE_ANGLE': 0.99615507,\n", " 'TIME_AT_POINT': '2012-10-19 08:23:56.772284 UTC',\n", " 'LIGHT_TIME': 3.22771614}" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import SubSolarPoint\n", "\n", "SubSolarPoint(\n", " kernels = 5,\n", " times = '2012-10-19T08:24:00.000',\n", " target = 'ENCELADUS',\n", " target_frame = 'IAU_ENCELADUS',\n", " observer = 'CASSINI',\n", " aberration_correction = 'CN+S',\n", ").run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Sub Observer Point\n", "\n", "Calculate the sub-observer point on a target as seen from an observer: ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#sub-observer-point))" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation submit] Phase: COMPLETE (id: 42d674e1-c5aa-4fc7-9d87-27af8a54efa4)\n" ] }, { "data": { "text/plain": [ "{'DATE': '2012-10-19 08:24:00.000000 UTC',\n", " 'X': 230.66149425,\n", " 'Y': -85.24005493,\n", " 'Z': 67.58656174,\n", " 'SUB_POINT_RADIUS': 255.02653827,\n", " 'OBSERVER_ALTITUDE': 967644.91882136,\n", " 'INCIDENCE_ANGLE': 0.99589948,\n", " 'EMISSION_ANGLE': 3.94425842e-12,\n", " 'PHASE_ANGLE': 0.99589948,\n", " 'TIME_AT_POINT': '2012-10-19 08:23:56.772284 UTC',\n", " 'LIGHT_TIME': 3.22771602,\n", " 'LTST': '11:58:49'}" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import SubObserverPoint\n", "\n", "SubObserverPoint(\n", " kernels = 5,\n", " times = '2012-10-19T08:24:00.000',\n", " target = 'ENCELADUS',\n", " target_frame = 'IAU_ENCELADUS',\n", " observer = 'CASSINI',\n", " aberration_correction = 'CN+S',\n", ").run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Surface Intercept Point\n", "\n", "Calculate the intercept point of a vector or vectors on a target as seen from an observer: ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#surface-intercept-point))" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation submit] Phase: COMPLETE (id: 3a05e143-20f5-44a1-b63b-371db60aa702)\n" ] }, { "data": { "text/plain": [ "{'DATE': '2012-10-14 00:00:00.000000 UTC',\n", " 'LONGITUDE': 98.76797447,\n", " 'LATITUDE': -38.69300277,\n", " 'INTERCEPT_RADIUS': 57739.67660691,\n", " 'OBSERVER_ALTITUDE': 1831047.98047459,\n", " 'INCIDENCE_ANGLE': 123.05303919,\n", " 'EMISSION_ANGLE': 5.8595724,\n", " 'PHASE_ANGLE': 123.7753032,\n", " 'TIME_AT_POINT': '2012-10-14 00:00:00.000000 UTC',\n", " 'LIGHT_TIME': 6.10771863,\n", " 'LTST': '20:03:06'}" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import SurfaceInterceptPoint\n", "\n", "SurfaceInterceptPoint(\n", " kernels = 5,\n", " times = '2012-10-14T00:00:00',\n", " target = 'SATURN',\n", " target_frame = 'IAU_SATURN',\n", " observer = 'CASSINI',\n", " direction_vector_type = 'INSTRUMENT_BORESIGHT',\n", " direction_instrument = 'CASSINI_ISS_NAC',\n", " aberration_correction = 'NONE',\n", " state_representation = 'LATITUDINAL',\n", ").run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Tangent Point\n", "\n", "Calculate the tangent point for a given observer, ray emanating from the observer, and target: ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#tangent-point))" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation submit] Phase: COMPLETE (id: fec58854-edee-4eed-aa7e-767a9eb43fed)\n" ] }, { "data": { "text/plain": [ "{'DATE': '2010-11-30 14:02:00.000000 UTC',\n", " 'TANGENT_POINT_GEOMETRY': 'Ray above limb',\n", " 'TANGENT_POINT_X': -9.48919159,\n", " 'TANGENT_POINT_Y': 36.16728915,\n", " 'TANGENT_POINT_Z': -330.78398864,\n", " 'SURFACE_POINT_X': -7.19366254,\n", " 'SURFACE_POINT_Y': 27.15497998,\n", " 'SURFACE_POINT_Z': -247.12357543,\n", " 'DISTANCE_TO_TANGENT_POINT': 49830.33175196,\n", " 'TANGENT_POINT_ALTITUDE': 84.17574418,\n", " 'INCIDENCE_ANGLE': 97.72660812,\n", " 'EMISSION_ANGLE': 90.0185557,\n", " 'PHASE_ANGLE': 14.11694399,\n", " 'TIME_AT_POINT': '2010-11-30 14:01:59.833784 UTC',\n", " 'LIGHT_TIME': 0.1662161,\n", " 'LTST': '05:38:33'}" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import TangentPoint\n", "\n", "TangentPoint(\n", " kernels = 5,\n", " times = '2010-11-30T14:02:00',\n", " computation_method = 'ELLIPSOID',\n", " target = 'ENCELADUS',\n", " target_frame = 'IAU_ENCELADUS',\n", " observer = 'CASSINI',\n", " direction_vector_type = 'INSTRUMENT_BORESIGHT',\n", " direction_instrument = 'CASSINI_UVIS_HSP',\n", " aberration_correction = 'CN+S',\n", " correction_locus = 'TANGENT_POINT',\n", " coordinate_representation = 'RECTANGULAR',\n", ").run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Osculating Elements\n", "\n", "Calculate the osculating elements of the orbit of a target body around a central body.\n", "The orbit may be elliptical, parabolic, or hyperbolic: ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#osculating-elements))" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation update] Phase: COMPLETE (id: 9d7686a6-4f73-4853-ab4f-1ed887f924ce)\n" ] }, { "data": { "text/plain": [ "{'DATE': '2012-10-19 08:24:00.000000 UTC',\n", " 'PERIFOCAL_DISTANCE': 474789.01814487,\n", " 'ECCENTRICITY': 0.70348464,\n", " 'INCLINATION': 38.18736036,\n", " 'ASCENDING_NODE_LONGITUDE': 223.98121958,\n", " 'ARGUMENT_OF_PERIAPSE': 71.59475294,\n", " 'MEAN_ANOMALY_AT_EPOCH': 14.65461277,\n", " 'ORBITING_BODY_RANGE': 753794.66333655,\n", " 'ORBITING_BODY_SPEED': 8.77222221,\n", " 'PERIOD': 2067101.1993984,\n", " 'CENTER_BODY_GM': 37931207.49865224}" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import OsculatingElements\n", "\n", "OsculatingElements(\n", " kernels = [1,5],\n", " times = '2012-10-19T08:24:00.000',\n", " orbiting_body = 'CASSINI',\n", " center_body = 'SATURN',\n", ").run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Time Conversion\n", "\n", "Convert times from one time system or format to another: ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#time-conversion))" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation submit] Phase: COMPLETE (id: a6bc5edc-b5a2-456f-817a-b5f65acaeae4)\n" ] }, { "data": { "text/plain": [ "{'DATE': '1/1729329441.004', 'DATE2': '2012-10-19 08:24:02.919085 UTC'}" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import TimeConversion\n", "\n", "TimeConversion(\n", " kernels = 5,\n", " times = '1/1729329441.04',\n", " time_system = 'SPACECRAFT_CLOCK',\n", " time_format = 'SPACECRAFT_CLOCK_STRING',\n", " sclk_id = -82,\n", ").run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Geometry Finder Coordinate Search\n", "\n", "Find time intervals when a coordinate of an observer-target position vector satisfies a condition: ([docs](https://webgeocalc.readthedocs.io/en/stable/calculation.html#geometry-finder-coordinate-search))" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Calculation submit] Phase: COMPLETE (id: 2b2b4806-13cb-43ea-882b-40e46f517722)\n" ] }, { "data": { "text/plain": [ "{'DATE': '2012-10-19 08:39:33.814938 UTC', 'DURATION': 3394.11539114}" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from webgeocalc import GFCoordinateSearch\n", "\n", "GFCoordinateSearch(\n", " kernels = 5,\n", " intervals = ['2012-10-19T07:00:00', '2012-10-19T09:00:00'],\n", " observer = 'CASSINI',\n", " target = 'ENCELADUS',\n", " reference_frame = 'CASSINI_ISS_NAC',\n", " time_step = 1,\n", " time_step_units = 'MINUTES',\n", " aberration_correction = 'NONE',\n", " interval_adjustment = 'EXPAND_INTERVALS',\n", " interval_adjustment_amount = 1,\n", " interval_adjustment_units = 'SECONDS',\n", " interval_filtering = 'FILTER_INTERVALS',\n", " interval_filtering_threshold = 1,\n", " interval_filtering_threshold_units = 'MINUTES',\n", " coordinate_system = 'SPHERICAL',\n", " coordinate = 'COLATITUDE',\n", " relational_condition = '<',\n", " reference_value = 0.25,\n", ").run()" ] }, { "cell_type": "markdown", "metadata": { "vscode": { "languageId": "sql" } }, "source": [ "## Other Geometry Finder Searches\n", "\n", "At the moment, the following geometry finder search calculation are not implemented:\n", "- `GFAngularSeparationSearch`\n", "- `GFDistanceSearch`\n", "- `GFSubPointSearch`\n", "- `GFOccultationSearch`\n", "- `GFSurfaceInterceptPointSearch`\n", "- `GFTargetInInstrumentFovSearch`\n", "- `GFRayInFovSearch`\n", "- `GFRangeRateSearch`\n", "- `GFPhaseAngleSearch`\n", "- `GFIlluminationAnglesSearch`\n", "\n", "You might be able to run some of them with a regular `Calculation` object but is not tested yet.\n", "If you want to implement them, contributions are always welcome (don't forget to submit a merge request on the [main project](https://github.com/seignovert/python-webgeocalc))." ] } ], "metadata": { "kernelspec": { "display_name": "venv", "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.13.1" } }, "nbformat": 4, "nbformat_minor": 2 }