-
Notifications
You must be signed in to change notification settings - Fork 0
/
gems_valplot.pro
125 lines (82 loc) · 2.4 KB
/
gems_valplot.pro
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
;pro GEMS_valplot
;============================
;
; 2018/05/23
; GEMS validation plot code
;
;============================
;============================
; read file
;============================
result_path = './plot/'
result_files = file_search(result_path+'outfile.txt', count=file_num)
for f = 0L, file_num-1 do begin
lines = file_lines(result_files(f))
if lines lt 5 then goto, file_out
data = fltarr(3,lines)
openr,1,result_files(f)
readf,1,data
close,1
xval = fltarr(lines)
xval[*] = reform(data[1,*])
yval = fltarr(lines)
yval[*] = reform(data[2,*])
file_out :
endfor
;============================
; set plotting parameters
;============================
minv = 0.0 ;; set minimum value of x, y axis
maxv = 3.0 ;; set maximum value of x, y axis
delta = 0.03 ;; set histogram interval of x, y axis
cgPS_Open, 'test.ps'
cgDisplay, aspect=1
LoadCT, 33, Ncolors=254, Bottom=1
position = [0.15, 0.15, 0.85, 0.9]
thick = (!D.Name EQ 'PS') ? 6 :3
x_para = xval
y_para = yval
X_name = 'AERONET_AOD [443nm]'
Y_name = 'GEMS_AOD [443nm]'
cgPlot, x_para, y_para, /NoData, $
XTitle = X_name, YTitle = Y_name, $
XRange = [minv, maxv], YRange = [minv, maxv], $
Position=position, Charsize=2.0, $
XThick=3.0, YThick=3.0, Thick=6.0, /NoErase
linfit_xdata=findgen(200)-100
back_eq1 = linfit_xdata*1.
oplot, linfit_xdata, back_eq1, color=0, linestyle=1
;============================
; plot histogram
;============================
for j = minv, maxv, delta do begin
for i = minv, maxv, delta do begin
;; delta ±¸°£³»¿¡ ÀÖ´Â data °¹¼ö ã±â
idx_histo= where(yval ge j $
and yval lt j+delta $
and xval ge i $
and xval lt i+delta, idx_histo_num)
xbox = [i, i+delta, i+delta, i]
ybox = [j, j, j+delta, j+delta]
if idx_histo_num gt 0.0 then begin
print, i, j, idx_histo_num
polyfill, xbox, ybox, $
color = bytscl(idx_histo_num, min=0.0 ,max=5.0, top=254)
endif
endfor
endfor
cgColorbar,format='(i4)', $
range=[0.0,5.0], $
position=[0.87, 0.15, 0.9, 0.9],$
color=0, $
/vertical,$
/right, $
divisions=5, $
bottom=1, $
ncolor=254, $
minor=1, $
Charsize=2
cgPS_Close
cgPS2Raster, 'test.ps', result_path+ 'GEMSAODval_20050101-20051231_histo.png',density =1000,/png
stop
end