Changeset 161


Ignore:
Timestamp:
Dec 23, 2010, 8:53:48 AM (10 years ago)
Author:
sommeria
Message:

bug corrected in phys_polar (CoordType? not used anymore)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/transform_field/phys_polar.m

    r157 r161  
    113113end
    114114
     115
     116
     117
    115118%------------------------------------------------
    116119function DataOut=phys_1(Data,Calib,origin_xy,radius_offset,angle_offset,angle_scale)
    117120
    118121DataOut=Data;
    119 DataOut.CoordType='phys'; %put flag for physical coordinates
    120 if isfield(Calib,'CoordUnit')
    121     DataOut.CoordUnit=Calib.CoordUnit;
    122 else
    123     DataOut.CoordUnit='cm'; %default
    124 end
    125 DataOut.TimeUnit='s';
    126 %perform a geometry transform if Calib contains a field .GeometryCalib
    127 if isfield(Data,'CoordType') && isequal(Data.CoordType,'px') && ~isempty(Calib)
    128     if isfield(Data,'CoordUnit')
    129          DataOut=rmfield(DataOut,'CoordUnit');
    130     end
     122DataOut.CoordUnit=Calib.CoordUnit; %put flag for physical coordinates
     123if isfield(Calib,'SliceCoord')
     124    DataOut.PlaneCoord=Calib.SliceCoord;%to generalise for any plane
     125end
     126
     127if isfield(Data,'CoordUnit')%&& isequal(Data.CoordType,'px')&& ~isempty(Calib)
     128    if isfield(Calib,'CoordUnit')
     129        DataOut.CoordUnit=Calib.CoordUnit;
     130    else
     131        DataOut.CoordUnit='cm'; %default
     132    end
     133    DataOut.TimeUnit='s';
    131134    %transform of X,Y coordinates for vector fields
    132     if isfield(Data,'ZIndex')&~isempty(Data.ZIndex)
     135    if isfield(Data,'ZIndex') && ~isempty(Data.ZIndex)&&~isnan(Data.ZIndex)
    133136        Z=Data.ZIndex;
    134137    else
Note: See TracChangeset for help on using the changeset viewer.