How to use the skyfield.descriptorlib.reify function in skyfield

To help you get started, we’ve selected a few skyfield examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github skyfielders / python-skyfield / skyfield / elementslib.py View on Github external
    @reify
    def semi_latus_rectum(self):
        p = semi_latus_rectum(self._h_vec, self._mu)
        return Distance(km=p)
github skyfielders / python-skyfield / skyfield / timelib.py View on Github external
    @reify
    def _mean_obliquity_radians(self):
        # Cached because it is used to compute both gast and N.
        return mean_obliquity(self.tdb) * ASEC2RAD
github skyfielders / python-skyfield / skyfield / elementslib.py View on Github external
    @reify
    def argument_of_periapsis(self):
        w = argument_of_periapsis(self._n_vec, self._e_vec, self._pos_vec, self._vel_vec)
        return Angle(radians=w)
github skyfielders / python-skyfield / skyfield / timelib.py View on Github external
    @reify
    def tdb_fraction(self):
        fr = self.tt_fraction
        return fr + tdb_minus_tt(self.whole, fr) / DAY_S
github skyfielders / python-skyfield / skyfield / elementslib.py View on Github external
    @reify
    def true_longitude(self):
        Om = self.longitude_of_ascending_node.radians
        w = self.argument_of_periapsis.radians
        v = self.true_anomaly.radians
        l = (Om + w + v)%tau
        return Angle(radians=l)
github skyfielders / python-skyfield / skyfield / elementslib.py View on Github external
    @reify
    def eccentric_anomaly(self):
        E = eccentric_anomaly(self.true_anomaly.radians,
                              self.eccentricity,
                              self.semi_latus_rectum.km)
        return Angle(radians=E)
github skyfielders / python-skyfield / skyfield / elementslib.py View on Github external
    @reify
    def mean_motion_per_day(self):
        n = mean_motion(self.semi_major_axis.km,
                        self._mu)
        return Angle(radians=n*DAY_S)
github skyfielders / python-skyfield / skyfield / timelib.py View on Github external
    @reify
    def J(self):
        """Decimal Julian years centered on J2000.0 = TT 2000 January 1 12h."""
        return (self.whole - 1721045.0 + self.tt_fraction) / 365.25
github skyfielders / python-skyfield / skyfield / timelib.py View on Github external
    @reify
    def gast(self):
        """Greenwich Apparent Sidereal Time as decimal hours."""
        d_psi, _ = self._nutation_angles_radians
        tt = self.tt
        # TODO: move this into an eqeq function?
        c_terms = equation_of_the_equinoxes_complimentary_terms(tt)
        eq_eq = d_psi * cos(self._mean_obliquity_radians) + c_terms
        # TODO: constrain to 24 hours?
        return self.gmst + eq_eq / tau * 24.0
github skyfielders / python-skyfield / skyfield / units.py View on Github external
    @reify
    def _hours(self):
        return self.radians * 24.0 / tau