Finished objectifying #8
| @ -5,9 +5,11 @@ function [dataOUT,params] = correct_magnetic_baseline(dataIN,params) | ||||
| %   dataIN is a dataset loaded via the LOAD_MATLAB or LOAD_BRUKER function. | ||||
| % | ||||
| %   The function will show the input data and offer an input field, where | ||||
| %   the number of field basline points should be set. By pressing "Apply" the | ||||
| %   correction will be executed and the graph changes to the corrected data. | ||||
| %   The number of field baseline points will also be appended to the params struct. | ||||
| %   the number of field basline points should be set. It is also possible to | ||||
| %   cut the field axis on both sides by the number in the second input field. | ||||
| %   By pressing "Apply" the correction will be executed and the graph changes | ||||
| %   to the corrected data. The number of field baseline points and points, | ||||
| %   which were cut off, will also be appended to the params struct. | ||||
| %   By pressing "Reset" the graph will return to show the original data. | ||||
| %   Exit the function by pressing "Done". | ||||
| 
 | ||||
| @ -112,12 +114,12 @@ uiwait(fig) | ||||
|         params.No_field_basline_pts = field_baseline; | ||||
|     end | ||||
| 
 | ||||
|     function FieldResetButtonPushed(src,event) | ||||
|     function FieldResetButtonPushed(~,~) | ||||
|         plot(ax,dataIN_transp) | ||||
|         axis tight | ||||
|     end | ||||
| 
 | ||||
|     function FieldDoneButtonPushed(src,event) | ||||
|     function FieldDoneButtonPushed(~,~) | ||||
|         close 'Correct Magnetic Baseline' | ||||
|     end | ||||
| 
 | ||||
|  | ||||
| @ -72,7 +72,7 @@ uicontrol(inp); %passes focus to input | ||||
| uiwait(fig) | ||||
| 
 | ||||
| %% Callback functions | ||||
|     function TimeApplyButtonPushed(src,event) | ||||
|     function TimeApplyButtonPushed(~,~) | ||||
|         pretrigger = str2double(get(inp,'String')); | ||||
|         %timeline CORRECTING | ||||
|         data_size = size(dataIN); | ||||
| @ -88,12 +88,12 @@ uiwait(fig) | ||||
|         params.pretrigger = pretrigger; | ||||
|     end | ||||
| 
 | ||||
|     function TimeResetButtonPushed(src,event) | ||||
|     function TimeResetButtonPushed(~,~) | ||||
|         plot(ax,dataIN) | ||||
|         axis tight | ||||
|     end | ||||
| 
 | ||||
|     function TimeDoneButtonPushed(src,event) | ||||
|     function TimeDoneButtonPushed(~,~) | ||||
|         close 'Correct Time Baseline' | ||||
|     end | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										10019
									
								
								example_data.xml
									
									
									
									
									
								
							
							
						
						
									
										10019
									
								
								example_data.xml
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -82,7 +82,7 @@ uicontrol(p1); %passes focus to first input | ||||
| uiwait(fig) | ||||
| 
 | ||||
| %% Callback functions | ||||
|     function NormApplyButtonPushed(src,event) | ||||
|     function NormApplyButtonPushed(~,~) | ||||
|         left_point = str2double(get(p1,'String')); | ||||
|         right_point = str2double(get(p2,'String')); | ||||
|         %take mean of each field line between specified min and max time | ||||
| @ -97,14 +97,13 @@ uiwait(fig) | ||||
|         params.max_mean = maxima_mean / max(maxima_mean); | ||||
|     end | ||||
| 
 | ||||
|     function NormResetButtonPushed(src,event) | ||||
|     function NormResetButtonPushed(~,~) | ||||
|         plot(ax,dataIN) | ||||
|         axis tight | ||||
|     end | ||||
| 
 | ||||
|     function NormDoneButtonPushed(src,event) | ||||
|     function NormDoneButtonPushed(~,~) | ||||
|         close 'Normalize Data' | ||||
|     end | ||||
| 
 | ||||
| end | ||||
| 
 | ||||
|  | ||||
| @ -259,7 +259,7 @@ uicontrol(InpTx); %passes focus to first input | ||||
| uiwait(fig) | ||||
| 
 | ||||
| %% Callback functions | ||||
|     function PreSimApplyButtonPushed(src,event) | ||||
|     function PreSimApplyButtonPushed(~,~) | ||||
|         %get values from params | ||||
|         Exp.mwFreq = params.mwFreq; % GHz | ||||
|         Exp.nPoints = length(params.Field_Vector); | ||||
| @ -293,7 +293,7 @@ uiwait(fig) | ||||
|         params.Triplett_pop = Exp.Temperature; | ||||
|     end | ||||
| 
 | ||||
|     function PreSimDoneButtonPushed(src,event) | ||||
|     function PreSimDoneButtonPushed(~,~) | ||||
|         close 'Manual Simulation' | ||||
|     end | ||||
| 
 | ||||
|  | ||||
| @ -309,7 +309,7 @@ uicontrol(InpTx); %passes focus to first input | ||||
| uiwait(fig) | ||||
| 
 | ||||
| %% Callback functions | ||||
|     function SimStartButtonPushed(src,event) | ||||
|     function SimStartButtonPushed(~,~) | ||||
|         %get Vary and Opt from Input | ||||
|         varT1 = str2double(get(InpTx,'String')); | ||||
|         varT2 = str2double(get(InpTy,'String')); | ||||
| @ -343,7 +343,7 @@ uiwait(fig) | ||||
|         eventdata.BestSys = BestSys; | ||||
|     end | ||||
|      | ||||
|     function SimSaveButtonPushed(src,event) | ||||
|     function SimSaveButtonPushed(~,~) | ||||
|         %set current parameters as new start values | ||||
|         eventdata.simSys = eventdata.BestSys; | ||||
|         eventdata.simExp.Temperature = eventdata.BestSys.Temperature; | ||||
| @ -351,7 +351,7 @@ uiwait(fig) | ||||
|         params.Fitted_Simulation = eventdata.BestSys; | ||||
|     end | ||||
|      | ||||
|     function SimDoneButtonPushed(src,event) | ||||
|     function SimDoneButtonPushed(~,~) | ||||
|         close 'Simulation' | ||||
|     end | ||||
|   | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user