1 | function varargout = Comparaison_enregistrements(varargin) |
---|
2 | % COMPARAISON_ENREGISTREMENTS M-file for Comparaison_enregistrements.fig |
---|
3 | % COMPARAISON_ENREGISTREMENTS, by itself, creates a new COMPARAISON_ENREGISTREMENTS or raises the existing |
---|
4 | % singleton*. |
---|
5 | % |
---|
6 | % H = COMPARAISON_ENREGISTREMENTS returns the handle to a new COMPARAISON_ENREGISTREMENTS or the handle to |
---|
7 | % the existing singleton*. |
---|
8 | % |
---|
9 | % COMPARAISON_ENREGISTREMENTS('CALLBACK',hObject,eventData,handles,...) calls the local |
---|
10 | % function named CALLBACK in COMPARAISON_ENREGISTREMENTS.M with the given input arguments. |
---|
11 | % |
---|
12 | % COMPARAISON_ENREGISTREMENTS('Property','Value',...) creates a new COMPARAISON_ENREGISTREMENTS or raises the |
---|
13 | % existing singleton*. Starting from the left, property value pairs are |
---|
14 | % applied to the GUI before Comparaison_enregistrements_OpeningFcn gets called. An |
---|
15 | % unrecognized property name or invalid value makes property application |
---|
16 | % stop. All inputs are passed to Comparaison_enregistrements_OpeningFcn via varargin. |
---|
17 | % |
---|
18 | % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one |
---|
19 | % instance to run (singleton)". |
---|
20 | % |
---|
21 | % See also: GUIDE, GUIDATA, GUIHANDLES |
---|
22 | |
---|
23 | % Edit the above text to modify the response to help Comparaison_enregistrements |
---|
24 | |
---|
25 | % Last Modified by GUIDE v2.5 15-Sep-2011 15:41:57 |
---|
26 | |
---|
27 | % Begin initialization code - DO NOT EDIT |
---|
28 | gui_Singleton = 1; |
---|
29 | gui_State = struct('gui_Name', mfilename, ... |
---|
30 | 'gui_Singleton', gui_Singleton, ... |
---|
31 | 'gui_OpeningFcn', @Comparaison_enregistrements_OpeningFcn, ... |
---|
32 | 'gui_OutputFcn', @Comparaison_enregistrements_OutputFcn, ... |
---|
33 | 'gui_LayoutFcn', [] , ... |
---|
34 | 'gui_Callback', []); |
---|
35 | if nargin && ischar(varargin{1}) |
---|
36 | gui_State.gui_Callback = str2func(varargin{1}); |
---|
37 | end |
---|
38 | |
---|
39 | if nargout |
---|
40 | [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); |
---|
41 | else |
---|
42 | gui_mainfcn(gui_State, varargin{:}); |
---|
43 | end |
---|
44 | % End initialization code - DO NOT EDIT |
---|
45 | |
---|
46 | |
---|
47 | % --- Executes just before Comparaison_enregistrements is made visible. |
---|
48 | function Comparaison_enregistrements_OpeningFcn(hObject, eventdata, handles, varargin) |
---|
49 | % This function has no output args, see OutputFcn. |
---|
50 | % hObject handle to figure |
---|
51 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
52 | % handles structure with handles and user data (see GUIDATA) |
---|
53 | % varargin command line arguments to Comparaison_enregistrements (see VARARGIN) |
---|
54 | |
---|
55 | % Choose default command line output for Comparaison_enregistrements |
---|
56 | handles.output = hObject; |
---|
57 | |
---|
58 | % Update handles structure |
---|
59 | guidata(hObject, handles); |
---|
60 | |
---|
61 | % UIWAIT makes Comparaison_enregistrements wait for user response (see UIRESUME) |
---|
62 | % uiwait(handles.figure1); |
---|
63 | pathname='/home/operateur/GrpDiagnostics/matlab/data/'; |
---|
64 | setappdata(handles.figure1,'pathname',pathname); |
---|
65 | |
---|
66 | % --- Outputs from this function are returned to the command line. |
---|
67 | function varargout = Comparaison_enregistrements_OutputFcn(hObject, eventdata, handles) |
---|
68 | % varargout cell array for returning output args (see VARARGOUT); |
---|
69 | % hObject handle to figure |
---|
70 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
71 | % handles structure with handles and user data (see GUIDATA) |
---|
72 | |
---|
73 | % Get default command line output from handles structure |
---|
74 | varargout{1} = handles.output; |
---|
75 | |
---|
76 | |
---|
77 | % --- Executes on button press in load1. |
---|
78 | function load1_Callback(hObject, eventdata, handles) |
---|
79 | % hObject handle to load1 (see GCBO) |
---|
80 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
81 | % handles structure with handles and user data (see GUIDATA) |
---|
82 | pathname=getappdata(handles.figure1,'pathname'); |
---|
83 | [filename, pathname, filterindex] = uigetfile('*.mat', 'Pick an MAT-file',pathname); |
---|
84 | if isequal(filename,0) || isequal(pathname,0) |
---|
85 | disp('Loading cancelled by user') |
---|
86 | else |
---|
87 | setappdata(handles.figure1,'pathname',pathname); |
---|
88 | set(handles.courbe1,'string',[pathname filename]); |
---|
89 | load([pathname filename],'bufferX','bufferZ','BPM_list'); |
---|
90 | |
---|
91 | |
---|
92 | [selection ok]=listdlg('liststring',BPM_list,'Name','Select BPM(s)'); |
---|
93 | if ok |
---|
94 | amplitude=max(bufferX(selection(1),:))-min(bufferX(selection(1),:)) |
---|
95 | if amplitude<500 |
---|
96 | figure |
---|
97 | subplot(2,1,1) |
---|
98 | plot(bufferX(selection(1),:)); |
---|
99 | subplot(2,1,2) |
---|
100 | plot(bufferZ(selection(1),:)); |
---|
101 | ButtonName = questdlg('Data loaded seems to be in µm and must be converted to nm', ... |
---|
102 | 'Warning', ... |
---|
103 | 'Convert', 'Ignore','Convert'); |
---|
104 | switch ButtonName, |
---|
105 | case 'Convert', |
---|
106 | bufferX=bufferX.*1000; |
---|
107 | bufferZ=bufferZ.*1000; |
---|
108 | case 'Ignore', |
---|
109 | |
---|
110 | |
---|
111 | end % switch |
---|
112 | end |
---|
113 | N_BPM=size(BPM_list,1); |
---|
114 | %Nsamples=size(bufferX(j,:),2); |
---|
115 | fech=10079; |
---|
116 | index=regexp(filename,'_'); |
---|
117 | filename(index)=' '; |
---|
118 | struct1.filename=filename; |
---|
119 | struct1.pathname=pathname; |
---|
120 | struct1.BPM_list=BPM_list(selection); |
---|
121 | tic |
---|
122 | [pxfftaff_all,pzfftaff_all,Xintegrale_all,Zintegrale_all,f_bpm]=fft_and_noise_calcul_group(bufferX,bufferZ,fech); |
---|
123 | toc |
---|
124 | struct1.f_bpm=f_bpm; |
---|
125 | struct1.Xintegrale_all=Xintegrale_all(selection,2:size(Xintegrale_all,2)); |
---|
126 | struct1.Zintegrale_all=Zintegrale_all(selection,2:size(Zintegrale_all,2)); |
---|
127 | struct1.pxfftaff_all=pxfftaff_all(selection,2:size(pxfftaff_all,2)); |
---|
128 | struct1.pzfftaff_all=pzfftaff_all(selection,2:size(pzfftaff_all,2)); |
---|
129 | if size(selection,2)==1 |
---|
130 | struct1.Xintegrale_mean=(struct1.Xintegrale_all(:,:)); |
---|
131 | struct1.Zintegrale_mean=(struct1.Zintegrale_all(:,:)); |
---|
132 | struct1.pxfftaff_mean=(struct1.pxfftaff_all(:,:)); |
---|
133 | struct1.pzfftaff_mean=(struct1.pzfftaff_all(:,:)); |
---|
134 | else |
---|
135 | struct1.Xintegrale_mean=mean(struct1.Xintegrale_all(:,:)); |
---|
136 | struct1.Zintegrale_mean=mean(struct1.Zintegrale_all(:,:)); |
---|
137 | struct1.pxfftaff_mean=mean(struct1.pxfftaff_all(:,:)); |
---|
138 | struct1.pzfftaff_mean=mean(struct1.pzfftaff_all(:,:)); |
---|
139 | end |
---|
140 | setappdata(handles.figure1,'struct1',struct1); |
---|
141 | struct2=getappdata(handles.figure1,'struct2'); |
---|
142 | |
---|
143 | affichage(hObject, eventdata, handles); |
---|
144 | end |
---|
145 | end |
---|
146 | |
---|
147 | |
---|
148 | |
---|
149 | |
---|
150 | % --- Executes on button press in load2. |
---|
151 | function load2_Callback(hObject, eventdata, handles) |
---|
152 | % hObject handle to load2 (see GCBO) |
---|
153 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
154 | % handles structure with handles and user data (see GUIDATA) |
---|
155 | pathname=getappdata(handles.figure1,'pathname'); |
---|
156 | [filename, pathname, filterindex] = uigetfile('*.mat', 'Pick an MAT-file',pathname); |
---|
157 | if isequal(filename,0) || isequal(pathname,0) |
---|
158 | disp('Loading cancelled by user') |
---|
159 | else |
---|
160 | setappdata(handles.figure1,'pathname',pathname); |
---|
161 | set(handles.courbe2,'string',[pathname filename]); |
---|
162 | load([pathname filename],'bufferX','bufferZ','BPM_list'); |
---|
163 | |
---|
164 | |
---|
165 | [selection ok]=listdlg('liststring',BPM_list,'Name','Select BPM(s)'); |
---|
166 | if ok |
---|
167 | N_BPM=size(BPM_list,1); |
---|
168 | %Nsamples=size(bufferX(j,:),2); |
---|
169 | fech=10079; |
---|
170 | index=regexp(filename,'_'); |
---|
171 | filename(index)=' '; |
---|
172 | struct2.filename=filename; |
---|
173 | struct2.pathname=pathname; |
---|
174 | struct2.BPM_list=BPM_list(selection); |
---|
175 | tic |
---|
176 | [pxfftaff_all,pzfftaff_all,Xintegrale_all,Zintegrale_all,f_bpm]=fft_and_noise_calcul_group(bufferX,bufferZ,fech); |
---|
177 | toc |
---|
178 | struct2.f_bpm=f_bpm; |
---|
179 | struct2.Xintegrale_all=Xintegrale_all(selection,2:size(Xintegrale_all,2)); |
---|
180 | struct2.Zintegrale_all=Zintegrale_all(selection,2:size(Zintegrale_all,2)); |
---|
181 | struct2.pxfftaff_all=pxfftaff_all(selection,2:size(pxfftaff_all,2)); |
---|
182 | struct2.pzfftaff_all=pzfftaff_all(selection,2:size(pzfftaff_all,2)); |
---|
183 | if size(selection)==1 |
---|
184 | struct2.Xintegrale_mean=(struct2.Xintegrale_all(:,:)); |
---|
185 | struct2.Zintegrale_mean=(struct2.Zintegrale_all(:,:)); |
---|
186 | struct2.pxfftaff_mean=(struct2.pxfftaff_all(:,:)); |
---|
187 | struct2.pzfftaff_mean=(struct2.pzfftaff_all(:,:)); |
---|
188 | else |
---|
189 | struct2.Xintegrale_mean=mean(struct2.Xintegrale_all(:,:)); |
---|
190 | struct2.Zintegrale_mean=mean(struct2.Zintegrale_all(:,:)); |
---|
191 | struct2.pxfftaff_mean=mean(struct2.pxfftaff_all(:,:)); |
---|
192 | struct2.pzfftaff_mean=mean(struct2.pzfftaff_all(:,:)); |
---|
193 | end |
---|
194 | setappdata(handles.figure1,'struct2',struct2); |
---|
195 | struct1=getappdata(handles.figure1,'struct1'); |
---|
196 | |
---|
197 | affichage(hObject, eventdata, handles); |
---|
198 | end |
---|
199 | end |
---|
200 | |
---|
201 | % --- Executes on selection change in plan. |
---|
202 | function plan_Callback(hObject, eventdata, handles) |
---|
203 | % hObject handle to plan (see GCBO) |
---|
204 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
205 | % handles structure with handles and user data (see GUIDATA) |
---|
206 | |
---|
207 | % Hints: contents = cellstr(get(hObject,'String')) returns plan contents as cell array |
---|
208 | % contents{get(hObject,'Value')} returns selected item from plan |
---|
209 | affichage(hObject, eventdata, handles) |
---|
210 | |
---|
211 | |
---|
212 | % --- Executes during object creation, after setting all properties. |
---|
213 | function plan_CreateFcn(hObject, eventdata, handles) |
---|
214 | % hObject handle to plan (see GCBO) |
---|
215 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
216 | % handles empty - handles not created until after all CreateFcns called |
---|
217 | |
---|
218 | % Hint: popupmenu controls usually have a white background on Windows. |
---|
219 | % See ISPC and COMPUTER. |
---|
220 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
221 | set(hObject,'BackgroundColor','white'); |
---|
222 | end |
---|
223 | |
---|
224 | |
---|
225 | |
---|
226 | function fstart_Callback(hObject, eventdata, handles) |
---|
227 | % hObject handle to fstart (see GCBO) |
---|
228 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
229 | % handles structure with handles and user data (see GUIDATA) |
---|
230 | |
---|
231 | % Hints: get(hObject,'String') returns contents of fstart as text |
---|
232 | % str2double(get(hObject,'String')) returns contents of fstart as a double |
---|
233 | affichage(hObject, eventdata, handles) |
---|
234 | |
---|
235 | |
---|
236 | % --- Executes during object creation, after setting all properties. |
---|
237 | function fstart_CreateFcn(hObject, eventdata, handles) |
---|
238 | % hObject handle to fstart (see GCBO) |
---|
239 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
240 | % handles empty - handles not created until after all CreateFcns called |
---|
241 | |
---|
242 | % Hint: edit controls usually have a white background on Windows. |
---|
243 | % See ISPC and COMPUTER. |
---|
244 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
245 | set(hObject,'BackgroundColor','white'); |
---|
246 | end |
---|
247 | |
---|
248 | |
---|
249 | |
---|
250 | function fstop_Callback(hObject, eventdata, handles) |
---|
251 | % hObject handle to fstop (see GCBO) |
---|
252 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
253 | % handles structure with handles and user data (see GUIDATA) |
---|
254 | |
---|
255 | % Hints: get(hObject,'String') returns contents of fstop as text |
---|
256 | % str2double(get(hObject,'String')) returns contents of fstop as a double |
---|
257 | affichage(hObject, eventdata, handles) |
---|
258 | |
---|
259 | |
---|
260 | % --- Executes during object creation, after setting all properties. |
---|
261 | function fstop_CreateFcn(hObject, eventdata, handles) |
---|
262 | % hObject handle to fstop (see GCBO) |
---|
263 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
264 | % handles empty - handles not created until after all CreateFcns called |
---|
265 | |
---|
266 | % Hint: edit controls usually have a white background on Windows. |
---|
267 | % See ISPC and COMPUTER. |
---|
268 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
269 | set(hObject,'BackgroundColor','white'); |
---|
270 | end |
---|
271 | |
---|
272 | function affichage(hObject, eventdata, handles) |
---|
273 | |
---|
274 | struct1=getappdata(handles.figure1,'struct1'); |
---|
275 | struct2=getappdata(handles.figure1,'struct2'); |
---|
276 | |
---|
277 | plan=get(handles.plan,'value'); |
---|
278 | fstart=str2num(get(handles.fstart,'string')); |
---|
279 | fstop=str2num(get(handles.fstop,'string')); |
---|
280 | bruit_integre1=0; |
---|
281 | bruit_integre2=0; |
---|
282 | filename1=''; |
---|
283 | filename2=''; |
---|
284 | |
---|
285 | |
---|
286 | if plan==1 |
---|
287 | if isempty(struct1)==0 |
---|
288 | set(handles.courbe1,'string',[struct1.pathname struct1.filename]); |
---|
289 | semilogy(handles.spectre,struct1.f_bpm,struct1.pxfftaff_mean,'b','LineWidth',2); |
---|
290 | hold(handles.spectre,'on'); |
---|
291 | semilogy(handles.bruit,struct1.f_bpm,struct1.Xintegrale_mean,'b','LineWidth',3); |
---|
292 | hold(handles.bruit,'on'); |
---|
293 | filename1=struct1.filename; |
---|
294 | index=find(struct1.f_bpm>fstop); |
---|
295 | bruit_integre1=struct1.Xintegrale_mean(index(1)); |
---|
296 | end |
---|
297 | if isempty(struct2)==0 |
---|
298 | set(handles.courbe2,'string',[struct2.pathname struct2.filename]); |
---|
299 | semilogy(handles.spectre,struct2.f_bpm,struct2.pxfftaff_mean,'r','LineWidth',2); |
---|
300 | semilogy(handles.bruit,struct2.f_bpm,struct2.Xintegrale_mean,'r','LineWidth',3); |
---|
301 | filename2=struct2.filename; |
---|
302 | index=find(struct2.f_bpm>fstop); |
---|
303 | bruit_integre2=struct2.Xintegrale_mean(index(1)); |
---|
304 | end |
---|
305 | else |
---|
306 | if isempty(struct1)==0 |
---|
307 | semilogy(handles.spectre,struct1.f_bpm,struct1.pzfftaff_mean,'b','LineWidth',2); |
---|
308 | hold(handles.spectre,'on'); |
---|
309 | semilogy(handles.bruit,struct1.f_bpm,struct1.Zintegrale_mean,'b','LineWidth',3); |
---|
310 | hold(handles.bruit,'on'); |
---|
311 | filename1=struct1.filename; |
---|
312 | index=find(struct1.f_bpm>fstop); |
---|
313 | bruit_integre1=struct1.Zintegrale_mean(index(1)); |
---|
314 | end |
---|
315 | if isempty(struct2)==0 |
---|
316 | semilogy(handles.spectre,struct2.f_bpm,struct2.pzfftaff_mean,'r','LineWidth',2); |
---|
317 | semilogy(handles.bruit,struct2.f_bpm,struct2.Zintegrale_mean,'r','LineWidth',3); |
---|
318 | filename2=struct2.filename; |
---|
319 | index=find(struct2.f_bpm>fstop); |
---|
320 | bruit_integre2=struct2.Zintegrale_mean(index(1)); |
---|
321 | end |
---|
322 | end |
---|
323 | xlim(handles.spectre,[fstart fstop]); |
---|
324 | ylim(handles.spectre,[10^-3 10^2]); |
---|
325 | xlabel(handles.spectre,'frequency (Hz)','fontsize',16,'fontangle','italic','FontWeight','Bold'); |
---|
326 | ylabel(handles.spectre,'µm/sqrt(Hz)','FontWeight','Bold'); |
---|
327 | title(handles.spectre,'Averaged fft amplitude','FontWeight','Bold'); |
---|
328 | |
---|
329 | legend(handles.spectre,filename1,filename2); |
---|
330 | set(handles.spectre,'XGrid','on','YGrid','on'); |
---|
331 | hold(handles.spectre,'off'); |
---|
332 | |
---|
333 | |
---|
334 | xlim(handles.bruit,[fstart fstop]); |
---|
335 | ylim(handles.bruit,[2*10^-2 5*10^2]); |
---|
336 | xlabel(handles.bruit,'frequency (Hz)','fontsize',16,'fontangle','italic','FontWeight','Bold'); |
---|
337 | ylabel(handles.bruit,'µm','FontWeight','Bold'); |
---|
338 | title(handles.bruit,'Averaged noise','FontWeight','Bold'); |
---|
339 | |
---|
340 | |
---|
341 | legend(handles.bruit,[num2str(bruit_integre1),' µm'],[num2str(bruit_integre2),' µm'],'Location','SouthEast'); |
---|
342 | set(handles.bruit,'XGrid','on','YGrid','on'); |
---|
343 | hold(handles.bruit,'off'); |
---|
344 | |
---|
345 | % figure |
---|
346 | % loglog(struct1.f_bpm,struct1.pxfftaff_mean,'r--','LineWidth',2); |
---|
347 | % hold on; |
---|
348 | % loglog(struct2.f_bpm,struct2.pxfftaff_mean,'r','LineWidth',2); |
---|
349 | % loglog(struct1.f_bpm,struct1.pzfftaff_mean,'b--','LineWidth',2); |
---|
350 | % loglog(struct1.f_bpm,struct2.pzfftaff_mean,'b','LineWidth',2); |
---|
351 | % |
---|
352 | % figure |
---|
353 | % loglog(struct1.f_bpm,struct1.Xintegrale_mean,'r--','LineWidth',3); |
---|
354 | % hold on; |
---|
355 | % loglog(struct2.f_bpm,struct2.Xintegrale_mean,'r','LineWidth',3); |
---|
356 | % loglog(struct1.f_bpm,struct1.Zintegrale_mean,'b--','LineWidth',3); |
---|
357 | % loglog(struct1.f_bpm,struct2.Zintegrale_mean,'b','LineWidth',3); |
---|
358 | |
---|
359 | |
---|
360 | |
---|
361 | |
---|
362 | % --- Executes on button press in measure. |
---|
363 | function measure_Callback(hObject, eventdata, handles) |
---|
364 | % hObject handle to measure (see GCBO) |
---|
365 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
366 | % handles structure with handles and user data (see GUIDATA) |
---|
367 | %spectres_GUI |
---|
368 | record_length=str2num(get(handles.record_length,'string')); |
---|
369 | save2xls=0; |
---|
370 | fmin=str2num(get(handles.fstart,'string')); |
---|
371 | fmax=str2num(get(handles.fstop,'string')); |
---|
372 | source=get(handles.source,'value'); |
---|
373 | switch source |
---|
374 | case 1 |
---|
375 | [BPM_list bufferX bufferZ pxfftaff_all pzfftaff_all Xintegrale_all Zintegrale_all f_bpm]=Compute_FFT_on_FA_data(record_length,fmin,fmax,save2xls); |
---|
376 | case 2 |
---|
377 | %Compute_FFT_on_XBPM_data(fmin,fmax,save2xls); |
---|
378 | warndlg('Record on XBPM disabled at the moment', 'Warning'); |
---|
379 | case 3 |
---|
380 | %Compute_FFT_on_Libera_Photon_FA_data(fmin,fmax,save2xls); |
---|
381 | warndlg('Record on Libera Photon disabled at the moment', 'Warning'); |
---|
382 | end |
---|
383 | ButtonName = questdlg('Do you want to display this measurement?', 'Display', 'Plot1', 'Plot2','No', 'No'); |
---|
384 | switch ButtonName |
---|
385 | case 'Plot1' |
---|
386 | N_BPM=size(BPM_list,1); |
---|
387 | %index=regexp(filename,'_'); |
---|
388 | %filename(index)=' '; |
---|
389 | %struct1.filename=filename; |
---|
390 | %struct1.pathname=pathname; |
---|
391 | struct1.filename='unknown'; |
---|
392 | struct1.pathname='unknown'; |
---|
393 | struct1.BPM_list=BPM_list; |
---|
394 | struct1.f_bpm=f_bpm; |
---|
395 | struct1.Xintegrale_all=Xintegrale_all(:,2:size(Xintegrale_all,2)); |
---|
396 | struct1.Zintegrale_all=Zintegrale_all(:,2:size(Zintegrale_all,2)); |
---|
397 | struct1.pxfftaff_all=pxfftaff_all(:,2:size(pxfftaff_all,2)); |
---|
398 | struct1.pzfftaff_all=pzfftaff_all(:,2:size(pzfftaff_all,2)); |
---|
399 | if N_BPM==1 |
---|
400 | struct1.Xintegrale_mean=(struct1.Xintegrale_all(:,:)); |
---|
401 | struct1.Zintegrale_mean=(struct1.Zintegrale_all(:,:)); |
---|
402 | struct1.pxfftaff_mean=(struct1.pxfftaff_all(:,:)); |
---|
403 | struct1.pzfftaff_mean=(struct1.pzfftaff_all(:,:)); |
---|
404 | else |
---|
405 | struct1.Xintegrale_mean=mean(struct1.Xintegrale_all(:,:)); |
---|
406 | struct1.Zintegrale_mean=mean(struct1.Zintegrale_all(:,:)); |
---|
407 | struct1.pxfftaff_mean=mean(struct1.pxfftaff_all(:,:)); |
---|
408 | struct1.pzfftaff_mean=mean(struct1.pzfftaff_all(:,:)); |
---|
409 | end |
---|
410 | setappdata(handles.figure1,'struct1',struct1); |
---|
411 | case 'Plot2' |
---|
412 | N_BPM=size(BPM_list,1); |
---|
413 | %index=regexp(filename,'_'); |
---|
414 | %filename(index)=' '; |
---|
415 | %struct2.filename=filename; |
---|
416 | %struct2.pathname=pathname; |
---|
417 | struct2.filename='unknown'; |
---|
418 | struct2.pathname='unknown'; |
---|
419 | struct2.BPM_list=BPM_list; |
---|
420 | struct2.f_bpm=f_bpm; |
---|
421 | struct2.Xintegrale_all=Xintegrale_all(:,2:size(Xintegrale_all,2)); |
---|
422 | struct2.Zintegrale_all=Zintegrale_all(:,2:size(Zintegrale_all,2)); |
---|
423 | struct2.pxfftaff_all=pxfftaff_all(:,2:size(pxfftaff_all,2)); |
---|
424 | struct2.pzfftaff_all=pzfftaff_all(:,2:size(pzfftaff_all,2)); |
---|
425 | if N_BPM==1 |
---|
426 | struct2.Xintegrale_mean=(struct2.Xintegrale_all(:,:)); |
---|
427 | struct2.Zintegrale_mean=(struct2.Zintegrale_all(:,:)); |
---|
428 | struct2.pxfftaff_mean=(struct2.pxfftaff_all(:,:)); |
---|
429 | struct2.pzfftaff_mean=(struct2.pzfftaff_all(:,:)); |
---|
430 | else |
---|
431 | struct2.Xintegrale_mean=mean(struct2.Xintegrale_all(:,:)); |
---|
432 | struct2.Zintegrale_mean=mean(struct2.Zintegrale_all(:,:)); |
---|
433 | struct2.pxfftaff_mean=mean(struct2.pxfftaff_all(:,:)); |
---|
434 | struct2.pzfftaff_mean=mean(struct2.pzfftaff_all(:,:)); |
---|
435 | end |
---|
436 | setappdata(handles.figure1,'struct2',struct2); |
---|
437 | case 'No' |
---|
438 | end |
---|
439 | affichage(hObject, eventdata, handles); |
---|
440 | |
---|
441 | % --- Executes on button press in switch_plots. |
---|
442 | function switch_plots_Callback(hObject, eventdata, handles) |
---|
443 | % hObject handle to switch_plots (see GCBO) |
---|
444 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
445 | % handles structure with handles and user data (see GUIDATA) |
---|
446 | struct1=getappdata(handles.figure1,'struct1'); |
---|
447 | struct2=getappdata(handles.figure1,'struct2'); |
---|
448 | |
---|
449 | setappdata(handles.figure1,'struct2',struct1); |
---|
450 | setappdata(handles.figure1,'struct1',struct2); |
---|
451 | |
---|
452 | affichage(hObject, eventdata, handles); |
---|
453 | |
---|
454 | |
---|
455 | |
---|
456 | function record_length_Callback(hObject, eventdata, handles) |
---|
457 | % hObject handle to record_length (see GCBO) |
---|
458 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
459 | % handles structure with handles and user data (see GUIDATA) |
---|
460 | |
---|
461 | % Hints: get(hObject,'String') returns contents of record_length as text |
---|
462 | % str2double(get(hObject,'String')) returns contents of record_length as a double |
---|
463 | record_length=str2num(get(handles.record_length,'string')); |
---|
464 | if record_length>10 |
---|
465 | f = warndlg('Record Length is limited to 10s', 'Warning'); |
---|
466 | set(handles.record_length,'string',num2str(10)); |
---|
467 | end |
---|
468 | |
---|
469 | % --- Executes during object creation, after setting all properties. |
---|
470 | function record_length_CreateFcn(hObject, eventdata, handles) |
---|
471 | % hObject handle to record_length (see GCBO) |
---|
472 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
473 | % handles empty - handles not created until after all CreateFcns called |
---|
474 | |
---|
475 | % Hint: edit controls usually have a white background on Windows. |
---|
476 | % See ISPC and COMPUTER. |
---|
477 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
478 | set(hObject,'BackgroundColor','white'); |
---|
479 | end |
---|
480 | |
---|
481 | |
---|
482 | % --- Executes on selection change in source. |
---|
483 | function source_Callback(hObject, eventdata, handles) |
---|
484 | % hObject handle to source (see GCBO) |
---|
485 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
486 | % handles structure with handles and user data (see GUIDATA) |
---|
487 | |
---|
488 | % Hints: contents = cellstr(get(hObject,'String')) returns source contents as cell array |
---|
489 | % contents{get(hObject,'Value')} returns selected item from source |
---|
490 | |
---|
491 | |
---|
492 | % --- Executes during object creation, after setting all properties. |
---|
493 | function source_CreateFcn(hObject, eventdata, handles) |
---|
494 | % hObject handle to source (see GCBO) |
---|
495 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
496 | % handles empty - handles not created until after all CreateFcns called |
---|
497 | |
---|
498 | % Hint: popupmenu controls usually have a white background on Windows. |
---|
499 | % See ISPC and COMPUTER. |
---|
500 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
501 | set(hObject,'BackgroundColor','white'); |
---|
502 | end |
---|
503 | |
---|
504 | |
---|
505 | |
---|