source: trunk/src/get_field/FFT2.m @ 658

Last change on this file since 658 was 504, checked in by sommeria, 12 years ago

FFT2 (2D fft ) introduced

File size: 1.2 KB
Line 
1% 'FFT': calculate and display spectrum of the field selected in the GUI  get_field
2%  GUI_input=FFT(hget_field)
3%
4% OUTPUT:
5% GUI_input: option for display in the GUI get_field
6%
7%INPUT:
8% hget_field: handles of the GUI get_field
9%
10
11function SubField=FFT2(hget_field)
12%% set the input elements needed on the GUI get_field when the action is selected in the menu ActionName
13if ~exist('hget_field','var') % case with no input parameter
14    SubField={'CheckPlot1D','off';...% enable simple x/y plot ('off'/'on')
15        'CheckScalar','on';...%  enable scalar selection('off'/'on')
16        'CheckVector','off'; ...%  enable vector selection('off'/'on')
17               '',''};
18        return
19end
20%%%%%%%%%%%%%%%%%%%%%%%%%
21
22[SubField,errormsg]=read_get_field(hget_field);
23SubField
24for ilist=1:numel(SubField.ListVarName)
25    if isfield(SubField.VarAttribute{ilist},'Role') && isequal(SubField.VarAttribute{ilist}.Role,'scalar')
26        VarName=SubField.ListVarName{ilist};
27        spec=abs(fft2(SubField.(VarName)-mean(mean(SubField.(VarName)))));
28        SubField.(VarName)=log(spec);
29    end
30end
31 
32if ~isempty(errormsg)
33    msgbox_uvmat('ERROR',['error in read_get_field input:' errormsg])
34    return
35end
36SubField
37
Note: See TracBrowser for help on using the repository browser.