Changeset 542 for trunk/src/proj_field.m


Ignore:
Timestamp:
Sep 15, 2012, 7:04:56 PM (12 years ago)
Author:
sommeria
Message:

bugs repaired for mask display in phys coord, display of circles in geometry_calib, introduction of x,y,z initial in proj_field/proj_plane

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/proj_field.m

    r537 r542  
    9494if ~isfield(ObjectData,'Coord')||isempty(ObjectData.Coord)
    9595    if strcmp(ObjectData.Type,'plane')
    96         ObjectData.Coord=[0 0 0];%default
     96        ObjectData.Coord=[0 0];%default
    9797    else
    9898        return
     
    948948%% initiate Matlab  structure for physical field
    949949[ProjData,errormsg]=proj_heading(FieldData,ObjectData);
     950
     951%% reproduce initial plane position and angle
     952if 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
     971end
    950972ProjData.NbDim=2;
    951973ProjData.ListVarName={};
     
    22062228    AttrName=ProjData.ListGlobalAttribute{iattr};
    22072229    if isfield(FieldData,AttrName)
    2208         eval(['ProjData.' AttrName '=FieldData.' AttrName ';']);
     2230        ProjData.(AttrName)=FieldData.(AttrName);
    22092231    end
    22102232end
     
    22242246for ilist=1:length(ListObject)
    22252247    if isfield(ObjectData,ListObject{ilist})
    2226         eval(['val=ObjectData.' ListObject{ilist} ';'])
     2248        val=ObjectData.(ListObject{ilist});
    22272249        if ~isempty(val)
    2228             eval(['ProjData.Object' ListObject{ilist} '=val;']);
     2250            ProjData.(['Object' ListObject{ilist}])=val;
    22292251            ProjData.ListGlobalAttribute=[ProjData.ListGlobalAttribute {['Object' ListObject{ilist}]}];
    22302252        end
    22312253    end   
    22322254end
     2255
Note: See TracChangeset for help on using the changeset viewer.