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 1
1
Latitude (decimal degrees): 45.000
2
2
Longitude (decimal degrees): 8.000
3
3
Elevation (m): 250.0
4
+ Irradiance Time Offset (h): 0.1761
4
5
month,year
5
6
1,2018
6
7
2,2007
Original file line number Diff line number Diff line change @@ -559,11 +559,17 @@ def _parse_pvgis_tmy_csv(src):
559
559
inputs ['longitude' ] = float (src .readline ().split (b':' )[1 ])
560
560
# Elevation (m): 1389.0\r\n
561
561
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
564
571
# 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
567
573
months_selected = []
568
574
for month in range (12 ):
569
575
months_selected .append (
You can’t perform that action at this time.
0 commit comments