Skip to content

Commit e354528

Browse files
committed
fix longitude. update docs. working?
1 parent 5c03d99 commit e354528

File tree

1 file changed

+14
-29
lines changed

1 file changed

+14
-29
lines changed

pvlib/solarposition.py

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,6 @@ def ephemeris(time, location, pressure=101325, temperature=12):
219219
----------
220220
time : pandas.DatetimeIndex
221221
location : pvlib.Location
222-
223-
Other Parameters
224-
----------------
225-
226222
pressure : float or DataFrame
227223
Ambient pressure (Pascals)
228224
@@ -232,26 +228,18 @@ def ephemeris(time, location, pressure=101325, temperature=12):
232228
Returns
233229
-------
234230
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:
254232
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).
255243
256244
References
257245
-----------
@@ -274,10 +262,6 @@ def ephemeris(time, location, pressure=101325, temperature=12):
274262
# This helps a little bit:
275263
# http://www.cv.nrao.edu/~rfisher/Ephemerides/times.html
276264

277-
pvl_logger.warning('Using solarposition.ephemeris is discouraged. '
278-
'solarposition.pyephem and solarposition.spa are '
279-
'faster and more accurate.')
280-
281265
pvl_logger.debug('location={}, temperature={}, pressure={}'.format(
282266
location, temperature, pressure))
283267

@@ -290,7 +274,7 @@ def ephemeris(time, location, pressure=101325, temperature=12):
290274
# to be inverted for use in the code.
291275

292276
Latitude = location.latitude
293-
Longitude = 1 * location.longitude
277+
Longitude = -1 * location.longitude
294278

295279
Abber = 20 / 3600.
296280
LatR = np.radians(Latitude)
@@ -388,7 +372,8 @@ def ephemeris(time, location, pressure=101325, temperature=12):
388372

389373
ApparentSunEl = SunEl + Refract
390374

391-
DFOut = pd.DataFrame({'elevation': SunEl}, index=time)
375+
DFOut = pd.DataFrame(index=time_utc).tz_convert(location.tz)
376+
DFOut['elevation'] = SunEl
392377
DFOut['azimuth'] = SunAz
393378
DFOut['zenith'] = SunZen
394379
DFOut['apparent_elevation'] = ApparentSunEl

0 commit comments

Comments
 (0)