Changeset 569 for trunk/src/proj_field.m
 Timestamp:
 Feb 19, 2013, 7:19:07 PM (8 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/proj_field.m
r546 r569 887 887 888 888 %% mesh sizes DX and DY 889 DX=[]; 890 DY=[];%default 889 891 if isfield(ObjectData,'DX') && ~isempty(ObjectData.DX) 890 892 DX=abs(ObjectData.DX);%mesh of interpolation points 891 else892 DX=FieldData.Mesh;893 % else 894 % DX=FieldData.Mesh; 893 895 end 894 896 if isfield(ObjectData,'DY') && ~isempty(ObjectData.DY) 895 897 DY=abs(ObjectData.DY);%mesh of interpolation points 896 else 897 DY=FieldData.Mesh; 898 end 899 if ~strcmp(ObjectData.ProjMode,'projection') && (DX==0DY==0) 900 errormsg='DX or DY missing'; 901 display(errormsg) 898 % else 899 % DY=FieldData.Mesh; 900 end 901 if ~strcmp(ObjectData.ProjMode,'projection') && (isempty(DX)isempty(DY)) 902 errormsg='DX or DY not defined'; 902 903 return 903 904 end … … 913 914 XMax=max(ObjectData.RangeX); 914 915 testXMin=XMax>XMin; 915 testXMax=1; 916 testXMax=1;% range restriction along X 916 917 else 917 918 XMin=FieldData.XMin;%default … … 960 961 ProjData.VarDimName={}; 961 962 ProjData.VarAttribute={}; 962 if ~ise qual(DX,0)&& ~isequal(DY,0)963 if ~isempty(DX) && ~isempty(DY) 963 964 ProjData.Mesh=sqrt(DX*DY);%define typical data mesh, useful for mouse selection in plots 964 965 elseif isfield(FieldData,'Mesh') … … 1234 1235 1235 1236 %% case of input fields defined on a structured grid 1236 case 'grid' 1237 1237 case 'grid' 1238 1238 VarName=FieldData.ListVarName{VarIndex(1)};%get the first variable of the cell to get the input matrix dimensions 1239 1239 DimValue=size(FieldData.(VarName));%input matrix dimensions … … 1275 1275 Coord_z=[]; 1276 1276 Coord_y=[]; 1277 Coord_x=[]; 1278 1277 Coord_x=[]; 1279 1278 for idim=1:NbDim %loop on space dimensions 1280 1279 test_interp(idim)=0;%test for coordiate interpolation (non regular grid), =0 by default … … 1302 1301 end 1303 1302 end 1304 if DY==01303 if isempty(DY) 1305 1304 DY=abs(DCoord_min(NbDim1)); 1306 1305 end 1307 1306 npY=1+round(abs(Coord{NbDim1}(end)Coord{NbDim1}(1))/DY);%nbre of points after interpol 1308 if DX==01307 if isempty(DX) 1309 1308 DX=abs(DCoord_min(NbDim)); 1310 1309 end … … 1369 1368 coord_x_proj=linspace(XMax,XMin,npX);%abscissa of the new pixels along the line 1370 1369 end 1371 % case with no 1370 % case with no interpolation 1372 1371 if isequal(ProjMode{icell},'projection') && (~testangle  test90y  test90x) 1373 if NbDim==2 && ~testXMin && ~testXMax && ~testYMin && ~testYMax 1372 if NbDim==2 && ~testXMin && ~testXMax && ~testYMin && ~testYMax% no range restriction 1374 1373 ProjData.ListVarName=[ProjData.ListVarName FieldData.ListVarName(VarIndex)]; 1375 1374 ProjData.VarDimName=[ProjData.VarDimName FieldData.VarDimName(VarIndex)]; … … 1408 1407 end 1409 1408 min_indy=max(min_indy,1);% deals with margin (bound lower than the first index) 1410 min_indx=max(min_indx,1); 1411 1409 min_indx=max(min_indx,1); 1412 1410 if test90y 1413 1411 ind_new=[3 2 1]; 1414 1412 DimCell={AYProjName,AXProjName}; 1415 % DimValue=DimValue(ind_new);1416 1413 iz=ceil((ObjectData.Coord(1,1)Coord{3}(1))/DX)+1; 1417 1414 for ivar=VarIndex
Note: See TracChangeset
for help on using the changeset viewer.