8000 fixed the calculation of rotated panel azimuth calculations so that t… · chriswolfrom/pvlib-python@7254a7f · GitHub
[go: up one dir, main page]

Skip to content

Commit 7254a7f

Browse files
committed
fixed the calculation of rotated panel azimuth calculations so that the results are consistent with PVsyst.
Also the tests are updated to cover that issue
1 parent 00dd124 commit 7254a7f

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

pvlib/test/test_tracking.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def test_axis_tilt():
107107
max_angle=90, backtrack=True,
108108
gcr=2.0/7.0)
109109

110-
expect = pd.DataFrame({'aoi': 7.286245, 'surface_azimuth': 37.3427,
110+
expect = pd.DataFrame({'aoi': 7.286245, 'surface_azimuth': 142.65730,
111111
'surface_tilt': 35.98741, 'tracker_theta': -20.88121},
112112
index=[0], dtype=np.float64)
113113

@@ -118,7 +118,7 @@ def test_axis_tilt():
118118
max_angle=90, backtrack=True,
119119
gcr=2.0/7.0)
120120

121-
expect = pd.DataFrame({'aoi': 47.6632, 'surface_azimuth': 129.0303,
121+
expect = pd.DataFrame({'aoi': 47.6632, 'surface_azimuth': 50.96969,
122122
'surface_tilt': 42.5152, 'tracker_theta': 31.6655},
123123
index=[0], dtype=np.float64)
124124

@@ -188,12 +188,27 @@ def test_SingleAxisTracker_tracking():
188188

189189
tracker_data = system.singleaxis(apparent_zenith, apparent_azimuth)
190190

191-
expect = pd.DataFrame({'aoi': 7.286245, 'surface_azimuth': 37.3427,
191+
expect = pd.DataFrame({'aoi': 7.286245, 'surface_azimuth': 142.65730 ,
192192
'surface_tilt': 35.98741, 'tracker_theta': -20.88121},
193193
index=[0], dtype=np.float64)
194194

195195
assert_frame_equal(expect, tracker_data)
196196

197+
### results calculated using PVsyst
198+
system.backtrack = False
199+
system.max_angle = 60.
200+
system.axis_tilt = 20.
201+
system.axis_azimuth = 200.
202+
apparent_azimuth = pd.Series([180+7.1609])
203+
apparent_zenith = pd.Series([90-27.315])
204+
tracker_data = system.singleaxis(apparent_zenith, apparent_azimuth)
205+
expect = pd.DataFrame({'aoi': 41.07852 , 'surface_azimuth': 180-18.432 ,
206+
'surface_tilt': 24.92122 , 'tracker_theta': -15.18391},
207+
index=[0], dtype=np.float64)
208+
209+
assert_frame_equal(expect, tracker_data)
210+
211+
197212

198213
def test_LocalizedSingleAxisTracker_creation():
199214
localized_system = tracking.LocalizedSingleAxisTracker(latitude=32,
@@ -254,7 +269,7 @@ def test_get_irradiance():
254269
surface_azimuth=tracker_data['surface_azimuth'])
255270

256271
expected = pd.DataFrame(data=np.array(
257-
[[ 142.71652464, 87.50125991, 55.21526473, 44.68768982,
272+
[[ 961.80070, 815.94490, 145.85580, 135.32820,
258273
10.52757492],
259274
[ nan, nan, nan, nan,
260275
nan]]),

pvlib/tracking.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,8 @@ def singleaxis(apparent_zenith, apparent_azimuth,
485485

486486
# 4. Rotate 0 reference from panel's x axis to it's y axis and
487487
# then back to North.
488-
surface_azimuth += 90 + axis_azimuth
488+
# surface_azimuth += 90+ axis_azimuth
489+
surface_azimuth = 90-surface_azimuth + axis_azimuth
489490

490491
# 5. Map azimuth into [0,360) domain.
491492
surface_azimuth[surface_azimuth<0] += 360

0 commit comments

Comments
 (0)
0