Changeset 658 for trunk/src


Ignore:
Timestamp:
Jul 3, 2013, 12:24:59 PM (11 years ago)
Author:
sommeria
Message:

a few bugs corrected

File:
1 edited

Legend:

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

    r574 r658  
    2323%INPUT:
    2424% Data:  structure of input data (like UvData)
    25 % CalibData= structure containing the field .GeometryCalib with calibration parameters
     25% XmlData= structure containing the field .GeometryCalib with calibration parameters
    2626% Data_1:  second input field (not mandatory)
    27 % CalibData_1= calibration parameters for the second field
     27% XmlData_1= calibration parameters for the second field
    2828%------------------------------------------------------------------------
    2929function DataOut=phys_polar(DataIn,XmlData,DataIn_1,XmlData_1)
     
    3131Calib{1}=[];
    3232if nargin==2||nargin==4
    33     Data=varargin{1};
    34     DataOut=Data;%default
     33    DataOut=DataIn;%default
    3534    DataOut_1=[];%default
    36     CalibData=varargin{2};
    37     if isfield(CalibData,'GeometryCalib')
    38         Calib{1}=CalibData.GeometryCalib;
     35    if isfield(XmlData,'GeometryCalib')
     36        Calib{1}=XmlData.GeometryCalib;
    3937    end
    4038    Calib{2}=Calib{1};
     
    4543if nargin==4% case of two input fields
    4644    test_1=1;
    47     Data_1=varargin{3};
    48     DataOut_1=Data_1;%default
    49     CalibData_1=varargin{4};
    50     if isfield(CalibData_1,'GeometryCalib')
    51         Calib{2}=CalibData_1.GeometryCalib;
     45    DataOut_1=DataIn_1;%default
     46    if isfield(XmlData_1,'GeometryCalib')
     47        Calib{2}=XmlData_1.GeometryCalib;
    5248    end
    5349end
     
    5652%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    5753origin_xy=[0 0];%center for the polar coordinates in the original x,y coordinates
    58 if isfield(CalibData,'PolarCentre') && isnumeric(CalibData.PolarCentre)
    59     if isequal(length(CalibData.PolarCentre),2);
    60         origin_xy= CalibData.PolarCentre;
     54if isfield(XmlData,'PolarCentre') && isnumeric(XmlData.PolarCentre)
     55    if isequal(length(XmlData.PolarCentre),2);
     56        origin_xy= XmlData.PolarCentre;
    6157    end
    6258end
    6359radius_offset=0;%reference radius used to offset the radial coordinate r
    6460angle_offset=0; %reference angle used as new origin of the polar angle (= axis Ox by default)
    65 if isfield(CalibData,'PolarReferenceRadius') && isnumeric(CalibData.PolarReferenceRadius)
    66     radius_offset=CalibData.PolarReferenceRadius;
     61if isfield(XmlData,'PolarReferenceRadius') && isnumeric(XmlData.PolarReferenceRadius)
     62    radius_offset=XmlData.PolarReferenceRadius;
    6763end
    6864if radius_offset > 0
     
    7167    angle_scale=180/pi; %polar angle in degrees
    7268end
    73 if isfield(CalibData,'PolarReferenceAngle') && isnumeric(CalibData.PolarReferenceAngle)
    74     angle_offset=CalibData.PolarReferenceAngle; %offset angle (in unit of the final angle, degrees or arc length along the reference radius))
     69if isfield(XmlData,'PolarReferenceAngle') && isnumeric(XmlData.PolarReferenceAngle)
     70    angle_offset=XmlData.PolarReferenceAngle; %offset angle (in unit of the final angle, degrees or arc length along the reference radius))
    7571end
    7672% new x coordinate = radius-radius_offset;
Note: See TracChangeset for help on using the changeset viewer.