-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_uvwndts_csv_sctr_msk.py
More file actions
69 lines (53 loc) · 1.7 KB
/
plot_uvwndts_csv_sctr_msk.py
File metadata and controls
69 lines (53 loc) · 1.7 KB
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
import csv
import datetime
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.dates import HourLocator, DayLocator, DateFormatter
from datetime import datetime
dt,uw,vw = [],[],[]
dt1,uw1,vw1 = [],[],[]
msk_uw, msk_vw = [],[]
msk_uw1,msk_vw1= [],[]
#csv_reader = csv.reader(open('ascat_sort_20150330.csv'), delimiter='\t')
#columns = list(zip(*csv_reader))
#print columns
#col_2 = [x[1] for x in csv_reader]
#print x
file = open('asct_sort_201503.csv','rU')
for line in file:
cells = line.split( "\t" )
dt.append((cells[0]))
uw.append((cells[1]))
vw.append((cells[2]))
file.close()
file1 = open('rsct_sort_201503.csv','rU')
for line1 in file1:
cells1 = line1.split( "\t" )
dt1.append((cells1[0]))
uw1.append((cells1[1]))
vw1.append((cells1[2]))
file1.close()
#print dt1, uw1
uw_x = np.ma.array(uw,dtype=float)
uw1_x = np.ma.array(uw1,dtype=float)
vw_x = np.ma.array(vw,dtype=float)
vw1_x = np.ma.array(vw1,dtype=float)
msk_uw = np.ma.masked_where(abs(uw_x) > 10, uw_x)
msk_uw1 = np.ma.masked_where(abs(uw1_x) > 10, uw1_x)
msk_vw = np.ma.masked_where(abs(vw_x) > 10, vw_x)
msk_vw1 = np.ma.masked_where(abs(vw1_x) > 10, vw1_x)
#ham_uw = smooth(uw_x,90)
#ham_uw1 = smooth(uw1_x,90)
#win_len = 60
#ham_uw = han_smoother(uw_x, window_len=win_len)
#ham_uw1 = han_smoother(uw1_x, window_len=win_len)
dt_time = [datetime.strptime(tim_temp,'%Y%m%d%H%M') for tim_temp in dt]
print dt_time
plt.scatter(msk_uw, msk_uw1, color = 'blue',alpha=0.5 )
plt.plot([-20,25], [-20,25], color='black', alpha=0.5, linestyle='--')
plt.axis([-20,25,-20,25])
plt.title('VWind Scatter plot Mar 2015')
plt.xlabel('Ascat:v_290')
plt.ylabel('Rscat:v_285')
#plt.locator_params(axis='x', nticks=30)
plt.show()