Commit 1d9990e8 authored by Gerrit Erichsen's avatar Gerrit Erichsen

trying something to check bugginess

parent 02d796cd
......@@ -103,16 +103,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}
......@@ -337,7 +341,7 @@ if __name__ == '__main__':
fig1.subplots_adjust(wspace=0.3, hspace=0.3)
fig1.savefig(figFileName, dpi=600, format='png')
plt.close()
plt.clf()
fig1.clf()
if len(stations2) > 0:
fig2= plt.figure(figsize=(widthInInch, heightInInch))
......@@ -362,7 +366,7 @@ if __name__ == '__main__':
fig2.subplots_adjust(wspace=0.3, hspace=0.3)
fig2.savefig(figFileName, dpi=600, format='png')
plt.close()
plt.clf()
fig2.clf()
worstRMSE, worstMAE, worstMBE = findWorstStation(stations)
bestRMSE, bestMAE, bestMBE = findBestStation(stations)
......@@ -396,7 +400,7 @@ if __name__ == '__main__':
fig3.subplots_adjust(wspace=0.3, hspace=0.3)
fig3.savefig(figFileName, dpi=600, format='png')
plt.close()
plt.clf()
fig3.clf()
# plotting best -----------------------------------------------
figFileName = pathFigs + year + '_' + dataType + '_best.png'
heightInInch2 = heightInInch
......@@ -426,10 +430,12 @@ if __name__ == '__main__':
fig4.subplots_adjust(wspace=0.3, hspace=0.3)
fig4.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:
......
......@@ -213,7 +213,10 @@ class WeatherStation:
print(self.m_type, column, entries[column], self.m_measuredData)
lastHour = hour
counter += 1
if len(self.m_measuredData) < 8760:
supposedLength = 8760
if (int(targetYear) % 4 == 0):
supposedLength = 8784
if len(self.m_measuredData) < supposedLength:
print(self.m_name, 'only has', len(self.m_measuredData))
self.m_measuredData = []
......@@ -315,8 +318,8 @@ class WeatherStation:
# plt.legend()
# plt.show()
# plt.figure()
fig.scatter(valuesObs, valuesMod, s=0.5, color="tab:orange")
fig.plot(valuesObs, valuesObs)
fig.scatter(valuesObs, valuesMod, s=0.5, color="tab:blue")
fig.plot(valuesObs, valuesObs, color='k')
maxY = max(np.array(valuesObs).max(), np.array(valuesMod).max())
annotation = 'RMSE: %.1f\n' \
'MAE: %.1f\n' \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment