LabTools3 1.1.3.17__tar.gz → 1.1.3.19__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.
@@ -368,7 +368,7 @@ class histo:
368
368
  # histogram with weights squared
369
369
  kwargs1 = copy.copy(kwargs)
370
370
  kwargs1['weights'] = w2
371
- w2 = np.histogram(y, **kwargs1)[0] # save only the bin content
371
+ w2 = np.histogram(y, bins = self.res[1], **kwargs1)[0] # save only the bin content
372
372
  # add the new bin content to the old one
373
373
  self.res = (self.res[0] + res[0], self.res[1])
374
374
  if self.calc_w2 and self.has_weights:
@@ -915,7 +915,61 @@ 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
+ """
934
+ # is there a range given, or is a window set
935
+ sel_all = np.ones_like(self.bin_center, dtype = 'bool')
936
+ if (xmin is None) and (xmax is None):
937
+ # check if a window is set
938
+ if self.window_set:
939
+ # if so use the set window limits
940
+ sel = (self.win_min <= self.bin_center) & (self.bin_center <= self.win_max)
941
+ self.fit_indx, = np.where ( sel )
942
+ else:
943
+ # if not use all data
944
+ self.fit_indx, = np.where(sel_all)
945
+ elif (xmin is None):
946
+ sel = (self.bin_center <= xmax)
947
+ if self.window_set:
948
+ # if so check which is smaller
949
+ sel_w = (self.bin_center <= self.win_max) & sel
950
+ self.fit_indx, = np.where(sel_w)
951
+ else:
952
+ self.fit_indx, = np.where(sel)
953
+ elif (xmax is None):
954
+ sel = (xmin <= self.bin_center)
955
+ if self.window_set:
956
+ # if so check which is larger
957
+ sel_w = (self.win_min <= self.bin_center) & sel
958
+ self.fit_indx, = np.where(sel_w)
959
+ else:
960
+ self.fit_indx, = np.where(sel)
961
+ else:
962
+ sel = (xmin <= self.bin_center) & ( self.bin_center <= xmax)
963
+ if self.window_set:
964
+ # if so check the set window limits
965
+ sel_w = (self.win_min <= self.bin_center) & ( self.bin_center <= self.win_max) & sel
966
+ # use the tighter limits
967
+ self.fit_indx, = np.where(sel_w)
968
+ else:
969
+ self.fit_indx, = np.where(sel)
970
+ self.calc_fit_plot()
971
+ self.plot_fit()
972
+
919
973
  def fit_view(self, init = True):
920
974
  """
921
975
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: LabTools3
3
- Version: 1.1.3.17
3
+ Version: 1.1.3.19
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
@@ -11,6 +11,16 @@ Classifier: Programming Language :: Python :: 3.8
11
11
  Requires-Python: >=3.8
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
+ Dynamic: author
15
+ Dynamic: author-email
16
+ Dynamic: classifier
17
+ Dynamic: description
18
+ Dynamic: description-content-type
19
+ Dynamic: home-page
20
+ Dynamic: keywords
21
+ Dynamic: license
22
+ Dynamic: requires-python
23
+ Dynamic: summary
14
24
 
15
25
  # LabTools3
16
26
  Set of Python analysis tools for physics labs. It contains the "package" directory which is the Python package with a setup.py script for installation and
@@ -56,3 +66,7 @@ Version 1.1.3.15: contination lines enabled in parameter file by endine line wit
56
66
  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
67
 
58
68
  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.
69
+
70
+ Version 1.1.3.18: Added plot_guess function to histo. This makes it easy to plot fit functions with guessed parameters.
71
+
72
+ Version 1.1.3.19: Fixed but when using using the fill function in 1d histograms with weights multiple times.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: LabTools3
3
- Version: 1.1.3.17
3
+ Version: 1.1.3.19
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
@@ -11,6 +11,16 @@ Classifier: Programming Language :: Python :: 3.8
11
11
  Requires-Python: >=3.8
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
+ Dynamic: author
15
+ Dynamic: author-email
16
+ Dynamic: classifier
17
+ Dynamic: description
18
+ Dynamic: description-content-type
19
+ Dynamic: home-page
20
+ Dynamic: keywords
21
+ Dynamic: license
22
+ Dynamic: requires-python
23
+ Dynamic: summary
14
24
 
15
25
  # LabTools3
16
26
  Set of Python analysis tools for physics labs. It contains the "package" directory which is the Python package with a setup.py script for installation and
@@ -56,3 +66,7 @@ Version 1.1.3.15: contination lines enabled in parameter file by endine line wit
56
66
  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
67
 
58
68
  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.
69
+
70
+ Version 1.1.3.18: Added plot_guess function to histo. This makes it easy to plot fit functions with guessed parameters.
71
+
72
+ Version 1.1.3.19: Fixed but when using using the fill function in 1d histograms with weights multiple times.
@@ -41,4 +41,8 @@ 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.
47
+
48
+ Version 1.1.3.19: Fixed but when using using the fill function in 1d histograms with weights multiple times.
@@ -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.19",
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