-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plotqt.py
190 lines (127 loc) · 4.42 KB
/
Plotqt.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# -*- coding: utf-8 -*-
"""
Created on Sun May 07 22:56:42 2017
@author: Jack
"""
import pandas as pd
import numpy as np
import datetime
from matplotlib import pyplot as plt
qTPA1=pd.read_csv('Temp_data\Archive\VS2DH_Archive_15\CalculatedSpecificDischarge.csv', sep= ',', header = None )
qTPA2=pd.read_csv('Temp_data\Archive\VS2DH_Archive_14\CalculatedSpecificDischarge.csv', sep= ',', header = None )
qTPB1= pd.read_csv('Temp_data\Archive\VS2DH_Archive_16\CalculatedSpecificDischarge.csv', sep= ',', header = None )
qTPC1=pd.read_csv('Temp_data\Archive\VS2DH_Archive_17\CalculatedSpecificDischarge.csv', sep= ',', header = None )
print 'TPA1 q=',np.average(qTPA1[1] ), 'm/s'
print 'TPA2 q=',np.average(qTPA2[1] ), 'm/s'
print 'TPB q=',np.average(qTPB1[1] ), 'm/s'
print 'TPC q=',np.average(qTPC1[1] ), 'm/s'
#get q from darcy
KA1=0.0088
KA2=0.034
KB1=0.079
KC1=0.05
dhA1 =pd.read_csv('Head_diferences,no_scaling\Proper_signs\HeadDiff1_PZCWSG.csv', sep= ',', header = None ) #first half of summer
dhA2 =pd.read_csv('Head_diferences,no_scaling\Proper_signs\HeadDiff2CW.csv', sep= ',', header = None ) #first half of summer
dhB1 =pd.read_csv('Head_diferences,no_scaling\Proper_signs\HeadDiff1CC.csv', sep= ',', header = None ) #first half of summer
dhC1 =pd.read_csv('Head_diferences,no_scaling\Proper_signs\HeadDiff1in.csv', sep= ',', header = None ) #first half of summer
dhA1[0]= pd.to_datetime(dhA1[0], format = '%m/%d/%Y %H:%M')
dhA2[0]= pd.to_datetime(dhA2[0], format = '%m/%d/%Y %H:%M')
dhB1[0]= pd.to_datetime(dhB1[0], format = '%m/%d/%Y %H:%M')
dhC1[0]= pd.to_datetime(dhC1[0], format = '%m/%d/%Y %H:%M')
ds= 0.3
qdA1 = KA1*dhA1[1]/ds
qdA2= KA2*dhA2[1]/ds
qdB1= KB1*dhB1[1]/ds
qdC1= KC1*dhC1[1]/ds
#qdA1 =qdA1.set_index( pd.to_datetime(dhA1[0], format = '%m/%d/%Y %H:%M'))
print 'dA1 q=',np.average(qdA1[1] ), 'm/d'
print 'dA2 q=',np.average(qdA2[1] ), 'm/d'
print 'dB q=',np.average(qdB1[1] ), 'm/d'
print 'dC q=',np.average(qdC1[1] ), 'm/d'
#
#fig = plt.figure()
#graph = fig.add_subplot(1,2,1)
#graph.plot( dhA1[0],qdA1)
#plt.xlabel('Date')
#plt.ylabel('q, m/d')
#plt.title('TPA1')
#graph = fig.add_subplot(1,2,2)
#graph.plot( dhA2[0],qdA2)
##import rain data, set dates as the index
RainGauge = pd.read_csv('Weather_EmbarrassMN_151017_161005.csv', sep= ',' )
RainGauge['Date']= pd.to_datetime(RainGauge['Date'], format='%m/%d/%Y')
RainGauge = RainGauge.set_index(['Date'])
#
#
#
##throw out non numeric rain data such as days of trace rainfall
RainGauge = RainGauge[RainGauge.PRCP !='M' ]
RainGauge = RainGauge[RainGauge.PRCP !='T' ]
#turn string data into float
RainGauge['PRCP'] =pd.to_numeric(RainGauge['PRCP'])
##plot TPA
fig = plt.figure()
ax2 = fig.add_subplot(2,1,2)
ax2.plot(RainGauge['PRCP'])
plt.xlabel('Date')
plt.ylabel('Rainfall, inches')
plt.title('Rainfall')
ax1 = fig.add_subplot(2,1,1,sharex=ax2)
ax1.plot(dhA1[0],qdA1)
plt.xlabel('Date')
plt.ylabel('q, m/d')
plt.title('TPA')
ax1.set_xlim([datetime.date(2016, 6,4), datetime.date(2016, 7, 25)])
#graph.set_xlim([datetime.date(2016, 6,4), datetime.date(2016, 7, 25)])
plt.show()
#plot B
fig = plt.figure()
ax2 = fig.add_subplot(2,1,2)
ax2.plot(RainGauge['PRCP'])
plt.xlabel('Date')
plt.ylabel('Rainfall, inches')
plt.title('Rainfall')
ax1 = fig.add_subplot(2,1,1,sharex=ax2)
ax1.plot(dhB1[0],qdB1)
plt.xlabel('Date')
plt.ylabel('q, m/d')
plt.title('TPB')
ax1.set_xlim([datetime.date(2016, 6,4), datetime.date(2016, 7, 25)])
plt.show()
#plotC
fig = plt.figure()
ax2 = fig.add_subplot(2,1,2)
ax2.plot(RainGauge['PRCP'])
plt.xlabel('Date')
plt.ylabel('Rainfall, inches')
plt.title('Rainfall')
ax1 = fig.add_subplot(2,1,1,sharex=ax2)
ax1.plot(dhC1[0],qdC1)
plt.xlabel('Date')
plt.ylabel('q, m/d')
plt.title('TPC')
ax1.set_xlim([datetime.date(2016, 6,4), datetime.date(2016, 7, 25)])
plt.show()
#all three q and rain
fig = plt.figure()
ax2 = fig.add_subplot(4,1,4)
ax2.plot(RainGauge['PRCP'])
plt.xlabel('Date')
plt.ylabel('Rainfall, inches')
plt.title('Rainfall')
ax1 = fig.add_subplot(4,1,1,sharex=ax2)
ax1.plot(dhC1[0],qdC1)
plt.ylabel('q, m/d')
plt.title('TPC')
ax1.set_xlim([datetime.date(2016, 6,4), datetime.date(2016, 7, 25)])
ax3 = fig.add_subplot(4,1,2,sharex=ax2)
ax3.plot(dhA1[0],qdA1)
plt.ylabel('q, m/d')
plt.title('TPA')
ax3.set_xlim([datetime.date(2016, 6,4), datetime.date(2016, 7, 25)])
ax4 = fig.add_subplot(4,1,3,sharex=ax2)
ax4.plot(dhB1[0],qdB1)
plt.ylabel('q, m/d')
plt.title('TPB')
ax4.set_xlim([datetime.date(2016, 6,4), datetime.date(2016, 7, 25)])
plt.show()