-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
75 lines (71 loc) · 2.97 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from StatisticalPerformanceMeasures import StatisticalPerformanceMeasures
OOtitle = "Observed Outflow (GPM)"
SOtitle = "Simulated Outflow (GPM)"
SPM = StatisticalPerformanceMeasures()
option = 0
OOI = SPM.getOutflowIndividual(OOtitle)
SOI = SPM.getOutflowIndividual(SOtitle)
OOA = SPM.getOutflowAll(OOtitle)
SOA = SPM.getOutflowAll(SOtitle)
while option == 0:
while True:
try:
option = int(input("Please choose an option\n1 - Get individual sheet calculations\n2 - Get combined sheet calculations\n3 - Get both options\nOption:"))
break
except ValueError:
print("Invalid input please try again")
if option <= 0 or option > 3:
option = 0
print("invalid option")
if option == 1:
for i in range(SPM.getNumSheets()):
print("\nSheet", i+1)
print("\nr =", SPM.calculate_r(OOI[i], SOI[i]),
"\nR^2 = ", SPM.calculateR2(OOI[i], SOI[i]),
"\nNSE =", SPM.calculateNSE(OOI[i], SOI[i]),
"\nd =", SPM.calculate_d(OOI[i], SOI[i]),
"\nRMSE = ", SPM.calculateRMSE(OOI[i], SOI[i]),
"\nMAE = ", SPM.calculateMAE(OOI[i], SOI[i]),
"\nMean RE = ", SPM.calculateMeanRE(OOI[i], SOI[i]),
"\nMedian RE =", SPM.calculateMedianRE(OOI[i], SOI[i]),
"\nRSR =", SPM.calculateRSR(OOI[i], SOI[i]),
"\nPBIAS =", SPM.calculatePBIAS(OOI[i], SOI[i]),
"\nSS = ", SPM.calculateSS(OOI[i], SOI[i]))
elif option == 2:
print("\nr =", SPM.calculate_r(OOA, SOA),
"\nR^2 = ", SPM.calculateR2(OOA, SOA),
"\nNSE =", SPM.calculateNSE(OOA, SOA),
"\nd =", SPM.calculate_d(OOA, SOA),
"\nRMSE = ", SPM.calculateRMSE(OOA, SOA),
"\nMAE = ", SPM.calculateMAE(OOA, SOA),
"\nMean RE = ", SPM.calculateMeanRE(OOA, SOA),
"\nMedian RE =", SPM.calculateMedianRE(OOA, SOA),
"\nRSR =", SPM.calculateRSR(OOA, SOA),
"\nPBIAS =", SPM.calculatePBIAS(OOA, SOA),
"\nSS = ", SPM.calculateSS(OOA, SOA))
elif option == 3:
for i in range(SPM.getNumSheets()):
print("\nSheet", i+1)
print("\nr =", SPM.calculate_r(OOI[i], SOI[i]),
"\nR^2 = ", SPM.calculateR2(OOI[i], SOI[i]),
"\nNSE =", SPM.calculateNSE(OOI[i], SOI[i]),
"\nd =", SPM.calculate_d(OOI[i], SOI[i]),
"\nRMSE = ", SPM.calculateRMSE(OOI[i], SOI[i]),
"\nMAE = ", SPM.calculateMAE(OOI[i], SOI[i]),
"\nMean RE = ", SPM.calculateMeanRE(OOI[i], SOI[i]),
"\nMedian RE =", SPM.calculateMedianRE(OOI[i], SOI[i]),
"\nRSR =", SPM.calculateRSR(OOI[i], SOI[i]),
"\nPBIAS =", SPM.calculatePBIAS(OOI[i], SOI[i]),
"\nSS = ", SPM.calculateSS(OOI[i], SOI[i]))
print("\nAll Sheets")
print("\nr =", SPM.calculate_r(OOA, SOA),
"\nR^2 = ", SPM.calculateR2(OOA, SOA),
"\nNSE =", SPM.calculateNSE(OOA, SOA),
"\nd =", SPM.calculate_d(OOA, SOA),
"\nRMSE = ", SPM.calculateRMSE(OOA, SOA),
"\nMAE = ", SPM.calculateMAE(OOA, SOA),
"\nMean RE = ", SPM.calculateMeanRE(OOA, SOA),
"\nMedian RE =", SPM.calculateMedianRE(OOA, SOA),
"\nRSR =", SPM.calculateRSR(OOA, SOA),
"\nPBIAS =", SPM.calculatePBIAS(OOA, SOA),
"\nSS = ", SPM.calculateSS(OOA, SOA))