...
 
Commits (2)
......@@ -113,16 +113,20 @@ def findStationId(stations, stationId):
return -1
if __name__ == '__main__':
dataType = 'solar' #either solar, temperature or wind
dataType = 'wind' #either solar, temperature or wind
dataTypeShort = ''
dataTypeShort2 = ''
startYear = 2011
endYear = 2017
# while for map creation the loop for each year in range was quite
# successful, it had its problems with the statistics part creating
# accurate plots so for the statistic plots,
# the limits were set to one year only
startYear = 2015
endYear = 2015
path = 'D:/WetterdatenCDC'
path2 = 'D:/WetterdatenPamore'
pathFigs = 'J:/wka/user/erichsen/DataDocumentation/images/'
validate = True
createMap = True
createMap = False
font = {'family' : 'Cambria',
'weight' : 'normal',
'size' : 10}
......@@ -349,7 +353,7 @@ if __name__ == '__main__':
figStat.subplots_adjust(wspace=0.3, hspace=0.3)
figStat.savefig(figFileName, dpi=600, format='png')
plt.close()
plt.clf()
fig1.clf()
if len(stations2) > 0:
figStat2= plt.figure(figsize=(widthInInch, heightInInch))
......@@ -374,7 +378,7 @@ if __name__ == '__main__':
figStat2.subplots_adjust(wspace=0.3, hspace=0.3)
figStat2.savefig(figFileName, dpi=600, format='png')
plt.close()
plt.clf()
fig2.clf()
#finding out, who did worst/best -----------------------------------
worstRMSE, worstMAE, worstMBE = findWorstStation(stations)
......@@ -409,7 +413,7 @@ if __name__ == '__main__':
figScatterW.subplots_adjust(wspace=0.3, hspace=0.3)
figScatterW.savefig(figFileName, dpi=600, format='png')
plt.close()
plt.clf()
fig3.clf()
# plotting best ----------------------------------------------------
figFileName = pathFigs + year + '_' + dataType + '_best.png'
heightInInch2 = heightInInch
......@@ -439,10 +443,12 @@ if __name__ == '__main__':
figScatterB.subplots_adjust(wspace=0.3, hspace=0.3)
figScatterB.savefig(figFileName, dpi=600, format='png')
plt.close()
plt.clf()
fig4.clf()
#- year's statistics ---------------------------------------------------
if createMap:
widthInInch = 16 / 2.54 # might not be defined by now
heightInInch = 8 / 2.54 # dito
figFileName = pathFigs + year + '_' + dataType + '_map.png'
if dataType == 'temperature':
with h5py.File(fileNameH5, 'r') as h5File:
......
......@@ -244,8 +244,11 @@ class WeatherStation:
print(self.type, column, entries[column], self.observationData)
lastHour = hour
counter += 1
if len(self.observationData) < 8760:
print(self.name, 'only has', len(self.observationData))
supposedLength = 8760
if (int(targetYear) % 4 == 0):
supposedLength = 8784
if len(self.observationData) < supposedLength:
print(self.m_name, 'only has', len(self.observationData))
self.observationData = []
def readInModelFile(self, h5FileName, dataType, h5FileName2 = '', \
......