Previous: Use WebGeoCalc API
See: Documentation for more details on optional arguments setup and job submission.
from webgeocalc import Calculation
Calculation(
kernels = 5,
times = '2012-10-19T08:24:00.000',
calculation_type = 'STATE_VECTOR',
target = 'CASSINI',
observer = 'SATURN',
reference_frame = 'IAU_SATURN',
aberration_correction = 'NONE',
state_representation = 'PLANETOGRAPHIC',
).run()
[Calculation submit] Phase: LOADING_KERNELS (id: 1618ab17-dd1b-40e2-8a02-5ce205c4a7cc) [Calculation update] Phase: LOADING_KERNELS (id: 1618ab17-dd1b-40e2-8a02-5ce205c4a7cc) [Calculation update] Phase: COMPLETE (id: 1618ab17-dd1b-40e2-8a02-5ce205c4a7cc)
{'DATE': '2012-10-19 08:24:00.000000 UTC', 'LONGITUDE': 46.18900522, 'LATITUDE': 21.26337134, 'ALTITUDE': 694259.8921163, 'D_LONGITUDE_DT': 0.00888655, 'D_LATITUDE_DT': -0.00031533, 'D_ALTITUDE_DT': 4.77080305, 'SPEED': 109.34997994, 'TIME_AT_TARGET': '2012-10-19 08:24:00.000000 UTC', 'LIGHT_TIME': 2.51438831}
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).
To query on the ESA WGC API, you need to add the ESA
key to the any Calculation
parameters:
Calculation(
api = 'ESA',
kernels = 6,
times = '2014-01-01T01:23:45.000',
calculation_type = 'STATE_VECTOR',
target = '67P/CHURYUMOV-GERASIMENKO (1969 R1)',
observer = 'ROSETTA ORBITER',
reference_frame = '67P/C-G_CK',
aberration_correction = 'NONE',
state_representation = 'LATITUDINAL',
).run()
[Calculation submit] Phase: COMPLETE (id: b1c189c8-2824-43a8-a682-24613d6e6dae)
{'DATE': '2014-01-01 01:23:45.000000 UTC', 'LONGITUDE': -4.5904441, 'LATITUDE': -39.43153956, 'RADIUS': 10514625.76042228, 'D_LONGITUDE_DT': -0.00806197, 'D_LATITUDE_DT': 7.01746089e-08, 'D_RADIUS_DT': -0.813433, 'SPEED': 1142.73632133, 'TIME_AT_TARGET': '2014-01-01 01:23:45.000000 UTC', 'LIGHT_TIME': 35.07301628}
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.
Calculation(
api = 'https://wgc.obspm.fr/webgeocalc/api',
kernels = 6,
times = '2014-01-01T01:23:45.000',
calculation_type = 'STATE_VECTOR',
target = '67P/CHURYUMOV-GERASIMENKO (1969 R1)',
observer = 'ROSETTA ORBITER',
reference_frame = '67P/C-G_CK',
aberration_correction = 'NONE',
state_representation = 'LATITUDINAL',
).api
<Api> https://wgc.obspm.fr/webgeocalc/api
Alternatively, the user can also create a custom Api
object and use it directly:
from webgeocalc import Api
obs_api = Api('https://wgc.obspm.fr/webgeocalc/api')
Calculation(
api = obs_api,
kernels = 6,
times = '2014-01-01T01:23:45.000',
calculation_type = 'STATE_VECTOR',
target = '67P/CHURYUMOV-GERASIMENKO (1969 R1)',
observer = 'ROSETTA ORBITER',
reference_frame = '67P/C-G_CK',
aberration_correction = 'NONE',
state_representation = 'LATITUDINAL',
).api
<Api> https://wgc.obspm.fr/webgeocalc/api
In each cases, every new API is cached to improve the kernels loading performances.
from webgeocalc import StateVector
StateVector(
kernels = 5,
times = '2012-10-19T09:00:00',
target = 'CASSINI',
observer = 'SATURN',
reference_frame = 'IAU_SATURN',
).run()
[Calculation submit] Phase: COMPLETE (id: 5f85a881-cd76-4cdc-8291-85eb25a92e3e)
{'DATE': '2012-10-19 09:00:00.000000 UTC', 'DISTANCE': 764142.63776247, 'SPEED': 111.54765899, 'X': 298292.85744169, 'Y': -651606.58468976, 'Z': 265224.81187627, 'D_X_DT': -98.8032491, 'D_Y_DT': -51.73211296, 'D_Z_DT': -2.1416539, 'TIME_AT_TARGET': '2012-10-19 08:59:57.451094 UTC', 'LIGHT_TIME': 2.54890548}
from webgeocalc import AngularSeparation
AngularSeparation(
kernel_paths = ['pds/wgc/kernels/lsk/naif0012.tls', 'pds/wgc/kernels/spk/de430.bsp'],
times = '2012-10-19T08:24:00.000',
target_1 = 'VENUS',
target_2 = 'MERCURY',
observer = 'SUN',
).run()
[Calculation submit] Phase: COMPLETE (id: d2f28b90-f6de-47d4-b69c-8603e5e090d0)
{'DATE': '2012-10-19 08:24:00.000000 UTC', 'ANGULAR_SEPARATION': 175.17072258}
from webgeocalc import AngularSize
AngularSize(
kernels = 5,
times = '2012-10-19T08:24:00.000',
target = 'ENCELADUS',
observer = 'CASSINI',
aberration_correction = 'CN+S',
).run()
[Calculation submit] Phase: COMPLETE (id: 810fd7c7-635d-45d6-828c-ef24e8942524)
{'DATE': '2012-10-19 08:24:00.000000 UTC', 'ANGULAR_SIZE': 0.03037939}
from webgeocalc import FrameTransformation
FrameTransformation(
kernels = 5,
times = '2012-10-19T08:24:00.000',
frame_1 = 'IAU_SATURN',
frame_2 = 'IAU_ENCELADUS',
aberration_correction = 'NONE',
).run()
[Calculation submit] Phase: COMPLETE (id: f81aac7c-01d2-4347-97e2-e8934ade1001)
{'DATE': '2012-10-19 08:24:00.000000 UTC', 'ANGLE3': -20.58940104, 'ANGLE2': 0.01874004, 'ANGLE1': 0.00136319, 'AV_X': 9.94596495e-07, 'AV_Y': -7.23492228e-08, 'AV_Z': -0.00634331, 'AV_MAG': 0.00634331}
from webgeocalc import IlluminationAngles
IlluminationAngles(
kernels = 5,
times = '2012-10-19T08:24:00.000',
target = 'ENCELADUS',
target_frame = 'IAU_ENCELADUS',
observer = 'CASSINI',
aberration_correction = 'CN+S',
latitude = 0.0,
longitude = 0.0,
).run()
[Calculation submit] Phase: COMPLETE (id: a8546482-10c0-43d2-b07c-75ac1132a220)
{'DATE': '2012-10-19 08:24:00.000000 UTC', 'INCIDENCE_ANGLE': 24.78527742, 'EMISSION_ANGLE': 25.56007298, 'PHASE_ANGLE': 1.00079007, 'OBSERVER_ALTITUDE': 967668.02765637, 'TIME_AT_POINT': '2012-10-19 08:23:56.772207 UTC', 'LIGHT_TIME': 3.2277931, 'LTST': '13:15:59'}
from webgeocalc import SubSolarPoint
SubSolarPoint(
kernels = 5,
times = '2012-10-19T08:24:00.000',
target = 'ENCELADUS',
target_frame = 'IAU_ENCELADUS',
observer = 'CASSINI',
aberration_correction = 'CN+S',
).run()
[Calculation submit] Phase: COMPLETE (id: 47d473f2-77b9-4fe3-8388-d1c7d54b2e25)
{'DATE': '2012-10-19 08:24:00.000000 UTC', 'X': 234.00550655, 'Y': -77.32612213, 'Z': 67.42916937, 'SUB_POINT_RADIUS': 255.50851089, 'OBSERVER_ALTITUDE': 967644.15493281, 'INCIDENCE_ANGLE': 4.49798357e-15, 'EMISSION_ANGLE': 0.99611862, 'PHASE_ANGLE': 0.99611862, 'TIME_AT_POINT': '2012-10-19 08:23:56.772287 UTC', 'LIGHT_TIME': 3.22771347}
from webgeocalc import SubObserverPoint
SubObserverPoint(
kernels = 5,
times = '2012-10-19T08:24:00.000',
target = 'ENCELADUS',
target_frame = 'IAU_ENCELADUS',
observer = 'CASSINI',
aberration_correction = 'CN+S',
).run()
[Calculation submit] Phase: COMPLETE (id: 07e5f27e-7372-4eb7-8405-55bcc6015d10)
{'DATE': '2012-10-19 08:24:00.000000 UTC', 'X': 232.5831733, 'Y': -81.40386728, 'Z': 67.35505213, 'SUB_POINT_RADIUS': 255.45689491, 'OBSERVER_ALTITUDE': 967644.11734179, 'INCIDENCE_ANGLE': 0.99586304, 'EMISSION_ANGLE': 1.66981544e-12, 'PHASE_ANGLE': 0.99586304, 'TIME_AT_POINT': '2012-10-19 08:23:56.772287 UTC', 'LIGHT_TIME': 3.22771334, 'LTST': '11:58:49'}
from webgeocalc import SurfaceInterceptPoint
SurfaceInterceptPoint(
kernels = 5,
times = '2012-10-14T00:00:00',
target = 'SATURN',
target_frame = 'IAU_SATURN',
observer = 'CASSINI',
direction_vector_type = 'INSTRUMENT_BORESIGHT',
direction_instrument = 'CASSINI_ISS_NAC',
aberration_correction = 'NONE',
state_representation = 'LATITUDINAL',
).run()
[Calculation submit] Phase: COMPLETE (id: 5d9566ac-652a-4aa7-b118-42c4dff55285)
{'DATE': '2012-10-14 00:00:00.000000 UTC', 'LONGITUDE': 98.7675609, 'LATITUDE': -38.69027976, 'INTERCEPT_RADIUS': 57739.95803153, 'OBSERVER_ALTITUDE': 1831047.67987589, 'INCIDENCE_ANGLE': 123.05323675, 'EMISSION_ANGLE': 5.8567773, 'PHASE_ANGLE': 123.77530312, 'TIME_AT_POINT': '2012-10-14 00:00:00.000000 UTC', 'LIGHT_TIME': 6.10771763, 'LTST': '20:03:06'}
from webgeocalc import OsculatingElements
OsculatingElements(
kernels = [1,5],
times = '2012-10-19T08:24:00.000',
orbiting_body = 'CASSINI',
center_body = 'SATURN',
).run()
[Calculation submit] Phase: COMPLETE (id: 883bdd2d-3b7c-4aa2-b91e-f787ee69945f)
{'DATE': '2012-10-19 08:24:00.000000 UTC', 'PERIFOCAL_DISTANCE': 474789.03917271, 'ECCENTRICITY': 0.70348463, 'INCLINATION': 38.18727034, 'ASCENDING_NODE_LONGITUDE': 223.98123058, 'ARGUMENT_OF_PERIAPSE': 71.59474487, 'MEAN_ANOMALY_AT_EPOCH': 14.65461204, 'ORBITING_BODY_RANGE': 753794.65101401, 'ORBITING_BODY_SPEED': 8.77222231, 'PERIOD': 2067101.2236748, 'CENTER_BODY_GM': 37931207.49865224}
from webgeocalc import TimeConversion
TimeConversion(
kernels = 5,
times = '1/1729329441.04',
time_system = 'SPACECRAFT_CLOCK',
time_format = 'SPACECRAFT_CLOCK_STRING',
sclk_id = -82,
).run()
[Calculation submit] Phase: COMPLETE (id: 0ec03563-002b-4225-9218-6dbc4ff80e8d)
{'DATE': '1/1729329441.004', 'DATE2': '2012-10-19 08:24:02.919085 UTC'}
from webgeocalc import GFCoordinateSearch
GFCoordinateSearch(
kernels = 5,
intervals = ['2012-10-19T07:00:00', '2012-10-19T09:00:00'],
observer = 'CASSINI',
target = 'ENCELADUS',
reference_frame = 'CASSINI_ISS_NAC',
time_step = 1,
time_step_units = 'MINUTES',
aberration_correction = 'NONE',
interval_adjustment = 'EXPAND_INTERVALS',
interval_adjustment_amount = 1,
interval_adjustment_units = 'SECONDS',
interval_filtering = 'FILTER_INTERVALS',
interval_filtering_threshold = 1,
interval_filtering_threshold_units = 'MINUTES',
coordinate_system = 'SPHERICAL',
coordinate = 'COLATITUDE',
relational_condition = '<',
reference_value = 0.25,
).run()
[Calculation submit] Phase: COMPLETE (id: e4ceb336-05f8-47b7-9e37-c64d8791e96f)
{'DATE': '2012-10-19 08:39:33.812153 UTC', 'DURATION': 3394.10937738}