- Timestamp:
- Jul 3, 2013, 12:24:59 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/transform_field/phys_polar.m
r574 r658 23 23 %INPUT: 24 24 % Data: structure of input data (like UvData) 25 % CalibData= structure containing the field .GeometryCalib with calibration parameters25 % XmlData= structure containing the field .GeometryCalib with calibration parameters 26 26 % Data_1: second input field (not mandatory) 27 % CalibData_1= calibration parameters for the second field27 % XmlData_1= calibration parameters for the second field 28 28 %------------------------------------------------------------------------ 29 29 function DataOut=phys_polar(DataIn,XmlData,DataIn_1,XmlData_1) … … 31 31 Calib{1}=[]; 32 32 if nargin==2||nargin==4 33 Data=varargin{1}; 34 DataOut=Data;%default 33 DataOut=DataIn;%default 35 34 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; 39 37 end 40 38 Calib{2}=Calib{1}; … … 45 43 if nargin==4% case of two input fields 46 44 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; 52 48 end 53 49 end … … 56 52 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 57 53 origin_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;54 if isfield(XmlData,'PolarCentre') && isnumeric(XmlData.PolarCentre) 55 if isequal(length(XmlData.PolarCentre),2); 56 origin_xy= XmlData.PolarCentre; 61 57 end 62 58 end 63 59 radius_offset=0;%reference radius used to offset the radial coordinate r 64 60 angle_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;61 if isfield(XmlData,'PolarReferenceRadius') && isnumeric(XmlData.PolarReferenceRadius) 62 radius_offset=XmlData.PolarReferenceRadius; 67 63 end 68 64 if radius_offset > 0 … … 71 67 angle_scale=180/pi; %polar angle in degrees 72 68 end 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))69 if 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)) 75 71 end 76 72 % new x coordinate = radius-radius_offset;
Note: See TracChangeset
for help on using the changeset viewer.