Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kandersolar committed Feb 21, 2025
1 parent dabe7b5 commit d12d4b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions pvlib/data/tmy_45.000_8.000_2005_2023.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Latitude (decimal degrees): 45.000
Longitude (decimal degrees): 8.000
Elevation (m): 250.0
Irradiance Time Offset (h): 0.1761
month,year
1,2018
2,2007
Expand Down
14 changes: 10 additions & 4 deletions pvlib/iotools/pvgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,11 +559,17 @@ def _parse_pvgis_tmy_csv(src):
inputs['longitude'] = float(src.readline().split(b':')[1])
# Elevation (m): 1389.0\r\n
inputs['elevation'] = float(src.readline().split(b':')[1])
# Irradiance Time Offset (h): 0.1761\r\n
inputs['irradiance time offset'] = float(src.readline().split(b':')[1])

# TMY has an extra line here: Irradiance Time Offset (h): 0.1761\r\n
line = src.readline()
if line.startswith(b'Irradiance Time Offset'):
inputs['irradiance time offset'] = float(line.split(b':')[1])
src.readline() # skip over the "month,year\r\n"
else:
# `line` is already the "month,year\r\n" line, so nothing to do
pass
# then there's a 13 row comma separated table with two columns: month, year
# which contains the year used for that month in the
src.readline() # get "month,year\r\n"
# which contains the year used for that month in the TMY
months_selected = []
for month in range(12):
months_selected.append(
Expand Down

0 comments on commit d12d4b6

Please sign in to comment.