# Path: skyfield/api.py
# N = E = +1.0
# S = W = -1.0
# 
# Path: skyfield/almanac.py
# def phase_angle(ephemeris, body, t):
# def fraction_illuminated(ephemeris, body, t):
# def seasons(ephemeris):
#     def season_at(t):
# def moon_phase(ephemeris, t):
# def moon_phases(ephemeris):
#     def moon_phase_at(t):
# def moon_nodes(ephemeris):
#     def moon_node_at(t):
# def oppositions_conjunctions(ephemeris, target):
#     def leading_or_trailing(t):
# def meridian_transits(ephemeris, target, topos):
#     def west_of_meridian_at(t):
# def sunrise_sunset(ephemeris, topos):
#     def is_sun_up_at(t):
# def dark_twilight_day(ephemeris, topos):
#     def is_it_dark_twilight_day_at(t):
# def risings_and_settings(ephemeris, target, topos,
#                          horizon_degrees=-34.0/60.0, radius_degrees=0): #?
#     def is_body_up_at(t):
# SEASONS = [
#     'Spring',
#     'Summer',
#     'Autumn',
#     'Winter',
# ]
# SEASON_EVENTS = [
#     'Vernal Equinox',
#     'Summer Solstice',
#     'Autumnal Equinox',
#     'Winter Solstice',
# ]
# SEASON_EVENTS_NEUTRAL = [
#     'March Equinox',
#     'June Solstice',
#     'September Equinox',
#     'December Solstice',
# ]
# MOON_PHASES = [
#     'New Moon',
#     'First Quarter',
#     'Full Moon',
#     'Last Quarter',
# ]
# MOON_NODES = [
#     'descending',
#     'ascending',
# ]
# CONJUNCTIONS = [
#     'conjunction',
#     'opposition',
# ]
# MERIDIAN_TRANSITS = ['Antimeridian transit', 'Meridian transit']
# TWILIGHTS = {
#     0: 'Night',
#     1: 'Astronomical twilight',
#     2: 'Nautical twilight',
#     3: 'Civil twilight',
#     4: 'Day',
# }


from skyfield import api, almanac

# Compare with USNO:
# http://aa.usno.navy.mil/cgi-bin/aa_moonill2.pl?form=1&year=2018&task=00&tz=-05

def test_fraction_illuminated():
    ts = api.load.timescale()
    t0 = ts.utc(2018, 9, range(9, 19), 5)
    e = api.load('de421.bsp')

# Path: skyfield/api.py
# N = E = +1.0
# S = W = -1.0
# 
# Path: skyfield/almanac.py
# def phase_angle(ephemeris, body, t):
# def fraction_illuminated(ephemeris, body, t):
# def seasons(ephemeris):
#     def season_at(t):
# def moon_phase(ephemeris, t):
# def moon_phases(ephemeris):
#     def moon_phase_at(t):
# def moon_nodes(ephemeris):
#     def moon_node_at(t):
# def oppositions_conjunctions(ephemeris, target):
#     def leading_or_trailing(t):
# def meridian_transits(ephemeris, target, topos):
#     def west_of_meridian_at(t):
# def sunrise_sunset(ephemeris, topos):
#     def is_sun_up_at(t):
# def dark_twilight_day(ephemeris, topos):
#     def is_it_dark_twilight_day_at(t):
# def risings_and_settings(ephemeris, target, topos,
#                          horizon_degrees=-34.0/60.0, radius_degrees=0): #?
#     def is_body_up_at(t):
# SEASONS = [
#     'Spring',
#     'Summer',
#     'Autumn',
#     'Winter',
# ]
# SEASON_EVENTS = [
#     'Vernal Equinox',
#     'Summer Solstice',
#     'Autumnal Equinox',
#     'Winter Solstice',
# ]
# SEASON_EVENTS_NEUTRAL = [
#     'March Equinox',
#     'June Solstice',
#     'September Equinox',
#     'December Solstice',
# ]
# MOON_PHASES = [
#     'New Moon',
#     'First Quarter',
#     'Full Moon',
#     'Last Quarter',
# ]
# MOON_NODES = [
#     'descending',
#     'ascending',
# ]
# CONJUNCTIONS = [
#     'conjunction',
#     'opposition',
# ]
# MERIDIAN_TRANSITS = ['Antimeridian transit', 'Meridian transit']
# TWILIGHTS = {
#     0: 'Night',
#     1: 'Astronomical twilight',
#     2: 'Nautical twilight',
#     3: 'Civil twilight',
#     4: 'Day',
# }


# Path: skyfield/tests/test_almanac.py
from skyfield import api, almanac


# Compare with USNO:
# http://aa.usno.navy.mil/cgi-bin/aa_moonill2.pl?form=1&year=2018&task=00&tz=-05

def test_fraction_illuminated():
    ts = api.load.timescale()
    t0 = ts.utc(2018, 9, range(9, 19), 5)
    e = api.load('de421.bsp')

    i = almanac.fraction_illuminated(e, 'moon', t0[-1]).round(2)