Permalink
Browse files

Fix sunpy.sun.sun.

  • Loading branch information...
1 parent 3c1fa0a commit dd2a80db53263de980419f5142f4d091a45c58da @segfaulthunter segfaulthunter committed May 12, 2012
Showing with 13 additions and 13 deletions.
  1. +13 −13 sunpy/sun/sun.py
View
@@ -54,7 +54,7 @@
import cmath
import numpy as np
from sunpy.time import parse_time
-from sunpy.util import util
+from sunpy.time import julian
def solar_cycle_number(t=None):
time = parse_time(t)
@@ -81,46 +81,46 @@ def position(t=None):
def eccentricity_SunEarth_orbit(t=None):
"""Returns the eccentricity of the Sun Earth Orbit."""
- T = util.julian_centuries(t)
+ T = julian.julian_centuries(t)
result = 0.016751040 - 0.00004180 * T - 0.0000001260 * T ** 2
return result
def mean_ecliptic_longitude(t=None):
"""Returns the mean ecliptic longitude."""
- T = util.julian_centuries(t)
+ T = julian.julian_centuries(t)
result = 279.696680 + 36000.76892 * T + 0.0003025 * T ** 2
result = result % 360.0
return result
def longitude_Sun_perigee(t=None):
"""Insert text here"""
- # T = util.julian_centuries(t)
+ # T = julian.julian_centuries(t)
return 1
def mean_anomaly(t=None):
"""Returns the mean anomaly (the angle through which the Sun has moved
assuming a circular orbit) as a function of time."""
- T = util.julian_centuries(t)
+ T = julian.julian_centuries(t)
result = 358.475830 + 35999.049750 * T - 0.0001500 * T ** 2 - 0.00000330 * T ** 3
result = result % 360.0
return result
def carrington_rotation_number(t=None):
"""Return the Carrington Rotation number"""
- jd = util.julian_day(t)
+ jd = julian.julian_day(t)
result = (1. / 27.2753) * (jd - 2398167.0) + 1.0
return result
def geometric_mean_longitude(t=None):
"""Returns the geometric mean longitude (in degrees)"""
- T = util.julian_centuries(t)
+ T = julian.julian_centuries(t)
result = 279.696680 + 36000.76892 * T + 0.0003025 * T ** 2
result = result % 360.0
return result
def equation_of_center(t=None):
"""Returns the Sun's equation of center (in degrees)"""
- T = util.julian_centuries(t)
+ T = julian.julian_centuries(t)
mna = mean_anomaly(t)
result = ((1.9194600 - 0.0047890 * T - 0.0000140 * T
** 2) * np.sin(np.radians(mna) + (0.0200940 - 0.0001000 * T) *
@@ -148,7 +148,7 @@ def sunearth_distance(t=None):
def apparent_longitude(t=None):
"""Returns the apparent longitude of the Sun."""
- T = util.julian_centuries(t)
+ T = julian.julian_centuries(t)
omega = 259.18 - 1934.142*T
true_long = true_longitude(t)
result = true_long - 0.00569 - 0.00479*math.sin(np.radians(omega))
@@ -162,7 +162,7 @@ def apparent_latitude(t=None):
return 0
def true_obliquity_of_ecliptic(t=None):
- T = util.julian_centuries(t)
+ T = julian.julian_centuries(t)
result = 23.452294 - 0.0130125 * T - 0.00000164 * T ** 2 + 0.000000503 * T ** 3
return result
@@ -200,7 +200,7 @@ def apparent_declination(t=None):
def solar_north(t=None):
"""Returns the position of the Solar north pole in degrees."""
- T = util.julian_centuries(t)
+ T = julian.julian_centuries(t)
ob1 = true_obliquity_of_ecliptic(t)
# in degrees
i = 7.25
@@ -216,8 +216,8 @@ def solar_north(t=None):
def heliographic_solar_center(t=None):
"""Returns the position of the solar center in heliographic coordinates."""
- jd = util.julian_day(t)
- T = util.julian_centuries(t)
+ jd = julian.julian_day(t)
+ T = julian.julian_centuries(t)
# Heliographic coordinates in degrees
theta = (jd - 2398220)*360/25.38
i = 7.25

0 comments on commit dd2a80d

Please sign in to comment.