- Timestamp:
- Aug 27, 2012, 4:40:00 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/transform_field/FFT2_detrend.m
r513 r532 17 17 end 18 18 %%%%%%%%%%%%%%%%%%%%%%%%% 19 [Cell VarIndex,NbDim,CellVarType,errormsg]=find_field_cells(DataIn);19 [CellInfo,NbDim,errormsg]=find_field_cells(DataIn); 20 20 if ~isempty(errormsg) 21 21 DataOut.Txt=errormsg; … … 24 24 DataOut.ListVarName={}; 25 25 DataOut.VarDimName={}; 26 for ilist=1:numel(Cell VarIndex)27 if NbDim(ilist)==2 && numel(Cell VarType{ilist}.coord)==2 % field with structured coordinates26 for ilist=1:numel(CellInfo) 27 if NbDim(ilist)==2 && numel(CellInfo{ilist}.CoordIndex)==2 % field with structured coordinates 28 28 %process coordinates 29 CoordName=DataIn.ListVarName(Cell VarType{ilist}.coord);29 CoordName=DataIn.ListVarName(CellInfo{ilist}.CoordIndex); 30 30 x1 = DataIn.(CoordName{2}); y1 = DataIn.(CoordName{1}); 31 31 [x y] = meshgrid(x1,y1); … … 48 48 end 49 49 %process scalar 50 ivar=Cell VarType{ilist}.scalar(1);50 ivar=CellInfo{ilist}.VarIndex_scalar(1); 51 51 VarName=DataIn.ListVarName{ivar}; 52 52 z=DataIn.(VarName); … … 61 61 DataOut.(VarName) = spec2; 62 62 spec_sum=sum(sum(spec2)); 63 kx_mean=sum(sum(spec2.*kx))/spec_sum 64 ky_mean=sum(sum(spec2.*ky))/spec_sum 65 theta=atand(ky_mean/kx_mean) 66 lambda=2*pi/(sqrt(kx_mean*kx_mean+ky_mean*ky_mean)) 67 %DataOut.ListVarName=[CoordName {VarName} {'kx'} {'ky'}];%list of variables 68 %DataOut.VarDimName=[CoordName {CoordName} {'one'} {'one'}];%list of dimensions for variables 63 kx_mean=sum(sum(spec2.*kx))/spec_sum; 64 ky_mean=sum(sum(spec2.*ky))/spec_sum; 65 theta=atand(ky_mean/kx_mean); 66 lambda=2*pi/(sqrt(kx_mean*kx_mean+ky_mean*ky_mean)); 69 67 70 68 DataOut.ListVarName=[CoordName {VarName}];%list of variables
Note: See TracChangeset
for help on using the changeset viewer.