How to use the skyfield.api.load.open 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 / builders / build_constellations.py View on Github external
def main():
    with api.load.open(URL) as f:
        lines = list(f)

    unique_ra = set()
    unique_dec = set()
    fracs = set()
    boundaries = []

    for line in lines:
        fields = line.split()
        ra_low = extend(fields[0])
        ra_up = extend(fields[1])
        de_low = extend(fields[2])
        const = fields[3].decode('ascii')

        print(ra_low, const)
github skyfielders / python-skyfield / skyfield / data / earth_orientation.py View on Github external
def usno_historic_delta_t():
    import pandas as pd
    f = load.open(_CDDIS + 'historic_deltat.data')
    df = pd.read_table(f, sep=b' +', engine='python', skiprows=[1])
    return pd.DataFrame({'year': df[b'Year'], 'delta_t': df[b'TDT-UT1']})
github skyfielders / python-skyfield / skyfield / data / hipparcos.py View on Github external
def load(match_function):
    "DEPRECATED; see :func:`~skyfield.data.hipparcos.load_dataframe() instead."
    from skyfield import api

    with api.load.open(url) as f:
        for line in gzip.GzipFile(fileobj=f):
            if match_function(line):
                yield parse(line)
github skyfielders / python-skyfield / skyfield / data / earth_orientation.py View on Github external
def morrison_and_stephenson_2004_table():
    """Table of smoothed Delta T values from Morrison and Stephenson, 2004."""
    import pandas as pd
    f = load.open('http://eclipse.gsfc.nasa.gov/SEcat5/deltat.html')
    tables = pd.read_html(f.read())
    df = tables[0]
    return pd.DataFrame({'year': df[0], 'delta_t': df[1]})
github skyfielders / python-skyfield / tmp36.py View on Github external
from skyfield import api
from skyfield.api import load
from skyfield.constants import tau
from skyfield.data.mpc import COMET_URL, load_comets_dataframe

with load.open(COMET_URL) as f:
    df = load_comets_dataframe(f)

from skyfield.keplerlib import KeplerOrbit

ts = load.timescale(builtin=True)

from numpy import sqrt

df['semimajor_axis_au'] = (
    df['perihelion_distance_au'] / (1.0 - df['eccentricity'])
)

from skyfield.data.gravitational_parameters import GM_dict
from skyfield.constants import AU_KM, DAY_S

mu_km3_s2 = GM_dict[10]