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

root/gliderproc/trunk/MATLAB/opnml/FCAST_1.2/meshmask.m

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

Initial import of Stark code.

Line 
1 function [hlo,hi,hw]=mask(mesh,bfname)
2
3 % [HLAND,HISLAND,HWATER]=meshmask(fem_mesh_str)
4 %
5 % Needs to know where .bel file lies.
6
7 % Not OPNML COMPLIANT 3-18-99 CVL
8
9 if nargin==2
10         bel=read_bel('/homes/blanton/FCAST_DIR/MESH/bank150.bel');
11 else
12         bel=read_bel(bfname);
13 end
14
15 lbl=size(bel,1);
16
17 breakind=[find( bel(2:lbl,2)~=bel(1:lbl-1,3)|...
18                 bel(2:lbl,5)~=bel(1:lbl-1,5))...
19                         ;lbl];
20
21 lind=1;
22 hl=[];
23 hi=[];
24 hw=[];
25
26 for in=1:length(breakind)
27         uind=breakind(in);
28         ind=lind:uind;
29         nodeind=bel(ind,2);
30         nodeind=[nodeind;bel(uind,3)];
31         if (bel(ind,5)==2)
32                 hi=[hi,patch(mesh.x(nodeind),mesh.y(nodeind),...
33                         get(gca,'color'),...
34                         'edgecolor','g')];
35         elseif (bel(ind,5)==1)
36                 hl=[hl,plot(mesh.x(nodeind),mesh.y(nodeind),'g')];
37         else
38                 hw=[hw,plot(mesh.x(nodeind),mesh.y(nodeind),'b')];
39         end
40
41         hold on
42         lind=uind+1;
43 end
44
45 if nargout
46         hlo=hl;
47 end
Note: See TracBrowser for help on using the browser.