|
25 | 25 |
|
26 | 26 | from pvlib import atmosphere, tools |
27 | 27 | from pvlib.tools import datetime_to_djd, djd_to_datetime |
28 | | -from pvlib._deprecation import renamed_kwarg_warning |
29 | 28 |
|
30 | 29 |
|
31 | 30 | def get_solarposition(time, latitude, longitude, |
@@ -1347,21 +1346,15 @@ def solar_zenith_analytical(latitude, hourangle, declination): |
1347 | 1346 | ) |
1348 | 1347 |
|
1349 | 1348 |
|
1350 | | -@renamed_kwarg_warning("0.11.2", "times", "time", "0.12.0") |
1351 | | -def hour_angle(time, longitude, equation_of_time): |
| 1349 | +def hour_angle(times, longitude, equation_of_time): |
1352 | 1350 | """ |
1353 | 1351 | Hour angle in local solar time. Zero at local solar noon. |
1354 | 1352 |
|
1355 | 1353 | Parameters |
1356 | 1354 | ---------- |
1357 | | - time : :class:`pandas.DatetimeIndex` |
| 1355 | + times : :class:`pandas.DatetimeIndex` |
1358 | 1356 | Corresponding timestamps, must be localized to the timezone for the |
1359 | 1357 | ``longitude``. |
1360 | | -
|
1361 | | - .. versionchanged:: 0.11.2 |
1362 | | - The ``times` parameter has been renamed ``time``. The deprecated |
1363 | | - ``times`` parameter will be removed in ``v0.12.0``. |
1364 | | -
|
1365 | 1358 | longitude : numeric |
1366 | 1359 | Longitude in degrees |
1367 | 1360 | equation_of_time : numeric |
@@ -1389,14 +1382,14 @@ def hour_angle(time, longitude, equation_of_time): |
1389 | 1382 | equation_of_time_pvcdrom |
1390 | 1383 | """ |
1391 | 1384 |
|
1392 | | - # time must be localized |
1393 | | - if not time.tz: |
1394 | | - raise ValueError('time must be localized') |
| 1385 | + # times must be localized |
| 1386 | + if not times.tz: |
| 1387 | + raise ValueError('times must be localized') |
1395 | 1388 |
|
1396 | | - # hours - timezone = (time - normalized_time) - (naive_time - time) |
1397 | | - tzs = np.array([ts.utcoffset().total_seconds() for ts in time]) / 3600 |
| 1389 | + # hours - timezone = (times - normalized_times) - (naive_times - times) |
| 1390 | + tzs = np.array([ts.utcoffset().total_seconds() for ts in times]) / 3600 |
1398 | 1391 |
|
1399 | | - hrs_minus_tzs = _times_to_hours_after_local_midnight(time) - tzs |
| 1392 | + hrs_minus_tzs = _times_to_hours_after_local_midnight(times) - tzs |
1400 | 1393 |
|
1401 | 1394 | return 15. * (hrs_minus_tzs - 12.) + longitude + equation_of_time / 4. |
1402 | 1395 |
|
|
0 commit comments