Changeset 1057 for trunk/src/find_field_cells.m
- Timestamp:
- Aug 29, 2018, 12:39:05 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/find_field_cells.m
r1049 r1057 306 306 CellInfo{icell}.DimOrder=[]; 307 307 if NbDim(icell)==3 308 %coord z 309 for ivar=ind_coord_z 310 if check_coord_names(ivar) 311 DimRank=find(strcmp(Data.VarDimName{ivar},DimCell_var)); 308 if strcmp(DimCell_var{3},'rgb') 309 NbDim(icell)=2;% case of color images 310 else 311 %coord z 312 for ivar=ind_coord_z 313 if check_coord_names(ivar) 314 DimRank=find(strcmp(Data.VarDimName{ivar},DimCell_var)); 315 check_coord=~isempty(DimRank); 316 elseif check_coord_raster(ivar) 317 DimRank=find(strcmp(Data.ListVarName{ivar},DimCell_var)); 318 check_coord=~isempty(DimRank); 319 end 320 % check_coord= (check_coord_names(ivar) && strcmp(Data.VarDimName{ivar},DimCell_var{1}))||...% coord varbable 321 % (check_coord_raster(ivar) && strcmp(Data.ListVarName{ivar},DimCell_var{1})); % rasrewr coord defined by min and max 322 if check_coord 323 CellInfo{icell}.CoordType='grid'; 324 CellInfo{icell}.CoordIndex(1)=ivar; 325 CellInfo{icell}.ZName=Data.ListVarName{ivar}; 326 CellInfo{icell}.ZIndex=ivar; 327 CellInfo{icell}.DimOrder=DimRank; 328 break 329 end 330 end 331 end 332 end 333 for ivar=ind_coord_y 334 if check_coord_names(ivar) 335 DimRank=find(strcmp(Data.VarDimName{ivar},DimCell_var)); 312 336 check_coord=~isempty(DimRank); 313 337 elseif check_coord_raster(ivar) … … 315 339 check_coord=~isempty(DimRank); 316 340 end 317 % check_coord= (check_coord_names(ivar) && strcmp(Data.VarDimName{ivar},DimCell_var{1}))||...% coord varbable 318 % (check_coord_raster(ivar) && strcmp(Data.ListVarName{ivar},DimCell_var{1})); % rasrewr coord defined by min and max 319 if check_coord 320 CellInfo{icell}.CoordType='grid'; 321 CellInfo{icell}.CoordIndex(1)=ivar; 322 CellInfo{icell}.ZName=Data.ListVarName{ivar}; 323 CellInfo{icell}.ZIndex=ivar; 324 CellInfo{icell}.DimOrder=DimRank; 325 break 326 end 327 end 328 end 329 for ivar=ind_coord_y 330 if check_coord_names(ivar) 331 DimRank=find(strcmp(Data.VarDimName{ivar},DimCell_var)); 332 check_coord=~isempty(DimRank); 333 elseif check_coord_raster(ivar) 334 DimRank=find(strcmp(Data.ListVarName{ivar},DimCell_var)); 335 check_coord=~isempty(DimRank); 336 end 337 % check_coord= (check_coord_names(ivar) && strcmp(Data.VarDimName{ivar},DimCell_var{NbDim(icell)-1}))||...% coord variable 338 % (check_coord_raster(ivar) && strcmp(Data.ListVarName{ivar},DimCell_var{NbDim(icell)-1})); % rasrewr coord defined by min and max 341 % check_coord= (check_coord_names(ivar) && strcmp(Data.VarDimName{ivar},DimCell_var{NbDim(icell)-1}))||...% coord variable 342 % (check_coord_raster(ivar) && strcmp(Data.ListVarName{ivar},DimCell_var{NbDim(icell)-1})); % rasrewr coord defined by min and max 339 343 if check_coord 340 344 CellInfo{icell}.CoordType='grid'; … … 348 352 for ivar=ind_coord_x 349 353 if check_coord_names(ivar) 350 354 DimRank=find(strcmp(Data.VarDimName{ivar},DimCell_var)); 351 355 check_coord=~isempty(DimRank); 352 356 elseif check_coord_raster(ivar) … … 354 358 check_coord=~isempty(DimRank); 355 359 end 356 % check_coord= (check_coord_names(ivar) && strcmp(Data.VarDimName{ivar},DimCell_var{NbDim(icell)}))||...% coord variable357 % (check_coord_raster(ivar) && strcmp(Data.ListVarName{ivar},DimCell_var{NbDim(icell)})); % raster coord defined by min and max360 % check_coord= (check_coord_names(ivar) && strcmp(Data.VarDimName{ivar},DimCell_var{NbDim(icell)}))||...% coord variable 361 % (check_coord_raster(ivar) && strcmp(Data.ListVarName{ivar},DimCell_var{NbDim(icell)})); % raster coord defined by min and max 358 362 if check_coord 359 363 CellInfo{icell}.CoordIndex(NbDim(icell))=ivar; … … 400 404 CellInfo{icell}.CoordSize=[size(Data.(VarName),3) size(Data.(VarName),2) size(Data.(VarName),1)]; 401 405 else 402 CellInfo{icell}.CoordSize=[size(Data.(VarName), 2) size(Data.(VarName),1)];406 CellInfo{icell}.CoordSize=[size(Data.(VarName),1) size(Data.(VarName),2)]; 403 407 end 404 408 case 'tps'
Note: See TracChangeset
for help on using the changeset viewer.