Changeset 21942
- Timestamp:
- 08/11/17 16:15:14 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/coordsystems/gmtmask.m
r21941 r21942 31 31 %First, write our lat,long file for gmt: 32 32 nv=length(lat); 33 filename = ['all_vertices-' num2str(feature('GetPid')) '.txt']34 dlmwrite(filename,[long lat (1:nv)'],'delimiter','\t','precision',10);35 33 filename_all = ['all_vertices-' num2str(feature('GetPid')) '.txt']; 34 filename_oce = ['oce_vertices-' num2str(feature('GetPid')) '.txt']; 35 dlmwrite(filename_all,[long lat (1:nv)'],'delimiter','\t','precision',10); 36 36 37 37 %Avoid bypassing of the ld library path by Matlab (:() … … 42 42 43 43 %figure out which vertices are on the ocean, which one on the continent: 44 [status,result] = system(['gmt gmtselect ./' filename ' -h0 -Df -R0/360/-90/90 -A0 -JQ180/200 -Nk/s/s/k/s > ./oce_vertices.txt']);44 [status,result] = system(['gmt gmtselect ./' filename_all ' -h0 -Df -R0/360/-90/90 -A0 -JQ180/200 -Nk/s/s/k/s > ./' filename_oce]); 45 45 if status~=0, 46 46 error(result); … … 52 52 end 53 53 %read the con_vertices.txt file and flag our mesh vertices on the continent 54 fid=fopen( './oce_vertices.txt','r');54 fid=fopen(['./' filename_oce],'r'); 55 55 line=fgets(fid); 56 56 line=fgets(fid); … … 66 66 mask(oce_vertices)=1; 67 67 68 system(['rm -rf ./' filename ' ./oce_vertices.txt./gmt.history']);68 system(['rm -rf ./' filename_all ' ./' filename_oce ' ./gmt.history']); 69 69 if ~recursive, disp(sprintf('gmtmask: done')); end;
Note:
See TracChangeset
for help on using the changeset viewer.