@@ -22,54 +22,26 @@ def test_fit_dialog():
2222 """Test function"""
2323 with qt_app_context ():
2424 # Multi-gaussian curve fitting test
25- s = get_test_signal ("paracetamol.txt" )
26- peakidx = peak_indices (s .y )
27- execenv .print (
28- fdlg .multigaussianfit (s .x , s .y , peakidx , name = get_default_test_name ("00" ))
29- )
30-
31- noiseparam = NormalDistribution1DParam .create (sigma = 5.0 )
32- sig = create_noisy_signal (noiseparam )
33- x , y = sig .x , sig .y
34-
35- # Polynomial curve fitting test
36- execenv .print (fdlg .polynomialfit (x , y , 4 ))
37-
38- # Linear curve fitting test
39- execenv .print (fdlg .linearfit (x , y ))
40-
41- # Gaussian curve fitting test
42- execenv .print (fdlg .gaussianfit (x , y ))
43-
44- # Lorentzian curve fitting test
45- execenv .print (fdlg .lorentzianfit (x , y ))
46-
47- # Multi-Lorentzian curve fitting test (needs peaks)
48- execenv .print (fdlg .multigaussianfit (x , y , peakidx ))
49-
50- # Multi-Lorentzian curve fitting test (needs peaks)
51- execenv .print (fdlg .multilorentzianfit (x , y , peakidx ))
52-
53- # Voigt curve fitting test
54- execenv .print (fdlg .voigtfit (x , y ))
55-
56- # Exponential curve fitting test
57- execenv .print (fdlg .exponentialfit (x , y ))
58-
59- # Sinusoidal curve fitting test
60- execenv .print (fdlg .sinusoidalfit (x , y ))
61-
62- # CDF curve fitting test
63- execenv .print (fdlg .cdffit (x , y ))
64-
65- # Planckian curve fitting test
66- execenv .print (fdlg .planckianfit (x , y ))
67-
68- # Two half-Gaussian curve fitting test
69- execenv .print (fdlg .twohalfgaussianfit (x , y ))
70-
71- # Double exponential curve fitting test
72- execenv .print (fdlg .doubleexponentialfit (x , y ))
25+ s1 = get_test_signal ("paracetamol.txt" )
26+ peakidx = peak_indices (s1 .y )
27+ s2 = create_noisy_signal (NormalDistribution1DParam .create (sigma = 5.0 ))
28+
29+ ep = execenv .print
30+ tn = get_default_test_name
31+
32+ ep (fdlg .polynomialfit (s2 .x , s2 .y , 4 , name = tn ("00" )))
33+ ep (fdlg .linearfit (s2 .x , s2 .y , name = tn ("01" )))
34+ ep (fdlg .gaussianfit (s2 .x , s2 .y , name = tn ("02" )))
35+ ep (fdlg .lorentzianfit (s2 .x , s2 .y , name = tn ("03" )))
36+ ep (fdlg .multigaussianfit (s1 .x , s1 .y , peakidx , name = tn ("04" )))
37+ ep (fdlg .multilorentzianfit (s1 .x , s1 .y , peakidx , name = tn ("05" )))
38+ ep (fdlg .voigtfit (s2 .x , s2 .y , name = tn ("06" )))
39+ ep (fdlg .exponentialfit (s2 .x , s2 .y , name = tn ("07" )))
40+ ep (fdlg .sinusoidalfit (s2 .x , s2 .y , name = tn ("08" )))
41+ ep (fdlg .cdffit (s2 .x , s2 .y , name = tn ("09" )))
42+ ep (fdlg .planckianfit (s2 .x , s2 .y , name = tn ("10" )))
43+ ep (fdlg .twohalfgaussianfit (s2 .x , s2 .y , name = tn ("11" )))
44+ ep (fdlg .doubleexponentialfit (s2 .x , s2 .y , name = tn ("12" )))
7345
7446
7547if __name__ == "__main__" :
0 commit comments