Changeset 406 for trunk/src/read_civdata.m
- Timestamp:
- May 3, 2012, 7:30:05 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/read_civdata.m
r404 r406 48 48 49 49 function [Field,VelTypeOut,errormsg]=read_civdata(filename,FieldNames,VelType,CivStage) 50 errormsg=''; 50 51 51 %% default input 52 52 if ~exist('VelType','var') … … 62 62 FieldNames=[]; %default 63 63 end 64 errormsg=''; 64 65 65 66 %% reading data 66 67 [varlist,role,units,VelTypeOut]=varcivx_generator(FieldNames,VelType,CivStage); 67 [Field,vardetect]=nc2struct(filename,varlist);%read the variables in the netcdf file 68 if isempty(varlist) 69 erromsg=['error in read_civdata: unknow velocity type ' VelType]; 70 return 71 else 72 [Field,vardetect]=nc2struct(filename,varlist);%read the variables in the netcdf file 73 end 68 74 if isfield(Field,'Txt') 69 75 errormsg=Field.Txt; … … 106 112 % if vel_type=[] or'*', a priority choice is done, civ2 considered better than civ1 ) 107 113 108 function [var,role,units,vel_type_out ]=varcivx_generator(FieldNames,vel_type,CivStage)114 function [var,role,units,vel_type_out,errormsg]=varcivx_generator(FieldNames,vel_type,CivStage) 109 115 110 116 %% default input values … … 113 119 if ~exist('FieldNames','var'),FieldNames={'ima_cor'};end;%default scalar 114 120 if ischar(FieldNames), FieldNames={FieldNames}; end; 121 errormsg=''; 115 122 116 123 %% select the priority order for automatic vel_type selection … … 127 134 end 128 135 end 129 if isempty(vel_type) 136 if isempty(vel_type)||strcmp(vel_type,'*') 130 137 switch CivStage 131 138 case {6} %filter2 available … … 146 153 vel_type='filter1'; 147 154 end 148 155 var={}; 149 156 switch vel_type 150 157 case 'civ1'
Note: See TracChangeset
for help on using the changeset viewer.