admin管理员组文章数量:1356452
My antenna is at coordinates: LATITUDE = 47.397490, LONGITUDE = 8.550440 I want to calculate azimuth and elevation of JUICE with SPICE. This is what I have so far:
import os
import spiceypy as spice
from datetime import datetime, timezone
# Load all kernels from meta-kernel
meta_kernel_path = os.path.join('SPICE', 'Kernels', 'mk', 'juice_mk.tm')
spice.furnsh(meta_kernel_path)
# Set time for observation
utc_now = datetime.now(timezone.utc).strftime('%Y-%m-%dT%H:%M:%S')
et = spice.str2et(utc_now) # Convert UTC to Ephemeris Time
# Get spacecraft position relative to SSB
position, light_time = spice.spkpos('JUICE', et, 'J2000', 'NONE', 'SOLAR SYSTEM BARYCENTER')
print(position)
# Unload kernels
spice.kclear()
How do I tell SPICE to calculate it from the position of my antenna? I have found exampels that do it relative to a knowen obeserver like DSN-14. But I need it relative to the given coordinates. PLEASE HELP! I'm at this for weeks now and I refuse to belive that it is this hard.
My antenna is at coordinates: LATITUDE = 47.397490, LONGITUDE = 8.550440 I want to calculate azimuth and elevation of JUICE with SPICE. This is what I have so far:
import os
import spiceypy as spice
from datetime import datetime, timezone
# Load all kernels from meta-kernel
meta_kernel_path = os.path.join('SPICE', 'Kernels', 'mk', 'juice_mk.tm')
spice.furnsh(meta_kernel_path)
# Set time for observation
utc_now = datetime.now(timezone.utc).strftime('%Y-%m-%dT%H:%M:%S')
et = spice.str2et(utc_now) # Convert UTC to Ephemeris Time
# Get spacecraft position relative to SSB
position, light_time = spice.spkpos('JUICE', et, 'J2000', 'NONE', 'SOLAR SYSTEM BARYCENTER')
print(position)
# Unload kernels
spice.kclear()
How do I tell SPICE to calculate it from the position of my antenna? I have found exampels that do it relative to a knowen obeserver like DSN-14. But I need it relative to the given coordinates. PLEASE HELP! I'm at this for weeks now and I refuse to belive that it is this hard.
Share Improve this question edited Mar 28 at 14:45 Akut Luna asked Mar 28 at 12:52 Akut LunaAkut Luna 3885 silver badges19 bronze badges 3- I presume you mean the fly-by satellite Juice due at Venus in August this year? You actually want to compute its position relative to the Earth's centre (and then apply a small correction for your position on the globe). Unless you have a large dish the pointing doesn't have to be better than about 0.2 degrees for a common or garden 2m dish. This guy seems to have done a lot of work on decoding Juice. BTW there are too many spices - the most common one being an electronic circuit simulator. – Martin Brown Commented Mar 28 at 13:17
- JUICE is just an example, in the end it should work for all space crafts (given the correct data). And I want the local Azimuth and Elevation. Therfore I need the rotation of earth taken into account. SPICE should be able to do that – Akut Luna Commented Mar 28 at 13:25
- You want the local Azimuth and Elevation but in astronomical terms you are quite likely to get given the Right Ascension and Declination of the object since that is how most computerised telescopes are configured to accept object coordinates in the sky. It is a relatively simple transform between the two. – Martin Brown Commented Mar 28 at 14:09
1 Answer
Reset to default 0I gave this a second try and this time I managed to adjust it to what I want. But now I would like to know if I can get the range rate, azimuth rate and elevation rate as well.
import spiceypy
import numpy as np
from datetime import datetime, timezone
# ######################################################################## #
# Based on code by Greg Miller ([email protected]) 2019 #
# Released as public domain #
# https://astronomy.stackexchange/questions/33095/spice-alt-az-example #
# ######################################################################## #
spiceypy.furnsh('SPICE/Kernels/mk/metakernel.tm')
# Lat, Lon position of observer ------------------------------------------
'''
Here the coords are normal and in mytopo.tf they need to be:
lon_mytypo = -lon_normal
lat_mytypo = -(90-lat_normal)
'''
lat = np.radians(47.397490)
lon = np.radians(8.550440)
alt = 0.4995
# convert lat, lon to xyz ------------------------------------------------
obspos = spiceypy.georec(lon, lat, alt, 6378.1366, 1.0/298.25642)
# time of observation in UT ----------------------------------------------
et = spiceypy.datetime2et(datetime.now(timezone.utc))
# Get the xyz coordinates of the spacecraft relative to observer in MYTOPO frame (Correct for one-way light time and stellar aberration)
state_vector, light_time = spiceypy.spkcpo('JUICE', et, 'MYTOPO', 'OBSERVER', 'LT+S', obspos, 'EARTH', 'ITRF93')
# convert to polar coordinates
position = state_vector[0:3] # km
velocity = state_vector[3:6] # km/s
print(np.linalg.norm(velocity))
r, az, el = spiceypy.recazl(position, azccw=False, elplsz=True)
print(r, np.degrees(az), np.degrees(el))
With metakernel.tm
\begindata
PATH_VALUES = ( 'SPICE/Kernels' )
PATH_SYMBOLS = ( 'KERNELS' )
KERNELS_TO_LOAD = (
'$KERNELS/fk/earth_topo_201023.tf'
'$KERNELS/lsk/naif0012.tls'
'$KERNELS/pck/earth_000101_250530_250303.bpc'
'$KERNELS/pck/pck00011.tpc'
'$KERNELS/spk/de440.bsp'
'$KERNELS/spk/earthstns_itrf93_201023.bsp'
'$KERNELS/spk/juice_orbc_000080_230414_310721_v01.bsp'
'$KERNELS/mytopo.tf'
)
\begintext
and mytopo.tf
\begindata
FRAME_MYTOPO = 1234567
FRAME_1234567_NAME = 'MYTOPO'
FRAME_1234567_CLASS = 4
FRAME_1234567_CLASS_ID = 1234567
FRAME_1234567_CENTER = 399
TKFRAME_1234567_SPEC = 'ANGLES'
TKFRAME_1234567_RELATIVE = 'IAU_EARTH'
TKFRAME_1234567_ANGLES = ( -8.550440, -42.60251, 180 )
TKFRAME_1234567_AXES = ( 3, 2, 3 )
TKFRAME_1234567_UNITS = 'DEGREES'
\begintext
版权声明:本文标题:astronomy - Calculating relative position of JUICE for observer at given coordinates with SPICE - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744036675a2579900.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论