@@ -219,10 +219,6 @@ def ephemeris(time, location, pressure=101325, temperature=12):
219
219
----------
220
220
time : pandas.DatetimeIndex
221
221
location : pvlib.Location
222
-
223
- Other Parameters
224
- ----------------
225
-
226
222
pressure : float or DataFrame
227
223
Ambient pressure (Pascals)
228
224
@@ -232,26 +228,18 @@ def ephemeris(time, location, pressure=101325, temperature=12):
232
228
Returns
233
229
-------
234
230
235
- DataFrame with the following columns
236
-
237
- SunEl : float of DataFrame
238
- Actual elevation (not accounting for refraction)of the sun
239
- in decimal degrees, 0 = on horizon. The complement of the True Zenith
240
- Angle.
241
-
242
- SunAz : Azimuth of the sun in decimal degrees from North.
243
- 0 = North, 90 = West, 180 = South, 270 = West
244
-
245
- SunZen : Solar zenith angle
246
-
247
- ApparentSunEl : float or DataFrame
248
-
249
- Apparent sun elevation accounting for atmospheric
250
- refraction. This is the complement of the Apparent Zenith Angle.
251
-
252
- SolarTime : fload or DataFrame
253
- Solar time in decimal hours (solar noon is 12.00).
231
+ DataFrame with the following columns:
254
232
233
+ * elevation : actual elevation (not accounting for refraction) of the sun
234
+ in decimal degrees, 0 = on horizon. The complement of the zenith
235
+ angle.
236
+ * azimuth : Azimuth of the sun in decimal degrees East of North.
237
+ * zenith : Solar zenith angle
238
+ * apparent_elevation : apparent sun elevation accounting for atmospheric
239
+ refraction. This is the complement of the Apparent Zenith Angle.
240
+ * apparent_zenith : apparent sun zenith accounting for atmospheric
241
+ refraction.
242
+ * solar_time : Solar time in decimal hours (solar noon is 12.00).
255
243
256
244
References
257
245
-----------
@@ -274,10 +262,6 @@ def ephemeris(time, location, pressure=101325, temperature=12):
274
262
# This helps a little bit:
275
263
# http://www.cv.nrao.edu/~rfisher/Ephemerides/times.html
276
264
277
- pvl_logger .warning ('Using solarposition.ephemeris is discouraged. '
278
- 'solarposition.pyephem and solarposition.spa are '
279
- 'faster and more accurate.' )
280
-
281
265
pvl_logger .debug ('location={}, temperature={}, pressure={}' .format (
282
266
location , temperature , pressure ))
283
267
@@ -290,7 +274,7 @@ def ephemeris(time, location, pressure=101325, temperature=12):
290
274
# to be inverted for use in the code.
291
275
292
276
Latitude = location .latitude
293
- Longitude = 1 * location .longitude
277
+ Longitude = - 1 * location .longitude
294
278
295
279
Abber = 20 / 3600.
296
280
LatR = np .radians (Latitude )
@@ -388,7 +372,8 @@ def ephemeris(time, location, pressure=101325, temperature=12):
388
372
389
373
ApparentSunEl = SunEl + Refract
390
374
391
- DFOut = pd .DataFrame ({'elevation' : SunEl }, index = time )
375
+ DFOut = pd .DataFrame (index = time_utc ).tz_convert (location .tz )
376
+ DFOut ['elevation' ] = SunEl
392
377
DFOut ['azimuth' ] = SunAz
393
378
DFOut ['zenith' ] = SunZen
394
379
DFOut ['apparent_elevation' ] = ApparentSunEl
0 commit comments