Changeset 494 for trunk/src/series
- Timestamp:
- Jul 19, 2012, 11:50:39 AM (12 years ago)
- Location:
- trunk/src/series
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/aver_stat.m
r478 r494 227 227 end 228 228 229 % field calculation (vort, div...) 229 %% check whether tps is needed, then calculate tps coefficients if needed 230 check_tps=0; 231 if ischar(Param.InputFields.FieldName) 232 Param.InputFields.FieldName={Param.InputFields.FieldName}; 233 end 234 for ilist=1:numel(Param.InputFields.FieldName) 235 switch Param.InputFields.FieldName{ilist} 236 case {'vort','div','strain'} 237 check_tps=1; 238 end 239 end 240 if strcmp(Param.ProjObject.ProjMode,'filter') 241 check_tps=1; 242 end 243 if check_tps 244 SubDomain=1500; %default, estimated nbre of vectors in a subdomain used for tps 245 if isfield(Data{iview},'SubDomain') 246 SubDomain=Data{iview}.SubDomain;% 247 end 248 [Data{iview}.SubRange,Data{iview}.NbSites,Data{iview}.Coord_tps,Data{iview}.U_tps,Data{iview}.V_tps,tild,U_smooth,V_smooth,W_smooth,FF] =... 249 filter_tps([Data{iview}.X(Data{iview}.FF==0) Data{iview}.Y(Data{iview}.FF==0)],Data{iview}.U(Data{iview}.FF==0),Data{iview}.V(Data{iview}.FF==0),[],SubDomain,0); 250 nbvar=numel(Data{iview}.ListVarName); 251 Data{iview}.ListVarName=[Data{iview}.ListVarName {'SubRange','NbSites','Coord_tps','U_tps','V_tps'}]; 252 Data{iview}.VarDimName=[Data{iview}.VarDimName {{'nb_coord','nb_bounds','nb_subdomain'},{'nb_subdomain'},... 253 {'nb_tps','nb_coord','nb_subdomain'},{'nb_tps','nb_subdomain'},{'nb_tps','nb_subdomain'}}]; 254 Data{iview}.VarAttribute{nbvar+3}.Role='coord_tps'; 255 Data{iview}.VarAttribute{nbvar+4}.Role='vector_x'; 256 Data{iview}.VarAttribute{nbvar+5}.Role='vector_y'; 257 if isfield(Data{iview},'ListDimName')%cleaning 258 Data{iview}=rmfield(Data{iview},'ListDimName'); 259 end 260 if isfield(Data{iview},'DimValue')%cleaning 261 Data{iview}=rmfield(Data{iview},'DimValue'); 262 end 263 end 264 265 % field calculation (vort, div...) 230 266 if strcmp(FileType{1},'civx')||strcmp(FileType{1},'civdata') 231 Data{1}=calc_field(InputFields{1}.FieldName,Data{1});%calculate field (vort..) 232 end 233 267 if isfield(Data{1},'Coord_tps') 268 Data{1}.FieldList=Param.InputFields.FieldName; 269 else 270 Data{1}=calc_field(Param.InputFields.FieldName,Data{1});%calculate field (vort..) 271 end 272 end 273 234 274 % field substration (for two input file series) 235 275 if length(Data)==2 236 if strcmp(FileType{2},'civx')||strcmp(FileType{2},'civ') 237 Data{2}=calc_field(InputFields{2}.FieldName,Data{2});%calculate field (vort..) 276 if strcmp(FileType{2},'civx')||strcmp(FileType{2},'civdata') 277 if isfield(Data{2},'Coord_tps') 278 Data{2}.FieldList=Param.InputFields.FieldName; 279 else 280 Data{2}=calc_field(Param.InputFields.FieldName,Data{2});%calculate field (vort..) 281 end 238 282 end 239 283 [Field,errormsg]=sub_field(Data{1},Data{2}); %substract the two fields -
trunk/src/series/merge_proj.m
r478 r494 193 193 for iview=1:nbview 194 194 % reading input file(s) 195 filecell{iview,index} 195 196 [Data{iview},tild,errormsg] = read_field(filecell{iview,index},FileType{iview},Param.InputFields,frame_index{iview}(index)); 196 197 if ~isempty(errormsg) … … 207 208 Data{iview}.ZIndex=mod(i1_series{iview}(index)-1,NbSlice_calib{iview})+1;%Zindex for phys transform 208 209 end 210 209 211 %transform the input field (e.g; phys) if requested 210 212 if ~isempty(transform_fct) 211 213 Data{iview}=transform_fct(Data{iview},XmlData{iview}); %transform to phys if requested 212 214 end 213 % field calculation (vort, div...) 215 216 %% check whether tps is needed, then calculate tps coefficients if needed 217 check_tps=0; 218 if ischar(Param.InputFields.FieldName) 219 Param.InputFields.FieldName={Param.InputFields.FieldName}; 220 end 221 for ilist=1:numel(Param.InputFields.FieldName) 222 switch Param.InputFields.FieldName{ilist} 223 case {'vort','div','strain'} 224 check_tps=1; 225 end 226 end 227 if strcmp(Param.ProjObject.ProjMode,'filter') 228 check_tps=1; 229 end 230 if check_tps 231 SubDomain=1500; %default, estimated nbre of vectors in a subdomain used for tps 232 if isfield(Data{iview},'SubDomain') 233 SubDomain=Data{iview}.SubDomain;% 234 end 235 [Data{iview}.SubRange,Data{iview}.NbSites,Data{iview}.Coord_tps,Data{iview}.U_tps,Data{iview}.V_tps,tild,U_smooth,V_smooth,W_smooth,FF] =... 236 filter_tps([Data{iview}.X(Data{iview}.FF==0) Data{iview}.Y(Data{iview}.FF==0)],Data{iview}.U(Data{iview}.FF==0),Data{iview}.V(Data{iview}.FF==0),[],SubDomain,0); 237 nbvar=numel(Data{iview}.ListVarName); 238 Data{iview}.ListVarName=[Data{iview}.ListVarName {'SubRange','NbSites','Coord_tps','U_tps','V_tps'}]; 239 Data{iview}.VarDimName=[Data{iview}.VarDimName {{'nb_coord','nb_bounds','nb_subdomain'},{'nb_subdomain'},... 240 {'nb_tps','nb_coord','nb_subdomain'},{'nb_tps','nb_subdomain'},{'nb_tps','nb_subdomain'}}]; 241 Data{iview}.VarAttribute{nbvar+3}.Role='coord_tps'; 242 Data{iview}.VarAttribute{nbvar+4}.Role='vector_x'; 243 Data{iview}.VarAttribute{nbvar+5}.Role='vector_y'; 244 if isfield(Data{iview},'ListDimName')%cleaning 245 Data{iview}=rmfield(Data{iview},'ListDimName'); 246 end 247 if isfield(Data{iview},'DimValue')%cleaning 248 Data{iview}=rmfield(Data{iview},'DimValue'); 249 end 250 end 251 252 % field calculation (vort, div...) 214 253 if strcmp(FileType{iview},'civx')||strcmp(FileType{iview},'civdata') 215 Data{iview}=calc_field(Param.InputFields.FieldName,Data{iview});%calculate field (vort..) 254 if isfield(Data{iview},'Coord_tps') 255 Data{iview}.FieldList=Param.InputFields.FieldName; 256 else 257 Data{iview}=calc_field(Param.InputFields.FieldName,Data{iview});%calculate field (vort..) 258 end 216 259 end 217 260
Note: See TracChangeset
for help on using the changeset viewer.