Changeset 408 for trunk/src/proj_field.m
- Timestamp:
- May 5, 2012, 6:34:46 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/proj_field.m
r402 r408 82 82 function [ProjData,errormsg]=proj_field(FieldData,ObjectData) 83 83 errormsg='';%default 84 % if ~exist('FieldName','var') 85 % FieldName=''; 86 % end 84 ProjData=[]; 85 87 86 %% case of no projection (object is used only as graph display) 88 87 if isfield(ObjectData,'ProjMode') && (isequal(ObjectData.ProjMode,'none')||isequal(ObjectData.ProjMode,'mask_inside')||isequal(ObjectData.ProjMode,'mask_outside')) 89 ProjData=[];90 88 return 91 89 end 92 90 91 %% check coincidence of coordinate units 92 if isfield(FieldData,'CoordUnit') && isfield(ObjectData,'CoordUnit')&&~strcmp(FieldData.CoordUnit,ObjectData.CoordUnit) 93 errormsg='inconsistent coord units for field and projection object'; 94 return 95 end 96 93 97 %% in the absence of object Type or projection mode, or object coordinaes, the input field is just tranfered without change 94 98 if ~isfield(ObjectData,'Type')||~isfield(ObjectData,'ProjMode') … … 1091 1095 if testbound 1092 1096 indcut=find(testin); 1097 if isempty(indcut) 1098 errormsg='data outside the bounds of the projection object'; 1099 return 1100 end 1093 1101 for ivar=VarIndex 1094 1102 VarName=FieldData.ListVarName{ivar}; … … 1105 1113 switch ObjectData.ProjMode 1106 1114 case 'projection' 1107 %the list of dimension1108 %ProjData.ListDimName=[ProjData.ListDimName FieldData.VarDimName(VarIndex(1))];%add the point index to the list of dimensions1109 %ProjData.DimValue=[ProjData.1110 %length(coord_X)];1111 1112 1115 for ivar=VarIndex %transfer variables to the projection plane 1113 1116 VarName=FieldData.ListVarName{ivar}; … … 1147 1150 if ~isequal(ivar_FF,0) 1148 1151 VarName_FF=FieldData.ListVarName{ivar_FF}; 1149 eval(['indsel=find(FieldData.' VarName_FF '==0);'])1152 indsel=find(FieldData.(VarName_FF)==0); 1150 1153 coord_X=coord_X(indsel); 1151 1154 coord_Y=coord_Y(indsel);
Note: See TracChangeset
for help on using the changeset viewer.