File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 11Latitude (decimal degrees): 45.000
22Longitude (decimal degrees): 8.000
33Elevation (m): 250.0
4+ Irradiance Time Offset (h): 0.1761
45month,year
561,2018
672,2007
Original file line number Diff line number Diff line change @@ -559,11 +559,17 @@ def _parse_pvgis_tmy_csv(src):
559559 inputs ['longitude' ] = float (src .readline ().split (b':' )[1 ])
560560 # Elevation (m): 1389.0\r\n
561561 inputs ['elevation' ] = float (src .readline ().split (b':' )[1 ])
562- # Irradiance Time Offset (h): 0.1761\r\n
563- inputs ['irradiance time offset' ] = float (src .readline ().split (b':' )[1 ])
562+
563+ # TMY has an extra line here: Irradiance Time Offset (h): 0.1761\r\n
564+ line = src .readline ()
565+ if line .startswith (b'Irradiance Time Offset' ):
566+ inputs ['irradiance time offset' ] = float (line .split (b':' )[1 ])
567+ src .readline () # skip over the "month,year\r\n"
568+ else :
569+ # `line` is already the "month,year\r\n" line, so nothing to do
570+ pass
564571 # then there's a 13 row comma separated table with two columns: month, year
565- # which contains the year used for that month in the
566- src .readline () # get "month,year\r\n"
572+ # which contains the year used for that month in the TMY
567573 months_selected = []
568574 for month in range (12 ):
569575 months_selected .append (
You can’t perform that action at this time.
0 commit comments