PyEphem - Calculation of the positions of unearthly moons

I am trying to get the distance of the Earth and the correct ascent (relative to my observation point on Earth) of a satellite that does not revolve around the Earth, but pyEphem does not return the same properties as other solar bodies.

With Ganymede (the largest moon of Jupiter), for example:

import math, ephem Observer = ephem.city('London') Observer.date = '2013-04-23' Observer.pressure, Observer.elevation = 0, 100 moonGanymede = ephem.Ganymede(Observer) print math.cos(moonGanymede.ra) # right ascension print moonGanymede.earth_distance * ephem.meters_per_au # distance 

I get this error:

 AttributeError: 'Ganymede' object has no attribute 'earth_distance' 

The ra attribute exists, but does it apply to my Observer or to Jupiter?

This seems to be relative to Observer , since if I change the location, the value will also change.

I read the documentation and I know that these properties are not defined for the moons, but I have no idea how to calculate these relative to the Earth, taking into account the additional specific properties of the bodies of the moon:

On the planetary moons are also installed:

The position of the moon relative to the planet (measured in the radii of the planet)

 x — offset +east or –west y — offset +south or –north z — offset +front or –behind 

Doing:

 print moonGanymede.x, moonGanymede.y, moonGanymede.z 

Outputs:

 -14.8928060532 1.52614057064 -0.37974858284 

Since Jupiter has an average radius of 69173 kilometers, these values ​​are translated into:

 moonGanymede.x = 1030200 kilometers (west) moonGanymede.y = 105570 kilometers (south) moonGanymede.z = 26268 kilometers (behind) 

Given that I know the distance and right ascension of Jupiter relative to Observer , how can I calculate the distance and direct ascension of moonGanymede (also relative to Observer )

I am using pyEphem 3.7.5.1 (since Python 2.7).

+4
source share
3 answers

I'm still trying to figure it out (if someone sees something, please tell me), but it seems like if I do:

 sqrt((-14.8928060532)^2 + (1.52614057064)^2 + (-0.37974858284)^2) = 14.9756130481 

I always get a value that always falls into the minimum / maximum distance from the center of the orbit (14.95 - 14.99).

Since this is indicated in the radius radius of the orbit, I will need to multiply it by 69173 * 1000 to get a SI unit:

 14.9756130481 * 69173 * 1000 = 1.0359080813762213 * 10^9 meters 

Since pyEphem deals with distances with AU:

 print (1.0359080813762213 * 10**9) / ephem.meters_per_au # 0.00692461785302 

At the same time, the Earth-Jupiter distance was 5.79160547256 AU.

Now, to get the distance, I have to either add or subtract z coordinates depending on the sign:

 5.79160547256 - 0.00692461785302 = 5.78468085470698 AU 

Running the same code today (now) returns 6.03799937821 , which seems very close to the 6.031 value, that WolframAlpha is currently returning, it does not correspond to 100%, but maybe this can be taken into account by some other base ephemeris library or data source. Not sure...

0
source

Just thoughts; You probably need to do this in two steps.

  • Get the satellite location relative to the mother planet
  • Get the location of the planet relative to the observer
  • Calculation of trigonometry; get the satellite location relative to the observer.

You have already done 1 and can easily do 2. Convert all the values ​​to x, y, z and add them back to angular. Or I'm sure you / ephym can do this directly for you.

NTN

+1
source

It seems that proper ascension, declination, azimuth, etc. calculated correctly:

 In [31]: g = ephem.Ganymede(Observer) In [32]: j = ephem.Jupiter(Observer) In [33]: g.ra, g.az, g.dec Out[33]: (1.3024204969406128, 5.586287021636963, 0.38997682929039) In [34]: j.ra, j.az, j.dec Out[34]: (1.303646765055829, 5.5853118896484375, 0.39010250333236757) 

The values ​​for Ganimede and Jupiter are pretty close, it seems that you get the correct results for everything except the distance to the object.

0
source

All Articles