Changeset 542 for trunk/src/proj_field.m
- Timestamp:
- Sep 15, 2012, 7:04:56 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/proj_field.m
r537 r542 94 94 if ~isfield(ObjectData,'Coord')||isempty(ObjectData.Coord) 95 95 if strcmp(ObjectData.Type,'plane') 96 ObjectData.Coord=[0 0 0];%default96 ObjectData.Coord=[0 0];%default 97 97 else 98 98 return … … 948 948 %% initiate Matlab structure for physical field 949 949 [ProjData,errormsg]=proj_heading(FieldData,ObjectData); 950 951 %% reproduce initial plane position and angle 952 if isfield(FieldData,'PlaneCoord')&&length(FieldData.PlaneCoord)==3 953 if length(ProjData.ObjectCoord)==3% if the projection plane has a z coordinate 954 if ~isequal(ProjData.PlaneCoord(3),ProjData.ObjectCoord) %check the consistency with the z coordinate of the field plane (set by calibration) 955 errormsg='inconsistent z position for field and projection plane'; 956 return 957 end 958 else % the z coordinate is set only by the field plane (by calibration) 959 ProjData.ObjectCoord(3)=FieldData.PlaneCoord(3); 960 end 961 if isfield(FieldData,'PlaneAngle') 962 if isfield(ProjData,'ObjectAngle') 963 if ~isequal(FieldData.PlaneAngle,ProjData.ObjectAngle) %check the consistency with the z coordinate of the field plane (set by calibration) 964 errormsg='inconsistent plane angle for field and projection plane'; 965 return 966 end 967 else 968 ProjData.ObjectAngle=FieldData.PlaneAngle; 969 end 970 end 971 end 950 972 ProjData.NbDim=2; 951 973 ProjData.ListVarName={}; … … 2206 2228 AttrName=ProjData.ListGlobalAttribute{iattr}; 2207 2229 if isfield(FieldData,AttrName) 2208 eval(['ProjData.' AttrName '=FieldData.' AttrName ';']);2230 ProjData.(AttrName)=FieldData.(AttrName); 2209 2231 end 2210 2232 end … … 2224 2246 for ilist=1:length(ListObject) 2225 2247 if isfield(ObjectData,ListObject{ilist}) 2226 eval(['val=ObjectData.' ListObject{ilist} ';'])2248 val=ObjectData.(ListObject{ilist}); 2227 2249 if ~isempty(val) 2228 eval(['ProjData.Object' ListObject{ilist} '=val;']);2250 ProjData.(['Object' ListObject{ilist}])=val; 2229 2251 ProjData.ListGlobalAttribute=[ProjData.ListGlobalAttribute {['Object' ListObject{ilist}]}]; 2230 2252 end 2231 2253 end 2232 2254 end 2255
Note: See TracChangeset
for help on using the changeset viewer.