Skip to content

Commit 162e712

Browse files
committed
use timezone as arg, change output to timezone
1 parent feb1f36 commit 162e712

File tree

4 files changed

+26
-23
lines changed

4 files changed

+26
-23
lines changed

pvlib/solarposition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def spa_c(time, latitude, longitude, pressure=101325, altitude=0,
206206
spa_df = pd.DataFrame(spa_out, index=time)
207207

208208
if raw_spa_output:
209-
return spa_df
209+
return spa_df.rename(columns={'time_zone': 'timezone'})
210210
else:
211211
dfout = pd.DataFrame({'azimuth': spa_df['azimuth'],
212212
'apparent_zenith': spa_df['zenith'],

pvlib/spa_c_files/spa_py.c

Lines changed: 22 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pvlib/spa_c_files/spa_py.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cimport cspa_py
22

3-
def spa_calc(year, month, day, hour, minute, second, time_zone, latitude,
3+
def spa_calc(year, month, day, hour, minute, second, timezone, latitude,
44
longitude, elevation, pressure, temperature, delta_t,
55
delta_ut1=0, slope=30.0, azm_rotation=-10, atmos_refract=0.5667):
66

@@ -12,7 +12,7 @@ def spa_calc(year, month, day, hour, minute, second, time_zone, latitude,
1212
spa.hour = hour
1313
spa.minute = minute
1414
spa.second = second
15-
spa.time_zone = time_zone
15+
spa.time_zone = timezone
1616
spa.delta_ut1 = delta_ut1
1717
spa.delta_t = delta_t
1818
spa.longitude = longitude

pvlib/spa_c_files/spa_py_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
def spa_calc_example(test=True):
3636
result = spa_calc(
3737
year=2004, month=10, day=17, hour=12, minute=30, second=30,
38-
time_zone=-7, longitude=-105.1786, latitude=39.742476,
38+
timezone=-7, longitude=-105.1786, latitude=39.742476,
3939
elevation=1830.14, pressure=820, temperature=11, delta_t=67
4040
)
4141
if test:

0 commit comments

Comments
 (0)