LabTools3 1.1.3.18__tar.gz → 1.1.3.20__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.
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LT/box.py +2 -1
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LT/datafile.py +45 -7
- {labtools3-1.1.3.18 → labtools3-1.1.3.20/LabTools3.egg-info}/PKG-INFO +17 -2
- {labtools3-1.1.3.18/LabTools3.egg-info → labtools3-1.1.3.20}/PKG-INFO +17 -2
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/README.md +5 -1
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/setup.py +1 -1
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LICENSE +0 -0
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LT/MCA.py +0 -0
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LT/__init__.py +0 -0
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LT/get_precision.py +0 -0
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LT/parameterfile.py +0 -0
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LT/pdatafile.py +0 -0
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LT/plotting.py +0 -0
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LT_Fit/__init__.py +0 -0
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LT_Fit/gen_fit.py +0 -0
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LT_Fit/linear_fit.py +0 -0
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LT_Fit/parameters.py +0 -0
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LabTools3.egg-info/SOURCES.txt +0 -0
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LabTools3.egg-info/dependency_links.txt +0 -0
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/LabTools3.egg-info/top_level.txt +0 -0
- {labtools3-1.1.3.18 → labtools3-1.1.3.20}/setup.cfg +0 -0
|
@@ -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:
|
|
@@ -928,6 +928,7 @@ class histo:
|
|
|
928
928
|
============ =====================================================
|
|
929
929
|
xmin lower fit limit
|
|
930
930
|
xmax upper fit limit
|
|
931
|
+
============ =====================================================
|
|
931
932
|
|
|
932
933
|
"""
|
|
933
934
|
# is there a range given, or is a window set
|
|
@@ -88,7 +88,7 @@ except:
|
|
|
88
88
|
numpy_ok = False
|
|
89
89
|
|
|
90
90
|
# function to create a dictionary from 2 lists: key, values
|
|
91
|
-
format_dict = {'i':'{:d}', 'f':'{:f}', 's':'{:s}'}
|
|
91
|
+
format_dict = {'i':'{:d}', 'f':'{:f}', 's':'{:s}', 'g':'{:.12g}'}
|
|
92
92
|
# create a dictionary from an array of keys and values
|
|
93
93
|
#----------------------------------------------------------------------
|
|
94
94
|
def find_duplicates(array):
|
|
@@ -466,6 +466,27 @@ class dfile:
|
|
|
466
466
|
"""
|
|
467
467
|
return self.adata[:self.headindex+1]
|
|
468
468
|
|
|
469
|
+
def show_header(self, show_all = True):
|
|
470
|
+
"""
|
|
471
|
+
Show the header information of the data file
|
|
472
|
+
|
|
473
|
+
Parameters
|
|
474
|
+
----------
|
|
475
|
+
show_all : Bool, optional
|
|
476
|
+
Show all comments in the header otherwise only the headerline. The default is True.
|
|
477
|
+
|
|
478
|
+
Returns
|
|
479
|
+
-------
|
|
480
|
+
None.
|
|
481
|
+
|
|
482
|
+
"""
|
|
483
|
+
if show_all:
|
|
484
|
+
for ll in self.get_full_header():
|
|
485
|
+
print(ll)
|
|
486
|
+
else:
|
|
487
|
+
print(self.get_header())
|
|
488
|
+
|
|
489
|
+
|
|
469
490
|
def show_data(self,keylist):
|
|
470
491
|
"""
|
|
471
492
|
|
|
@@ -917,9 +938,16 @@ class dfile:
|
|
|
917
938
|
fmt += format_dict[self.formats[k]] + ', '
|
|
918
939
|
return fmt.strip()[:-1]
|
|
919
940
|
|
|
920
|
-
def make_csv(self):
|
|
941
|
+
def make_csv(self, full_prec = False):
|
|
921
942
|
keys = self.keys[:-1]
|
|
922
943
|
csv = [ ''.join([k + ',' for k in keys]) ]
|
|
944
|
+
if full_prec:
|
|
945
|
+
for fk in self.formats.keys():
|
|
946
|
+
fmt = self.formats[fk]
|
|
947
|
+
if (fmt == 'i') or (fmt == 's'):
|
|
948
|
+
pass
|
|
949
|
+
else:
|
|
950
|
+
self.formats[fk] = 'g' # set the general float format key
|
|
923
951
|
for l in self.data:
|
|
924
952
|
fmt = self.make_fmt()
|
|
925
953
|
data = [l[k] for k in keys]
|
|
@@ -927,16 +955,26 @@ class dfile:
|
|
|
927
955
|
csv.append(ll)
|
|
928
956
|
return csv
|
|
929
957
|
|
|
930
|
-
def write_csv(self, f):
|
|
958
|
+
def write_csv(self, f, full_precision = True):
|
|
931
959
|
"""
|
|
932
|
-
|
|
960
|
+
|
|
933
961
|
save the current file as a csv file
|
|
934
962
|
|
|
935
|
-
|
|
936
|
-
|
|
963
|
+
|
|
964
|
+
Parameters
|
|
965
|
+
----------
|
|
966
|
+
f : string
|
|
967
|
+
file name to be used.
|
|
968
|
+
full_precision : Bool, optional
|
|
969
|
+
use full precision g format for writing floats. The default is True.
|
|
970
|
+
|
|
971
|
+
Returns
|
|
972
|
+
-------
|
|
973
|
+
None.
|
|
974
|
+
|
|
937
975
|
"""
|
|
938
976
|
o = open(f,'w')
|
|
939
|
-
csv = self.make_csv()
|
|
977
|
+
csv = self.make_csv(full_prec = full_precision)
|
|
940
978
|
for l in csv:
|
|
941
979
|
o.write(l + '\n')
|
|
942
980
|
o.close()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: LabTools3
|
|
3
|
-
Version: 1.1.3.
|
|
3
|
+
Version: 1.1.3.20
|
|
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,17 @@ 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: license-file
|
|
23
|
+
Dynamic: requires-python
|
|
24
|
+
Dynamic: summary
|
|
14
25
|
|
|
15
26
|
# LabTools3
|
|
16
27
|
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
|
|
@@ -58,3 +69,7 @@ Version 1.1.3.16: Corrected bug in histo.rebin. gen_fit allows control of relati
|
|
|
58
69
|
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
70
|
|
|
60
71
|
Version 1.1.3.18: Added plot_guess function to histo. This makes it easy to plot fit functions with guessed parameters.
|
|
72
|
+
|
|
73
|
+
Version 1.1.3.19: Fixed but when using using the fill function in 1d histograms with weights multiple times.
|
|
74
|
+
|
|
75
|
+
Version 1.1.3.20: Added show_header to datafile and teh full_precision key word to write_csv.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: LabTools3
|
|
3
|
-
Version: 1.1.3.
|
|
3
|
+
Version: 1.1.3.20
|
|
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,17 @@ 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: license-file
|
|
23
|
+
Dynamic: requires-python
|
|
24
|
+
Dynamic: summary
|
|
14
25
|
|
|
15
26
|
# LabTools3
|
|
16
27
|
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
|
|
@@ -58,3 +69,7 @@ Version 1.1.3.16: Corrected bug in histo.rebin. gen_fit allows control of relati
|
|
|
58
69
|
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
70
|
|
|
60
71
|
Version 1.1.3.18: Added plot_guess function to histo. This makes it easy to plot fit functions with guessed parameters.
|
|
72
|
+
|
|
73
|
+
Version 1.1.3.19: Fixed but when using using the fill function in 1d histograms with weights multiple times.
|
|
74
|
+
|
|
75
|
+
Version 1.1.3.20: Added show_header to datafile and teh full_precision key word to write_csv.
|
|
@@ -43,4 +43,8 @@ Version 1.1.3.16: Corrected bug in histo.rebin. gen_fit allows control of relati
|
|
|
43
43
|
|
|
44
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
45
|
|
|
46
|
-
Version 1.1.3.18: Added plot_guess function to histo. This makes it easy to plot fit functions with guessed parameters.
|
|
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.
|
|
49
|
+
|
|
50
|
+
Version 1.1.3.20: Added show_header to datafile and teh full_precision key word to write_csv.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|