390 likes | 593 Vues
??????. ??:?????:??????????:???????302 ??????????307????:13553001635Email: mengxf@ouc.edu.cn. ????. ???????,??????????,??????????? ????Matlab, ????GrADS(?????). ????. ??????????????,??????????????????????????,???????????????????????????????????????????????????,???????????????????.
E N D
1. ??????????
3. ???? ????
???,??????
????,?????
??????????Matlab,????GrADS(?????)
4. ???? ??????????????,??????????????
????????????,???????????????????????????????????????
????????????,???????????????????
5. ????????1 Ascii?;2?????;3 netcdf??;
???????????1 Fortran???????;2 Matlab???????
??????1 Graher ;2 Surfer ;3 Matlab;
??????1 GrADS;2 FERRET ????
6. ???? Grapher2.doc
Surfer7.doc
Surfer8?????????.doc
MATLAB ????,??????
GrADS??????????
GrADS????grads-ug.pdf
FERRET USERS GUIDEferret_users_guide_v602.pdf
7. ???? ?????30%
?????20%??,?????
?????50%????,????,???????
8. ??? ?? ????????????
??????
??????
9. ??????????????????????,???????????????????
10. ?????? Grapher, Surfer, Matlab, Origin?
Grapher????????
Surfer????????
Matlab?????????
11. ?????? ??????????????????????
GrADS, FERRET,GMT?
12. ??? ???? ????????
??????
13. ???????? ??????,?????,??,???,???,?????????????,?????;????,????????:?????(?)??????,?????????,???ASCII??????????????????????
14. ???????? ????????,??,??,???
???????????????????????,??????
???????????????????????????????????????Levitus, COADS, HadSST??????????,??:????(?)???????,??(??????)??????????????,???????Netcdf?????????????????????
15. ?????????? ASCII?(????)??????????????????,????,?????????
??????????????????????????????????(??????,????????????????)
NetCDF?????????????????????????(?????????????)
16. ?? ???????????????????,Grapher, Surfer, Matlab, Netcdf for Matlab, Fortran, GrADS, Ferret
???(???????????????,???????),????????ETOPO5, Levitus, COADS, Hadley SST, AVHRR SST, SODA, ECCO?
17. ??????????
18. ????????????? ????,???,???,?????
??????
????,????,????,???????????????????????????
????????????????
19. ?????? Grapher, Surfer, Matlab, Origin?
Grapher????????
Surfer????????
Matlab?????????
20. Grapher?????? ??Colorado?Golden Software???????????, ?????????,????????????
21. ????1 ???(???)????(line/symbol)??:?Levitus???????????(???????????????)??????????:?Levitus????180E,EQ??????????????:?Levitus????180E, 30S(/ EQ /30N), 30m??????????:?TOGA-TAO?????????????????????
24. ????2 ?????(hi-low-close) ???????5?????:???????????2005?1???
25. ??2 ????????????????????, ???????,????????
26. ????3 ??pie
?? bar??:????????????????,50???2?,51-60?3?,61-70?7?,71-80?15?,81-90?10?,91-10?3?,????????????????????????
??:??????????,??????
34. Surfer?????? ?Grapher??,Surfer????Colorado?Golden Software???????????, ??????????,???????(?????????????????,????????????????( *.grd )??: ???????,?????????????
??????????????????????? *.grd, *.bln,*.CSB?
35. ????*.grd????? GS ASCII?
GS ???(??)
Surfer7.grd
36. ???? ????
???????,??Surfer???????? *.grd
(Blank??)
??
37. ????1 ??? (contour)?test.dat????
??:?1939?8?????????????,?????,???????1?C,??5?C?????
38. ????2 ???(vector) ?????1??2?*.grd??
?test.grd????
39. ????3 ????(base) ?????*.bln, *.csb??
?world.bln ?world0360.bln????
40. *.bln????? Length, flag
5,1 ?????(5),??(1,?????????blank?,0?????blank?)
X1,y1
X2,y2
X3,y3
X4,y4
X5,y5
41. ????4 ???????blank??????*.grd, *.bln
?test.grd????
42. ????5 ???(wireframe)
?sample3.dat????
43. ????6 ???(image map)
?sample3.dat????
44. ????7 ?????(shaded relief map)
?sample3.dat????
45. ????8 2??????,????????
????(stack maps)
????(Overlay maps)
?sample3.dat????
54. Matlab?????? Matlab??Matrix Laborotory (?????)??? MathWorks????,???????,???????????????1984???1.0?,??????2006?
Matlab????????????????????????????????????????????????
55. MATLAB??? 1. ????
2. ??????????(Windows,Linux?)
3. ??????
4. ???????
5.??????????
6. ???????????????Mathematics, Maple?
56. MATLAB??? ??????
??MATLAB???????,??,??????????,?MATLAB??????????????????(???????? )
?????
????????????????????,??MATLAB?????????????????????????????
57. MATLAB ????
58. MATLAB ????? ????
? MATLAB ????????,????????????????:?? MATLAB ???? File | Set Path ??,??????????
59. Netcdf for MATLAB ??? ??netcdf toolbox.rar(??????????matlab????????,??????)
????.?Matlab? File - Set path - Add with subfolders ????????????mexcdf53_pcwin ? netcdf ???;
? mexcdf53_pcwin\PCWIN ????dll?????MATLAB?? \bin\win32 ???
60. Matlab?????? ????command window?????
???????*.m??
61. ???????
62. ??????
63. Matlab????(????????????????) ??????? ????,??????????????????
???????
64.
65. Matlab?? ??????? ???????????(???)?? ????????? ASCII????? ???????? Netcdf?????
???????
????
66. ASCII????? ?? load ??\??? (*.dat, *.txt, *.mat(???????,????load??))
? aa=load(??\??? ); ?????????,?????aa
? fid=fopen(??\??? ,r)data=fscanf(fid,%f)?????????,?????data
67. ???????? fid=fopen('etopo5.gds','rb');
all=fread(fid,[4320,2161],'float32');
contour(all)
?
all=fread(fid,inf,float32);
rose=reshape(all,4320,2161);
contour(rose)
68. Netcdf????? ncload('etopo120.cdf');
?
file=???\???.cdf';
aa=netcdf(file);
aa{1} %??????????
.
aa{n}
69. ??????? ???????
70. (2)??????? ???????
71. (3)??????? plot(y)
plot(x,y)
plot(x,y1,x,y2,)
plot(x,y1,r:,x,y2,)
72. ????? scatter(x,y) ???????
scatter(x,y,z)??x,y????????z???
scatter3(x,y,z)
scatter(x,y,s) s ??,???? rd
scatter(...,filled) ???????
73. ??????? >> x= 0:0.01:10;
>> y=tan(x);
>> plot(x,y)
>>
74. ????????????? ?????????????????
75. ?????? axis([xmin xmax ymin ymax]
axis([xmin xmax ymin ymax zmin zmax]
axis tight ????????????
axis ij ??????,??????
axis xy ????
axis on/off
76. ???????? subplot?? ???????????:
>> x = 0:0.1:20;
>> subplot(2,2,1)
>> plot(x,sin(x));
>>
subplot(m,n,p)
m?,n?,?p???subplot(m,n,1:2)subplot(2,2,[1 3])subplot(2,2,2)subplot(2,2,4)
77. 2. ???? ????? title(.)
?????? xlabel(), ylabel()
???????????? text() gtext()
????? legend(,,)
??????? grid on/off
78. (1) ????? ?MATLAB?,??????3??????????:
??Insert ????Title??;
???????(Property Editor);
??title???
79. ????? >> x = 0:.1:2;
>>y1=sin(x);
>>y2 = sin(x-0.25);
>>y3 = sin(x-0.5);
>> plot(x,y1,'-.b', x,y2,'--r*', x,y3,'-.gh')
>> title('There three lines')
>>
80. (2) ?????? ??????3??????????????:
??Insert????Label??;
???????(Property Editor);
??MATLAB ???????;
81. ?????????? ???????(Property Editor)???????
??Tools??,??Edit Plot??,?????????
???????????,???????;????????????,?????????Properties ???????????;????View?????Property Editor??
82. (3)???????????? ?????MATLAB???????????????,???????????????MATLAB ???text???gtext????????????gtext???????????,???????????? text(x,y,)gtext()
83. ?????? >> x=linspace(-3,5,100);
>> y=cos(x);
>> z=sin(x);
>> plot(x,y,x,z)
>> title('?????????????')
>> xlabel('x?????')
>> ylabel('Y?Z??')
>>
84. (4)????? ???????????????,??????????,???????????????????????3???????:
??Insert ??????Legend??;
???????legend??;
??legend???legend str1,str2,str3, legend(str1,str2,str3), legend off, legend hide, legend show, legend(,pos), pos=1,2,3,4,-1??????????,??????,???,???
85. ????? ??
86. (5)??????? ????????,???????????????,???????????,MATLAB ??????grid?????????:
grid off????????;
grid on????????;
grid minor??????????;
87. ????????? >> x=linspace(-5,5,100);
>> y=x.^4+22*x.^2-6*x+10;
>> plot(x,y)
>> grid on
>>
88. 3. ??????? ??????plot3(x,y,z) plot3(x,y,z,s)
?????????
????? mesh(z), mesh(x,y,z),mesh(x,y,z,c)meshc?????????meshz??????????
????? surf(z),surf(x,y,z), surfc
????????? waterfall,????mesh
meshgrid ?????????????
>> x=[1:1:50];y=[1:1:50];
>> [X Y]=meshgrid(x,y);
89. (1)??????plot3 >> % ???????????????
>> t = 0:pi/50:20*pi;
>> plot3(sin(t),cos(2*t),sin(t)+cos(t))
90. (2) ????? ??mesh???????????:
>> z=peaks(50);
>> mesh(z);
>>
91. (3)????? ???surf??????????? :
>> [X,Y]=meshgrid([-4:0.2:4]);
>> Z=exp(-0.5*(X.^2-Y.^2));
>> surf(X,Y,Z)
>>
92. ?????? ???????(bar and area Graphs)
???(pie Charts)
???(hist)
??????(stem, stairs)
????????? (compass,quiver,quiver3,feather?)
??????(contour Plots)
93. (1)??????? ??????????????????,????????????????????????????,??????????????,??????????????
94. bar(???)??
>> y=[1 2 3 4 5 6 7 8 9 10]
>>bar(y)
95. ?? ?????????????
????pie pie(x),pie(x,e),pie(x,e,labels)????pie3
??x??<1,?x???????????????,???????????
pie(x,explode,labels)
pie([1 3 5 3],[0 1 0 0],{a,b,c,d}) ?? ???????????? ????
96. ??? ?????????
n=hist(y), ?????y????10?
n=hist(y,n),?????y????n?
??:?????????[n,xout]=hist(y,n)bar(xout,n)??bar????????
97. (3)??????
stem ??(???)stem(Y),stem(X,Y)
stem3??stem3(Z),stem3(X,Y,Z)
stairs??(???) stairs(Y),stairs(X,Y)
98. ???????? ?? stem(y)?????????? ?
>> y=rand(20,1);
>> stem(y)
>>
99. (4)????????? compass?feather?quiver?quiver3?
100. ??????????? ?compass???????? :
>> w=0:0.1:6;
>> z=sin(w).*exp(j*w);
>> compass(z)
>>
101. (5)?????? ???????????????????????
102. ?????? contour(z),contour(x,y,z)
contour(z,n) n??????
contour(z,v) v?????????, ????????[1 3 5 6]
>> [x,y,z]=peaks;
>> [c,h]=contour(x,y,z)
>> clabel(c) %????????
103. ???????? ??contour?????????:
>> [x,y,z]=peaks;
>> contour(x,y,z)
>>
104. ?????????? ??contourf?????????:
>> [x,y,z]=peaks;
>> contourf(x,y,z,20)
>> colorbar
105. ?????? colorbar(horiz) % ?????
colorbar(vert) % ?????
106. ????????(1) ??Levitus???????????????????(??: ???????????),????????????
107. ????????(2)???????????? (??????????)???????????????????????,
??Matlab??????????
1.???????,??,???1,???2,.
2.???????????????
xi=linspace(xmin,xmax,nx); yi=linspace(y1,y2,ny);
3.[XI YI]=meshgrid(xi,yi)
4.[XI YI ZI]=griddata(x,y,z1,XI,YI)
5.contour(ZI)
??: ????????????????????:?????*.bln,????Surfer?Grid blank????GS ASCII *.grd??,??????Matlab???/???????Nan,????
108. ????? http://rimmer.ngdc.noaa.gov/mgg/coast/getcoast.html
???????????,
?????????bln??, ?????????mat_to_bln.for
109. Ferret?????? Ferret??????NOAA/PMEL/ TMAP (National Oceanic and Atmospheric Administration/ Pacific Marine Environment Laboratory/the Thermal Modeling and Analysis Project,?????????)??????????????????????
?????????????????????????????
110. ?? ???????,?????
????, EOF,FFT,??,??,????
????,??,??,??????,?????
??,???????????, ???Ferret?????????,??????????
111. ???? ??????????,???????????,???,???,???,????,??????,raster(??),???,????,??????
????????(??Grads)
????????, ????????
112. Ferret?? ??????????
????,??????Matlab,??????
????????,???????????
????????????(Ferret?????????Netcdf??,?Grads?Netcdf?????????,?????????????)
???????? shaded sst; con rose,cont rose(?????????)
???? ????(ferret.jnl)????????, ??????????????????? (*.jnl?????,??GrADS?*.gs,Matlab?*.m??)
113. ?? ??ferret??,??????xwindows,?????????(?????????Grads,???GrADS???xwindows???.)
???????Ferret,????Ferret?????,Thinking like a Ferret (?????????)
114. Ferret Ferret(????)??????,?????????????C:\Program Files\TMAP\fer_dsets\data\??etopo20.cdf, etopo40.cdf, etopo60.cdf, etopo120.cdf, levitus_climatology.cdf, coads_climatology.cdf, esku_heat_budget.cdf, monthly_navy_winds.cdf, polydata.cdf?
????Ferret??????
115. ??????? Ferret????ASCII???,???????,???????????(??????????Netcdf??,?????*.nc? *.cdf;?????TMAP???????).
?Netcdf???????Ferret????????.
116. ????????? set data ??ASCII????????
file/var=var1,var2, filename
file=set data/ez
Netcdf?????
use filename(.cdf) (??set data filename.cdf)
use=set data/format=cdf
117. ASCII????? ????file/variable=aa d:\aa.datplot aa
????file/col=2/vars=aa,bb d:\aabb.datfile/col=n/vars=z1,z2,,zn d:\z.dat
file_reading_demo.jnl
118. ???????? ????????????????????
binary_read_demo.jnl
119. Fortran??????????????????? REAL VARI(10), VAR2(10), VAR3(10)
...
OPEN(UNIT=20,FORMAT='UNFORMATTED',ACCESS='SEQUENTIAL',FILE='MYFILE.DAT')
...
DO 10 I=1,10
WRITE (20) VAR1(I), VAR2(I), VAR3(I)
10 CONTINUE
...
set data/ez/FORMAT=UNF/VAR=var1,var2,var3/col=3 myfile.dat ?? (??\???)
file/FORMAT=UNF/VAR=var1,var2,var3/columns=3 myfile.dat
120. ???????Fortran?????????????? real VAR1(1000), VAR2(500)
...
OPEN(UNIT=20,FORMAT='UNFORMATTED',ACCESS='SEQUENTIAL',FILE='MYFILE.DAT')
...
WRITE (20) VAR1
WRITE (20) VAR2
....
DEFINE AXIS/X=1:500:1 xaxis
DEFINE GRID/X=XAXIS mygrid
FILE/FORMAT=stream/SKIP=1003/GRID=mygrid/VAR=var2 myfile.dat
1003????1?1000????2?????(2????1?????,??????2?????)The argument 1003 is the sum of the 1000 data words in record 1, plus 2 words of record length information surrounding the data values in record 1 (variable var1), plus 1 word of record information preceding the data in record 2.
121. ????????? REAL VARI(10), VAR2(10), VAR3(10)
...
OPEN(UNIT=20,FORMAT='UNFORMATTED',ACCESS=Direct',FILE='MYFILE.DAT')
...
DO 10 I=1,10
WRITE (20,rec=i) VAR1(I), VAR2(I), VAR3(I)
10 CONTINUE
...
file/format=stream/var=var1,var2,var3 myfile.dat
122. ????????? REAL*4 MYVAR(10,5)
...
OPEN(UNIT=20, FILE="myfile.dat", ACCESS="DIRECT", RECL=10)
...
DO 100 j = 1, 5
100 WRITE (20,REC=j) (MYVAR(i,j),i=1,10)
....
DEFINE AXIS/X=1:10:1 x10
DEFINE AXIS/Y=1:5:1 y5
DEFINE GRID/X=x10/Y=y5 g10x5
FILE/VAR=MYVAR/GRID=g10x5/FORMAT=stream myfile.dat
If the file consisted of a set of FORTRAN REAL*8 or C doubles, then the data would look like:
dddddddd dddddddd dddddddd ...
and the following Ferret commands would read the data into "myvar":
DEFINE AXIS/X=1:10:1 x10
DEFINE AXIS/Y=1:5:1 y5
DEFINE GRID/X=x10/Y=y5 g10x5
FILE/VAR=MYVAR/GRID=g10x5/FORMAT=stream/type=r8 myfile.dat
123. ??????????? ???????,?????x,y,z,t??,??,???????????,??????
...
def axis/x=1:nx:1 xax
def axis/y=1:ny:1 yax
def axis/z=1:nz:1 zax
def axis/t=1:nt:1 tax
def grid/x=xax/y=yax/z=zax/t=tax mygrid
file/format=stream/var=num,num1/grid=mygrid ($file)
124. Netcdf????? use ????\???
set data ????\???
125. ????n?? ???? use ???(???Netcdf????)set data ??? (??????????)
?????????? set region/x/y/z/t/I/j/k/l
????????????????,??con (sst-273.16)*9/5
????frame/file=aaa.gif
????cancel ???(??????????)
126. ??????? set window/new ???????
set window n ????n,???????, ???n???,???????
set window/aspect=0.5 ???,???0.75
set window/size=0.5 (<1????)
Ferret????n?????,??????GrADS(????????)
set window/clear ?set window/c ? cancel viewport????????
set window/location=0,0.5
cancel window n ?????n???
127. ????? set viewport upper; ????
set viewport lower;????
???????,????
set viewport left
set viewport right
???????,????
set viewport ul /ur /ll /lr
???????,???????????
128. ????list /I/J/K/L /X/Y/Z/T /D /ILIMITS /JLIMITS /KLIMITS
/LLIMITS /XLIMITS /YLIMITS/ZLIMITS /TLIMIT
/APPEND /FILE /FORMAT /HEADING /NOHEAD
/TITLE /ORDER/RIGID /PRECISION /CLOBBER
/SINGLE /QUIET /WIDTH /EDGES /BOUNDS
list ???[i=i1:i2,j=.]
list ??,????,?????
129. ????i,j,k,l?????????? list ???[i=i1:i2,j=.]
show grid/i=/j=/k=/l= var
130. *.jnl??? go ???.jnl
??C:\Program Files\TMAP\examples
?*.jnl????Ferret
131. go tools??? go ???(.jnl)
?:
go land
go fland
.
go tools???C:\Program Files\TMAP\go
132. ??????plot PLOT /I/J/K/L /X/Y/Z/T /OVERLAY/ SET_UP /FRAME /D/ TRANPOSE/ VS/ SYMBOL/NOLABEL /LINE /COLOR /THICKNES /SIZE /HLIMITS /VLIMITS /TITLE /STEP/NOAXES /DASH /NOYADJUS /AXES /HLOG /VLOG /NOKEY
/I/J/K/L /X/Y/Z/T ????????? /X=40E:60W/OVERLAY ????????/D ????
plot/line/symbols/I=1:30 sin(I)
plot/vs temp, salt
?????
133. ??????contour ??? (contour/con)?????GrADS (set gxout contour),?Ferret?contour??????
?levitus??????use levitus_ climatology
contour temp[k=1] (contour??????????)???,????????[x=,y]??
?? set region/x=x1:x2/y=y1,y2/z=z1:z1/t=t1:t2????????,?????con temp
??????? go land (???????)
?????? go fland red
134. contour?????????contour/I/j/k/l/x/y/z/t/d/fill/levels/key/nokey/line /I/j/k/l ??????? /x/y/z/t???????????????? /d ??/fill?????; /line?contour/fill??????/levels=(lo,hi,delta) /levels=(lo,hi,delta,ndigits) ?contour????, ???? ??????????/levels =40 ??????40 = 40c ??????0,??0 =2000d?????2000 =2000dc?????2000??????0 /levels=( 5)??????5???? /levels= (inf)(lo,hi,delta)(inf) ????(lo,hi,delta) ??????,???????????
/key ??colorbar,key=continous???colorbar/nokey?colorbar ???contour/fill????key???
135. contour??(?)contour/noaxis/palette/pen/sigdigs /size/spacing/nolabels/overlay/title/noaxis???? /palette ???? /pen????/sigdigs???????????????/size ?????????/spacing?????/nolabels ???ferret???????overlay ? /ov ?????????????/title=. ?????
136. ???? ???
go mp_demo.jnl
mercator???????
go mercator_demo [ymin, ymax] [yticks]
137. ??????fill fill = contour/fill
?????,???contour/line??
????????GrADS (set gxout shaded)
138. ??????shade ????,???contour/line???
?????GrADS (set gxout fgrid)
139. shade?????????shade/I/j/k/l/x/y/z/t/d/frame/key/levels /line/noaxis/nokey/nolabels/overlay /palette /title/transpose/modulo/hlimits /vlimits/ axes/transpose??????/hlimits /vlimits/ ???????/axes [1 1 0 0]????????,?0????
140. ??????vector ???(vector)
vector u,v
?coads_climatology.cdf????
141. Vector?? vector/length/flowline/xskip/yskip
/length 1cm????????/flowline ???/xskip ????
142. ???????? repeat/l=1:12 con sst; go fland
repeat/I/j/k/l/animate
repeat/animate = animate
143. ?????????? Netcdf??save/file=???.cdf/clobber/I/j/k var1,var2,save = list/form=cdf/file=
ASCII ???????list/form/file var1,var2,
144. Netcdf??????? LIST/FORMAT=CDF variable_name
SAVE/FILE=example.cdf/I=1:100 sin(I/100)yes? SET DATA coads_climatology
yes? SAVE/L=1 sst,airt,uwnd,vwnd
????????,?ferret???????Netcdf???????
145. ????let define ?????,????????define
let = define/variables
let var=f(var1,)
let ??? Grads??define
146. ????define define
??????,??,????
147. ????transformation transform??????20C??????
yes? USE levitus_climatology
yes? SET REG/Y=10s:30n/X=140E:140W
yes? PPL CONSET .12 !label size
yes? CONTOUR temp[Z=0:200@LOC:20] ??
yes? QUIT
Fill/line/levels=(-10)(12,30,2)(35) temp[X=130:200@AVE,L=1:50:5]
???
??????transform??
????? show transform
148. ????show show show data/grid/variable/.show data 1
149. ????set mode set mode metafile (?????????*.plt)
cancel mode metafile
SET MODE META filename
SET MODE JOURNAL filename
SET MODE PPLLIST filename
SET MODE/LAST Resets mode to its last state.
SET MODE DIAGNOSTIC
???? P409 set mode options
150. ??????set mode(1) ASCII_FONT imposes PPLUS ASCII font types on plot labels set
CALENDAR uses date strings for T axis (vs. time step values) set
DEPTH_LABEL uses "DEPTH" as Z axis label set
DESPERATE attempts calculations too large for memory canceled
DIAGNOSTIC turns on internal pro gram diagnostic out put canceled
GRATICULE sets drawing of graticule lines on all subsequent plots cancelled
GUI un sup ported; used in GUI development
IGNORE_ERROR continues command file after errors canceled
INTERPOLATE automatically interpolates data between planes canceled
151. ??????set mode(2) JOURNAL re cords key board com mands in a jour nal file set
LATIT_LABEL uses "N" "S" no ta tion for la bel ing lat i tudes set
LONG_LABEL uses "E" "W" no ta tion for la bel ing lon gi tudes set
METAFILE cap tures graph ics in GKS metafiles can celed
PPLLIST listed out put from PPLUS is di rected to the named file can celed
REFRESH re freshes graph ics on sys tems lack ing "back ing store" can celed
SEGMENT uti lizes GKS seg ment stor age set
STUPID con trols cache hits in mem ory (di ag nos tic) can celed
VERIFY dis plays each com mand file line as it is ex e cuted set
WAIT waits for car riage re turn af ter each plot can celed
P409 set mode options
152. ????(gif ) ????? ferret -gif
????????
????frame/file=aa.gif
????????????aa.gif
?????????,?????.gif
153. Ferret?????
show transform
show commands
show alias
show functions
go/help string