NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/MATLAB/opnml/FCAST_1.2/matlab_cen/plot_real_v2c.m

Revision 495 (checked in by cbc, 11 years ago)

Initial import of Stark code.

Line 
1 gridname=input('Enter the name of grid: ','s');
2 [in,x,y,z,bnd]=loadgrid(gridname);
3 %
4 newplot='y';
5 while newplot == 'y',
6 %
7 % Load data from files
8 %
9    !ls *Z0*.v2c */*Z0*.v2c
10    filename=input('Enter the name of .v2c file: ','s');
11    [v2c,freq]=read_v2c(filename);
12 %
13 % Calculate real u and v
14 %
15    u=v2c(:,2).*cos(v2c(:,3)*pi/180.0);
16    v=v2c(:,4).*cos(v2c(:,5)*pi/180.0);
17 %
18 % Plot boundary
19 %
20    tallfigure;
21    bndo=plotbnd(x,y,bnd);
22    set(bndo,'Color','k')
23    xmin=min(x)-0.1*(max(x)-min(x));
24    xmax=max(x)+0.1*(max(x)-min(x));
25    ymin=min(y)-0.1*(max(y)-min(y));
26    ymax=max(y)+0.1*(max(y)-min(y));
27    axis([xmin xmax ymin ymax])
28    axis('equal')
29    axis('tight')
30    drawnow
31    cval=[50 100 200];
32    hc=lcontour2(in,x,y,z,cval);
33    set(hc,'Color','k')
34 %
35 % Plot vector field
36 %
37    newscale='y';
38    while newscale == 'y',
39       title(verbatim(filename))
40       vmax=max(abs(u+sqrt(-1.0)*v))
41       scale=input('Enter the desired vector scale: ');
42       hv=vecplot2(x,y,u,v,scale,'cm/s',max(x)-0.225*(max(x)-min(x)),min(y)+0.95*(max(y)-min(y)))
43       set(hv,'Color','k')
44       zoom on
45       newscale='n';
46       newscale=input('New scale? (y/n): ','s');
47       if newscale == 'y',
48          delete(hv);
49       end
50    end
51    newplot=input('New plot? (y/n): ','s');
52 end
Note: See TracBrowser for help on using the browser.