Changeset 532


Ignore:
Timestamp:
Aug 27, 2012, 4:40:00 PM (12 years ago)
Author:
sommeria
Message:

FFT2_detrends adapted to new conventions for find_field_cells

File:
1 edited

Legend:

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

    r513 r532  
    1717end
    1818%%%%%%%%%%%%%%%%%%%%%%%%%
    19 [CellVarIndex,NbDim,CellVarType,errormsg]=find_field_cells(DataIn);
     19[CellInfo,NbDim,errormsg]=find_field_cells(DataIn);
    2020if ~isempty(errormsg)
    2121    DataOut.Txt=errormsg;
     
    2424DataOut.ListVarName={};
    2525DataOut.VarDimName={};
    26 for ilist=1:numel(CellVarIndex)
    27     if NbDim(ilist)==2 && numel(CellVarType{ilist}.coord)==2 % field with structured coordinates
     26for ilist=1:numel(CellInfo)
     27    if NbDim(ilist)==2 && numel(CellInfo{ilist}.CoordIndex)==2 % field with structured coordinates
    2828        %process coordinates
    29         CoordName=DataIn.ListVarName(CellVarType{ilist}.coord);
     29        CoordName=DataIn.ListVarName(CellInfo{ilist}.CoordIndex);
    3030        x1 = DataIn.(CoordName{2}); y1 = DataIn.(CoordName{1});
    3131        [x y] = meshgrid(x1,y1);
     
    4848        end
    4949        %process scalar
    50         ivar=CellVarType{ilist}.scalar(1);
     50        ivar=CellInfo{ilist}.VarIndex_scalar(1);
    5151        VarName=DataIn.ListVarName{ivar};
    5252        z=DataIn.(VarName);
     
    6161        DataOut.(VarName) = spec2;
    6262        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));
    6967       
    7068        DataOut.ListVarName=[CoordName {VarName}];%list of variables
Note: See TracChangeset for help on using the changeset viewer.