question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transform one Geocentric to multiple earth-locations

See original GitHub issue

Hi,

First thanks for your work, your library is really amazing.

But for a specific application, i try to generate astrometric table and graph in alt/az for earth observers. I know the dates in advance, but not the locations. To gain some time and I/O reads from the Kernel file i try to find a way to pre-compute Geocentric position and use them on demand to transform from Geocentric to a Apparent with the observer coordinate.

I try adding/substrating different positions object with no success. I think i have to Positions class directly, but it’s not clear in my head, and the documentation is not talking about this approach.

How can we use an existing Geocentric Position (Apparent or not) and transform it into multiple Earth locations ? I guess it’s just a Vector transformation, but don’t know how to handle it.

Sorry i don’t have a lot of code to show.

from skyfield.api import load, wgs84

def astrometric_to_apparent_with_topo(astrometric, t, location):
    #don't know how to take this function ...
    pass
    return

if __name__ == "__main__":
    planets = load('data/de440.bsp')
    timescale = load.timescale()
    t0 = timescale.now()

    astrometric_mars = planets["EARTH"].at(t0).observe(planets["MARS BARYCENTER"])

    geographic_toulouse = wgs84.latlon(43.6167, 5.7667)

    print(astrometric_to_apparent_with_topo(astrometric_mars, t0, `geographic_toulouse))

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
zaltanarcommented, Feb 11, 2021

You are too reactive for me.

I had my response since the third post, the discussion after it’s just bonuses and some curiosity.

  1. Yes, in my initial thought i didn’t take into account for diurnal aberration
  2. I didn’t know at first the caching mechanism
  3. No, i’m still in api testing, i plan to tests different methods.
  4. After some calculations, as the moon travels 550 mas per second in the sky, i can play with this accuracy error.

I get everything i need now, thanks a lot, i learn everything :

  1. Skyfield can substracts Positions
  2. The api load data in ram
  3. Diurnal aberration exists

I close the issue, i as i have my response. I will share tests results later here. But as it’s a side project it may take some days. Thanks again.

0reactions
brandon-rhodescommented, Feb 11, 2021

As shown just above, I’ve committed a fix for vector subtraction that will use more specific vector classes like Geocentric if subtraction indeed results in a vector whose origin is the geocenter. To try the new feature out:

pip install -U https://github.com/skyfielders/python-skyfield/archive/master.zip

As for your original question, is this an accurate summary of the discussion so far?

  1. Because each location on Earth (besides the poles) has its own velocity around the Earth’s axis in addition to the velocity of the geocenter itself, the aberration of light will be different; and unless it happens to be at the exact same distance from the target as the geocenter, the light-travel-time will be different and therefore so will the position of the target; and so vector subtraction alone won’t produce a topocentric vector from a geocentric vector.
  2. As mentioned above, there is no I/O penalty for computing planet positions once the data has been loaded into RAM; they are one of the fastest things Skyfield does.
  3. Which might mean that your application is being slowed down by something else. Have you tried profiling the code to see which Skyfield routine is taking the most time?
  4. I assume that a 600 mas error is unacceptable for your requirements, but it is not clear what your requirements are — you might want to review the precision to which coordinates will be given in your output table, so that we can know what the acceptable error is, which would suggest which effects can be ignored while still giving an accurate enough answer.
Read more comments on GitHub >

github_iconTop Results From Across the Web

17 1 Transformation between Geocentric and Topocentric ...
Earth Centered Inertial Frames (Equatorial and Ecliptic) | Orbital Mechanics with Python 39. Alfonso Gonzalez - Astrodynamics & SE Podcast.
Read more >
Geocentric model - Wikipedia
In astronomy, the geocentric model is a superseded description of the Universe with Earth at the center. Under most geocentric models, the Sun,...
Read more >
Geocentric Cosmology. - Explaining Science
In this model the Earth is the the centre of the Universe and all the planets and stars revolve around it. Although it...
Read more >
Geodetic Coordinate Conversions - Naval Postgraduate School
The usual procedure is to iterate beginning with the assumption that there is no difference between geodetic and geocentric latitude. First compute the ......
Read more >
Geocentric and Heliocentric Models - NMSU Astronomy
Each one traveled on a small circular orbit (an epicycle) which in turn traveled on a larger deferent about the Earth. This combination,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found