Changeset 12303
- Timestamp:
- 05/30/12 13:44:17 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/utils/DataProcessing/gamv.m
r12302 r12303 4 4 % Usage: 5 5 % output = gamv(x,y,data,varargin) 6 7 options=pairoptions(varargin{:}); 8 9 nlag = getfieldvalue(options,'nlag', 20); 10 dlag = getfieldvalue(options,'dlag', 1000); 6 11 7 12 %Write data file … … 26 31 fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21' ,'\trimming limits'); 27 32 fprintf(fid,'%-30s %s\n','gamv.out' ,'\file for variogram output'); 28 fprintf(fid,'%-30s %s\n', '20','\number of lags');29 fprintf(fid,'%-30s %s\n', '5.0','\lag separation distance');30 fprintf(fid,'%-30s %s\n', '3.0','\lag tolerance');33 fprintf(fid,'%-30s %s\n',num2str(nlag,'%i') ,'\number of lags'); 34 fprintf(fid,'%-30s %s\n',num2str(dlag,'%g') ,'\lag separation distance'); 35 fprintf(fid,'%-30s %s\n',num2str(dlag/2,'%g') ,'\lag tolerance'); 31 36 fprintf(fid,'%-30s %s\n','3' ,'\number of directions'); 32 37 fprintf(fid,'%-30s %s\n','0.0 90.0 50.0 0.0 90.0 50.0','\azm, atol, bandh, dip, dtol, bandv'); … … 41 46 %Call gamv 42 47 system([issmdir() '/externalpackages/gslib/install/gamv gamv.par']); 48 delete('gamv.par'); 49 50 %Read output 51 output = struct('Semivariogram',[],'Covariance',[]); 52 counter1 = 1; 53 counter2 = 1; 54 fid=fopen('gamv.out','r'); 55 while (~feof(fid)), 56 A=fscanf(fid,'%s',1); 57 if strcmp(A,'Covariance'); 58 A=fscanf(fid,'%s',4); %Read tail:Data head:Data direction 2 59 output(counter1).Covariance=fscanf(fid,'%i %g %g %i %g %g',[6 nlag+2])'; 60 counter1=counter1+1; 61 elseif strcmp(A,'Semivariogram'), 62 A=fscanf(fid,'%s',4); %Read tail:Data head:Data direction 2 63 output(counter2).Semivariogram=fscanf(fid,'%i %g %g %i %g %g',[6 nlag+2])'; 64 counter2=counter2+1; 65 else 66 %do nothing 67 end 68 end 69 fclose(fid); 70 delete('gamv.out')
Note:
See TracChangeset
for help on using the changeset viewer.