# Path: skyfield/magnitudelib.py
# _SATURN_POLE = array([0.08547883, 0.07323576, 0.99364475])
# _URANUS_POLE = array([-0.21199958 -0.94155916 -0.26176809])
# _FUNCTIONS = {
#     199: _mercury_magnitude,
#     299: _venus_magnitude,
#     399: _earth_magnitude,
#     499: _mars_magnitude,
#     599: _jupiter_magnitude,
#     699: _saturn_magnitude,
#     799: _uranus_magnitude,
#     899: _neptune_magnitude,
# 
#     # Some planets can be reasonably identified with their barycenter.
#     1: _mercury_magnitude,
#     2: _venus_magnitude,
#     4: _mars_magnitude,
#     5: _jupiter_magnitude,
#     6: _saturn_magnitude,
#     7: _uranus_magnitude,
#     8: _neptune_magnitude,
# }
# def planetary_magnitude(position):
# def _mercury_magnitude(r, delta, ph_ang):
# def _venus_magnitude(r, delta, ph_ang):
# def _earth_magnitude(r, delta, ph_ang):
# def _mars_magnitude(r, delta, ph_ang):
# def _jupiter_magnitude(r, delta, ph_ang):
# def _saturn_magnitude(r, delta, ph_ang, sun_sub_lat, earth_sub_lat, rings=True):
# def _uranus_magnitude(r, delta, ph_ang,
#                       sun_sub_lat_planetog, earth_sub_lat_planetog):
# def _neptune_magnitude(r, delta, ph_ang, year):
# 
# Path: skyfield/tests/conventions.py
# class A(object):
#     __getitem__ = np.array


import numpy as np
from numpy import nan
from skyfield import magnitudelib as m
from skyfield.tests.conventions import A


def test_mercury_magnitude_function():
    mag = m._mercury_magnitude(0.310295423552, 1.32182643625754, 1.1677)
    assert abs(-2.477 - mag) < 0.0005
    mag = m._mercury_magnitude(0.413629222334, 0.92644808718613, 90.1662)
    assert abs(0.181 - mag) < 0.0005
    mag = m._mercury_magnitude(0.448947624811, 0.56004973217883, 178.7284)
    assert abs(7.167 - mag) < 0.0005

    args = [

# Path: skyfield/magnitudelib.py
# _SATURN_POLE = array([0.08547883, 0.07323576, 0.99364475])
# _URANUS_POLE = array([-0.21199958 -0.94155916 -0.26176809])
# _FUNCTIONS = {
#     199: _mercury_magnitude,
#     299: _venus_magnitude,
#     399: _earth_magnitude,
#     499: _mars_magnitude,
#     599: _jupiter_magnitude,
#     699: _saturn_magnitude,
#     799: _uranus_magnitude,
#     899: _neptune_magnitude,
# 
#     # Some planets can be reasonably identified with their barycenter.
#     1: _mercury_magnitude,
#     2: _venus_magnitude,
#     4: _mars_magnitude,
#     5: _jupiter_magnitude,
#     6: _saturn_magnitude,
#     7: _uranus_magnitude,
#     8: _neptune_magnitude,
# }
# def planetary_magnitude(position):
# def _mercury_magnitude(r, delta, ph_ang):
# def _venus_magnitude(r, delta, ph_ang):
# def _earth_magnitude(r, delta, ph_ang):
# def _mars_magnitude(r, delta, ph_ang):
# def _jupiter_magnitude(r, delta, ph_ang):
# def _saturn_magnitude(r, delta, ph_ang, sun_sub_lat, earth_sub_lat, rings=True):
# def _uranus_magnitude(r, delta, ph_ang,
#                       sun_sub_lat_planetog, earth_sub_lat_planetog):
# def _neptune_magnitude(r, delta, ph_ang, year):
# 
# Path: skyfield/tests/conventions.py
# class A(object):
#     __getitem__ = np.array


# Path: skyfield/tests/test_magnitudes_raw.py
import numpy as np
from numpy import nan
from skyfield import magnitudelib as m
from skyfield.tests.conventions import A



def test_mercury_magnitude_function():
    mag = m._mercury_magnitude(0.310295423552, 1.32182643625754, 1.1677)
    assert abs(-2.477 - mag) < 0.0005
    mag = m._mercury_magnitude(0.413629222334, 0.92644808718613, 90.1662)
    assert abs(0.181 - mag) < 0.0005
    mag = m._mercury_magnitude(0.448947624811, 0.56004973217883, 178.7284)
    assert abs(7.167 - mag) < 0.0005

    args = [

        A[0.310295423552, 0.413629222334, 0.448947624811],