LabTools3 1.1.3.17__tar.gz → 1.1.3.18__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -915,7 +915,60 @@ class histo:
915
915
  print('Chi sq./DoF = ', self.F.chi2_red)
916
916
  print('----------------------------------------------------------------------')
917
917
  self.calc_fit_plot()
918
+
919
+
920
+ def plot_guess(self, xmin = None, xmax = None):
921
+ """
922
+ Plot the fit function with the guessed parameters
918
923
 
924
+ Keyword arguments are:
925
+
926
+ ============ =====================================================
927
+ Keyword Meaning
928
+ ============ =====================================================
929
+ xmin lower fit limit
930
+ xmax upper fit limit
931
+
932
+ """
933
+ # is there a range given, or is a window set
934
+ sel_all = np.ones_like(self.bin_center, dtype = 'bool')
935
+ if (xmin is None) and (xmax is None):
936
+ # check if a window is set
937
+ if self.window_set:
938
+ # if so use the set window limits
939
+ sel = (self.win_min <= self.bin_center) & (self.bin_center <= self.win_max)
940
+ self.fit_indx, = np.where ( sel )
941
+ else:
942
+ # if not use all data
943
+ self.fit_indx, = np.where(sel_all)
944
+ elif (xmin is None):
945
+ sel = (self.bin_center <= xmax)
946
+ if self.window_set:
947
+ # if so check which is smaller
948
+ sel_w = (self.bin_center <= self.win_max) & sel
949
+ self.fit_indx, = np.where(sel_w)
950
+ else:
951
+ self.fit_indx, = np.where(sel)
952
+ elif (xmax is None):
953
+ sel = (xmin <= self.bin_center)
954
+ if self.window_set:
955
+ # if so check which is larger
956
+ sel_w = (self.win_min <= self.bin_center) & sel
957
+ self.fit_indx, = np.where(sel_w)
958
+ else:
959
+ self.fit_indx, = np.where(sel)
960
+ else:
961
+ sel = (xmin <= self.bin_center) & ( self.bin_center <= xmax)
962
+ if self.window_set:
963
+ # if so check the set window limits
964
+ sel_w = (self.win_min <= self.bin_center) & ( self.bin_center <= self.win_max) & sel
965
+ # use the tighter limits
966
+ self.fit_indx, = np.where(sel_w)
967
+ else:
968
+ self.fit_indx, = np.where(sel)
969
+ self.calc_fit_plot()
970
+ self.plot_fit()
971
+
919
972
  def fit_view(self, init = True):
920
973
  """
921
974
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: LabTools3
3
- Version: 1.1.3.17
3
+ Version: 1.1.3.18
4
4
  Summary: Python 3 Package of modules for typical analysis tasks analyzing physics data
5
5
  Home-page: http://wanda.fiu.edu/LabTools3
6
6
  Author: Werner Boeglin
@@ -56,3 +56,5 @@ Version 1.1.3.15: contination lines enabled in parameter file by endine line wit
56
56
  Version 1.1.3.16: Corrected bug in histo.rebin. gen_fit allows control of relative step size using the diff_step keyword. It is also possible to supply a list of functions to calculate the parameter derivatives. This helps with numerical accuracy in the minimization process (see gen_fit documentation)
57
57
 
58
58
  Version 1.1.3.17: Histogram window settings are now also saved to data file. Replace equal sign with colon in histogram title in get_spectrum.
59
+
60
+ Version 1.1.3.18: Added plot_guess function to histo. This makes it easy to plot fit functions with guessed parameters.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: LabTools3
3
- Version: 1.1.3.17
3
+ Version: 1.1.3.18
4
4
  Summary: Python 3 Package of modules for typical analysis tasks analyzing physics data
5
5
  Home-page: http://wanda.fiu.edu/LabTools3
6
6
  Author: Werner Boeglin
@@ -56,3 +56,5 @@ Version 1.1.3.15: contination lines enabled in parameter file by endine line wit
56
56
  Version 1.1.3.16: Corrected bug in histo.rebin. gen_fit allows control of relative step size using the diff_step keyword. It is also possible to supply a list of functions to calculate the parameter derivatives. This helps with numerical accuracy in the minimization process (see gen_fit documentation)
57
57
 
58
58
  Version 1.1.3.17: Histogram window settings are now also saved to data file. Replace equal sign with colon in histogram title in get_spectrum.
59
+
60
+ Version 1.1.3.18: Added plot_guess function to histo. This makes it easy to plot fit functions with guessed parameters.
@@ -41,4 +41,6 @@ Version 1.1.3.15: contination lines enabled in parameter file by endine line wit
41
41
 
42
42
  Version 1.1.3.16: Corrected bug in histo.rebin. gen_fit allows control of relative step size using the diff_step keyword. It is also possible to supply a list of functions to calculate the parameter derivatives. This helps with numerical accuracy in the minimization process (see gen_fit documentation)
43
43
 
44
- Version 1.1.3.17: Histogram window settings are now also saved to data file. Replace equal sign with colon in histogram title in get_spectrum.
44
+ Version 1.1.3.17: Histogram window settings are now also saved to data file. Replace equal sign with colon in histogram title in get_spectrum.
45
+
46
+ Version 1.1.3.18: Added plot_guess function to histo. This makes it easy to plot fit functions with guessed parameters.
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setup(
7
7
  name = "LabTools3",
8
- version = "1.1.3.17",
8
+ version = "1.1.3.18",
9
9
  packages = find_packages(),
10
10
  # add additional files
11
11
  package_data = {'':['*.bat','*.command']},
File without changes
File without changes
File without changes