Skip to content

Commit 5b74221

Browse files
committed
add physical ephemeris tests
1 parent e354528 commit 5b74221

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

pvlib/test/test_solarposition.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,23 @@ def test_ephemeris_functional():
117117
time=times, location=golden_mst, method='ephemeris')
118118

119119

120-
# add tests for daylight savings time?
120+
def test_ephemeris_physical():
121+
times = pd.date_range(datetime.datetime(2003,10,17,12,30,30),
122+
periods=1, freq='D')
123+
ephem_data = solarposition.ephemeris(times, golden_mst, pressure=82000,
124+
temperature=11).ix[0]
125+
126+
assert_almost_equals(50.111622, ephem_data['apparent_zenith'], 2)
127+
assert_almost_equals(194.340241, ephem_data['azimuth'], 2)
128+
assert_almost_equals(39.888378, ephem_data['apparent_elevation'], 2)
129+
130+
131+
def test_ephemeris_physical_dst():
132+
times = pd.date_range(datetime.datetime(2003,10,17,13,30,30),
133+
periods=1, freq='D')
134+
ephem_data = solarposition.ephemeris(times, golden, pressure=82000,
135+
temperature=11).ix[0]
136+
137+
assert_almost_equals(50.111622, ephem_data['apparent_zenith'], 2)
138+
assert_almost_equals(194.340241, ephem_data['azimuth'], 2)
139+
assert_almost_equals(39.888378, ephem_data['apparent_elevation'], 2)

0 commit comments

Comments
 (0)