Skip to content

Observing given barycentric coordinates from Earth #783

Answered by naavis
naavis asked this question in Q&A
Discussion options

You must be logged in to vote

If I understood things right, I got it working by inheriting from VectorFunction like this:

from skyfield.api import load, wgs84
from skyfield.vectorlib import VectorFunction

class ThingInSpace(VectorFunction):
    def __init__(self):
        # Value 0 corresponds to the solar system barycenter according to this: https://rhodesmill.org/skyfield/api-vectors.html#skyfield.vectorlib.VectorFunction.center
        self.center = 0

    @property
    def target(self):
        # This is a property to avoid circular references as described here: https://github.com/skyfielders/python-skyfield/blob/master/skyfield/planetarylib.py#L222
        return self

    def _at(self, t):
        # Position ve…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@brandon-rhodes
Comment options

@naavis
Comment options

Answer selected by naavis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants