Skip to content

Commit 3283312

Browse files
committed
remove tests for angle range
1 parent 4574baa commit 3283312

1 file changed

Lines changed: 0 additions & 46 deletions

File tree

tests/test_solarposition.py

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -965,49 +965,3 @@ def test_spa_python_numba_physical_dst(expected_solpos, golden):
965965
atmos_refract=0.5667,
966966
how='numpy', numthreads=1)
967967

968-
969-
def test_solar_angles_spring_equinox():
970-
"""Test solar angles for New York City on spring equinox.
971-
972-
This test verifies that solar angles follow expected patterns:
973-
- Zenith angle should be between 0° and 90°
974-
- Azimuth should be between 0° and 360°
975-
- Elevation should be between -90° and 90°
976-
- At solar noon, the sun should be at its highest point
977-
- The sun should rise in the east (azimuth ~90°) and set in the west (azimuth ~270°)
978-
"""
979-
# Create a location (New York City)
980-
latitude = 40.7128
981-
longitude = -74.0060
982-
tz = 'America/New_York'
983-
location = Location(latitude, longitude, tz=tz)
984-
985-
# Create a time range for one day
986-
start = pd.Timestamp('2024-03-20', tz=tz) # Spring equinox
987-
times = pd.date_range(start=start, periods=24, freq='h') # Use 'h' for hourly
988-
989-
# Calculate solar position
990-
solpos = location.get_solarposition(times)
991-
992-
# Test morning (9 AM)
993-
morning = solpos.loc['2024-03-20 09:00:00-04:00']
994-
assert 0 <= morning['zenith'] <= 90
995-
assert 0 <= morning['azimuth'] <= 360
996-
assert -90 <= morning['elevation'] <= 90
997-
assert 90 <= morning['azimuth'] <= 180 # Sun should be in southeast
998-
999-
# Test solar noon (clock noon)
1000-
noon = solpos.loc['2024-03-20 12:00:00-04:00']
1001-
assert 0 <= noon['zenith'] <= 90
1002-
assert 0 <= noon['azimuth'] <= 360
1003-
assert -90 <= noon['elevation'] <= 90
1004-
# Allow a 3 degree margin between noon elevation and the maximum elevation
1005-
max_elevation = solpos['elevation'].max()
1006-
assert abs(noon['elevation'] - max_elevation) < 3.0 # Allow 3 degree difference
1007-
1008-
# Test evening (3 PM)
1009-
evening = solpos.loc['2024-03-20 15:00:00-04:00']
1010-
assert 0 <= evening['zenith'] <= 90
1011-
assert 0 <= evening['azimuth'] <= 360
1012-
assert -90 <= evening['elevation'] <= 90
1013-
assert 180 <= evening['azimuth'] <= 270 # Sun should be in southwest

0 commit comments

Comments
 (0)