petal-qc 0.0.0__py3-none-any.whl
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.
Potentially problematic release.
This version of petal-qc might be problematic. Click here for more details.
- petal_qc/BTreport/CheckBTtests.py +321 -0
- petal_qc/BTreport/__init__.py +0 -0
- petal_qc/BTreport/bustapeReport.py +144 -0
- petal_qc/__init__.py +14 -0
- petal_qc/metrology/Cluster.py +90 -0
- petal_qc/metrology/DataFile.py +47 -0
- petal_qc/metrology/PetalMetrology.py +327 -0
- petal_qc/metrology/__init__.py +0 -0
- petal_qc/metrology/all2csv.py +57 -0
- petal_qc/metrology/analyze_locking_points.py +597 -0
- petal_qc/metrology/cold_noise.py +106 -0
- petal_qc/metrology/comparisonTable.py +59 -0
- petal_qc/metrology/convert_mitutoyo.py +175 -0
- petal_qc/metrology/convert_smartscope.py +145 -0
- petal_qc/metrology/coreMetrology.py +402 -0
- petal_qc/metrology/data2csv.py +63 -0
- petal_qc/metrology/do_Metrology.py +117 -0
- petal_qc/metrology/flatness4nigel.py +157 -0
- petal_qc/metrology/gtkutils.py +120 -0
- petal_qc/metrology/petal_flatness.py +353 -0
- petal_qc/metrology/show_data_file.py +118 -0
- petal_qc/metrology/testSummary.py +37 -0
- petal_qc/metrology/test_paralelism.py +71 -0
- petal_qc/thermal/CSVImage.py +69 -0
- petal_qc/thermal/DebugPlot.py +76 -0
- petal_qc/thermal/IRBFile.py +768 -0
- petal_qc/thermal/IRCore.py +110 -0
- petal_qc/thermal/IRDataGetter.py +359 -0
- petal_qc/thermal/IRPetal.py +1338 -0
- petal_qc/thermal/IRPetalParam.py +71 -0
- petal_qc/thermal/PetalColorMaps.py +62 -0
- petal_qc/thermal/Petal_IR_Analysis.py +142 -0
- petal_qc/thermal/PipeFit.py +598 -0
- petal_qc/thermal/__init__.py +0 -0
- petal_qc/thermal/analyze_IRCore.py +417 -0
- petal_qc/thermal/contours.py +378 -0
- petal_qc/thermal/create_IRCore.py +185 -0
- petal_qc/thermal/pipe_read.py +182 -0
- petal_qc/thermal/show_IR_petal.py +420 -0
- petal_qc/utils/Geometry.py +756 -0
- petal_qc/utils/Progress.py +182 -0
- petal_qc/utils/__init__.py +0 -0
- petal_qc/utils/all_files.py +35 -0
- petal_qc/utils/docx_utils.py +186 -0
- petal_qc/utils/fit_utils.py +188 -0
- petal_qc/utils/utils.py +180 -0
- petal_qc-0.0.0.dist-info/METADATA +29 -0
- petal_qc-0.0.0.dist-info/RECORD +51 -0
- petal_qc-0.0.0.dist-info/WHEEL +5 -0
- petal_qc-0.0.0.dist-info/entry_points.txt +3 -0
- petal_qc-0.0.0.dist-info/top_level.txt +1 -0
petal_qc/utils/utils.py
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""A set of utilities."""
|
|
3
|
+
import fnmatch
|
|
4
|
+
import os
|
|
5
|
+
import re
|
|
6
|
+
from collections.abc import Iterable
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
import numpy as np
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def is_iterable(obj):
|
|
12
|
+
"""Tell if an object is iterable. Strings are not considered iterables."""
|
|
13
|
+
if isinstance(obj, Iterable):
|
|
14
|
+
if isinstance(obj, str) or isinstance(obj, bytes):
|
|
15
|
+
return False
|
|
16
|
+
else:
|
|
17
|
+
return True
|
|
18
|
+
else:
|
|
19
|
+
return False
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def all_files(root, patterns='*', single_level=False, yield_folders=False):
|
|
23
|
+
"""A generator that reruns all files in the given folder.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
----
|
|
27
|
+
root (file path): The folder
|
|
28
|
+
patterns (str, optional): The pattern of the files. Defaults to '*'.
|
|
29
|
+
single_level (bool, optional): If true, do not go into sub folders. Defaults to False.
|
|
30
|
+
yield_folders (bool, optional): If True, return folders as well. Defaults to False.
|
|
31
|
+
|
|
32
|
+
Yields
|
|
33
|
+
------
|
|
34
|
+
A file Path
|
|
35
|
+
|
|
36
|
+
"""
|
|
37
|
+
patterns = patterns.split(';')
|
|
38
|
+
for path, subdirs, files in os.walk(root):
|
|
39
|
+
if yield_folders:
|
|
40
|
+
files.extend(subdirs)
|
|
41
|
+
|
|
42
|
+
files.sort()
|
|
43
|
+
for name in files:
|
|
44
|
+
for pattern in patterns:
|
|
45
|
+
if fnmatch.fnmatch(name, pattern):
|
|
46
|
+
yield os.path.join(path, name)
|
|
47
|
+
break
|
|
48
|
+
|
|
49
|
+
if single_level:
|
|
50
|
+
break
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def find_out_file_name(fnam):
|
|
54
|
+
"""Get file name.
|
|
55
|
+
|
|
56
|
+
Check wheter file already exists and build a name with
|
|
57
|
+
a sequence number.
|
|
58
|
+
|
|
59
|
+
Args:
|
|
60
|
+
----
|
|
61
|
+
fnam: Input file name.
|
|
62
|
+
|
|
63
|
+
Returns
|
|
64
|
+
-------
|
|
65
|
+
new file name with sequence.
|
|
66
|
+
|
|
67
|
+
"""
|
|
68
|
+
R = re.compile(r'.*\(([0-9]*)\)')
|
|
69
|
+
pout = Path(fnam).expanduser().absolute()
|
|
70
|
+
odir = pout.parent
|
|
71
|
+
orig_stem = pout.stem
|
|
72
|
+
lstem = len(orig_stem)
|
|
73
|
+
|
|
74
|
+
while pout.exists():
|
|
75
|
+
version = 1
|
|
76
|
+
stem = pout.stem[lstem:]
|
|
77
|
+
M = R.match(stem)
|
|
78
|
+
if M:
|
|
79
|
+
version = int(M.group(1))
|
|
80
|
+
version += 1
|
|
81
|
+
|
|
82
|
+
fout = "{} ({}){}".format(orig_stem, version, pout.suffix)
|
|
83
|
+
pout = Path(odir, fout)
|
|
84
|
+
|
|
85
|
+
return pout
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def output_folder(folder, fname):
|
|
89
|
+
"""Rename file to be "stored" in folder.
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
----
|
|
93
|
+
folder: The folder path
|
|
94
|
+
fname: The file path
|
|
95
|
+
|
|
96
|
+
Returns
|
|
97
|
+
-------
|
|
98
|
+
Path: The new file path
|
|
99
|
+
|
|
100
|
+
"""
|
|
101
|
+
if folder is None:
|
|
102
|
+
return fname
|
|
103
|
+
|
|
104
|
+
ifolder = Path(folder).expanduser().resolve()
|
|
105
|
+
if not ifolder.exists():
|
|
106
|
+
print("Creating folder {}".format(ifolder))
|
|
107
|
+
os.makedirs(ifolder)
|
|
108
|
+
|
|
109
|
+
# Append folder to output file name
|
|
110
|
+
of = Path(fname).expanduser().resolve()
|
|
111
|
+
ofile = ifolder / of.name
|
|
112
|
+
|
|
113
|
+
return ofile
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def find_file(folder, fname):
|
|
117
|
+
"""Find file and fallback to folder if not found.
|
|
118
|
+
|
|
119
|
+
Note: it just builds teh file name if the input file
|
|
120
|
+
does not exist. Does not check for esistance of file
|
|
121
|
+
within folder.
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
----
|
|
125
|
+
folder: The folder
|
|
126
|
+
fname: The file name
|
|
127
|
+
|
|
128
|
+
Returns
|
|
129
|
+
-------
|
|
130
|
+
Path: the new file path.
|
|
131
|
+
|
|
132
|
+
"""
|
|
133
|
+
ifile = Path(fname).expanduser().resolve()
|
|
134
|
+
if folder is None:
|
|
135
|
+
return ifile
|
|
136
|
+
|
|
137
|
+
if ifile.exists():
|
|
138
|
+
return ifile
|
|
139
|
+
|
|
140
|
+
else:
|
|
141
|
+
ifolder = Path(folder).expanduser().resolve()
|
|
142
|
+
ofile = ifolder / ifile.name
|
|
143
|
+
return ofile
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def get_min_max(values, step=None):
|
|
147
|
+
"""Return min and max.
|
|
148
|
+
|
|
149
|
+
The values are alined with step.
|
|
150
|
+
|
|
151
|
+
Args:
|
|
152
|
+
----
|
|
153
|
+
values: Array of values
|
|
154
|
+
step (optional): The step. Defaults to 1.0.
|
|
155
|
+
|
|
156
|
+
Returns
|
|
157
|
+
-------
|
|
158
|
+
min, max.
|
|
159
|
+
|
|
160
|
+
"""
|
|
161
|
+
vmax = np.amax(values)
|
|
162
|
+
vmin = np.amin(values)
|
|
163
|
+
|
|
164
|
+
if step is not None:
|
|
165
|
+
ivmax = round(vmax)
|
|
166
|
+
if ivmax < vmax:
|
|
167
|
+
ivmax += step
|
|
168
|
+
if abs(ivmax-vmax) < 0.25*step:
|
|
169
|
+
ivmax += step
|
|
170
|
+
|
|
171
|
+
ivmin = np.round(vmin)
|
|
172
|
+
if ivmin > vmin:
|
|
173
|
+
ivmin -= step
|
|
174
|
+
if abs(ivmin-vmin) < 0.25*step:
|
|
175
|
+
ivmin -= step
|
|
176
|
+
|
|
177
|
+
return ivmin, ivmax, abs(ivmax-ivmin)
|
|
178
|
+
|
|
179
|
+
else:
|
|
180
|
+
return vmin, vmax, abs(vmax-vmin)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: petal_qc
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: A collection of scripts for Petal CORE QC.
|
|
5
|
+
Author-email: Carlos Lacasta <carlos.lacasta@cern.ch>
|
|
6
|
+
Project-URL: Homepage, https://gitlab.cern.ch/atlas-itk/sw/db/itk-pdb-gtk-gui-utils
|
|
7
|
+
Project-URL: Bug Tracker, https://gitlab.cern.ch/atlas-itk/sw/db/itk-pdb-gtk-gui-utils/-/issues
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.7
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: itkdb
|
|
13
|
+
Requires-Dist: itkdb-gtk
|
|
14
|
+
Requires-Dist: numpy
|
|
15
|
+
Requires-Dist: matplotlib
|
|
16
|
+
Requires-Dist: lmfit
|
|
17
|
+
Requires-Dist: openpyxl
|
|
18
|
+
Requires-Dist: pandas
|
|
19
|
+
Requires-Dist: python-dateutil
|
|
20
|
+
Requires-Dist: python-docx
|
|
21
|
+
Requires-Dist: scipy
|
|
22
|
+
Requires-Dist: scikit-image
|
|
23
|
+
|
|
24
|
+
# Petal QC
|
|
25
|
+
|
|
26
|
+
The folder contains a collections of scripts to make the analysis of the Petal
|
|
27
|
+
QC metrology and thermal tests.
|
|
28
|
+
|
|
29
|
+
They will also upload the tests to the DB if required.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
petal_qc/__init__.py,sha256=jVzpfX2cxFKJtyeuUIhf3o6dornHFtUkoUUjFRN9H08,337
|
|
2
|
+
petal_qc/BTreport/CheckBTtests.py,sha256=WGENYpswLxs-BLQxXRxJC-6i-tdRZkIhNzhYtItfVBY,8845
|
|
3
|
+
petal_qc/BTreport/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
petal_qc/BTreport/bustapeReport.py,sha256=Db4WhOhvqku-YatNwxrIwZ4g7l7hVfMth2hAV3JRZ6A,4151
|
|
5
|
+
petal_qc/metrology/Cluster.py,sha256=UtZ5q1EFb8f3qC0hEYBbhRg2pPbW_28aJX2EEMu00Ho,2105
|
|
6
|
+
petal_qc/metrology/DataFile.py,sha256=PbFqy3-WSj69epV5EjhHc1GKhA8I74FmJYOXUjN0V20,1367
|
|
7
|
+
petal_qc/metrology/PetalMetrology.py,sha256=H4MwuQ2QxP_Td9KtMly_-osXT1owigzC7QlmRub7oRo,11886
|
|
8
|
+
petal_qc/metrology/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
petal_qc/metrology/all2csv.py,sha256=KTgEGaediylwkGN7gyWyQqUjU0f9FOa3xF4z1W38EcU,1569
|
|
10
|
+
petal_qc/metrology/analyze_locking_points.py,sha256=AD5DRlZDpgzZS8sUwuUnzwws4BtJZrNtsJ-IWG6xvcQ,20539
|
|
11
|
+
petal_qc/metrology/cold_noise.py,sha256=PuTaQ73WrQCJdE9ezS4UFmA3atwCuvM0ZsUOYu1ZIBw,3106
|
|
12
|
+
petal_qc/metrology/comparisonTable.py,sha256=6Zmh-x0ahs28ZJQuHMrIiRcblUmTN1_-1otFSRNMPds,1743
|
|
13
|
+
petal_qc/metrology/convert_mitutoyo.py,sha256=HdXQzFL5y7r8qXDzti91VItDQ-y6D9rEAYknn4yHwBs,5449
|
|
14
|
+
petal_qc/metrology/convert_smartscope.py,sha256=es3PoUd5d5rpHebgwsS9nrc3uuy9uFKOQ00ZdU5XHQ0,3836
|
|
15
|
+
petal_qc/metrology/coreMetrology.py,sha256=yDgChOmOZ7lKd6c_Je0pFLS0ahszYZoBBgyJ57Nbj3E,13256
|
|
16
|
+
petal_qc/metrology/data2csv.py,sha256=2ttMSmfGLPIaOqZGima2dH6sdnSRAFTHlEbSOfW5ebA,1809
|
|
17
|
+
petal_qc/metrology/do_Metrology.py,sha256=4tbZJfJYXY8QVLiG5_2pThNPzyuqbC3s8xhFdQfC1TU,3977
|
|
18
|
+
petal_qc/metrology/flatness4nigel.py,sha256=SUHwn6pCEUWQV_62-_9-VKrmUdL4gVQcSA3aTtYq958,4071
|
|
19
|
+
petal_qc/metrology/gtkutils.py,sha256=1pOTxiE2EZR9zNNNT5cOetga_4NG9DzLaqQPI4c1EzE,3372
|
|
20
|
+
petal_qc/metrology/petal_flatness.py,sha256=MH3ZlSildLokYnjERQG28qqLg3LL8C6rFLT8VbEI_BA,11190
|
|
21
|
+
petal_qc/metrology/show_data_file.py,sha256=yZPcmMy-1EWWySiBBx0hNB3tPVh19bTr0PDaXSyIF4c,4057
|
|
22
|
+
petal_qc/metrology/testSummary.py,sha256=0BhcEd1BPz2Mbonzi8nyZOzNSzpUqowBFNl5cVutqsk,994
|
|
23
|
+
petal_qc/metrology/test_paralelism.py,sha256=_j__OdUwdXWM494_9HpGPuPHixMwwVphCcvHEfzWi_k,1981
|
|
24
|
+
petal_qc/thermal/CSVImage.py,sha256=Vt2kYmUsZWkQvxcF8fDda3HO1Rb29kPQHnEoHFCqWYo,2038
|
|
25
|
+
petal_qc/thermal/DebugPlot.py,sha256=OmREFwNDAKgoObDmcgHrB4d8m3bf2znfsKVGsb5rBGQ,2119
|
|
26
|
+
petal_qc/thermal/IRBFile.py,sha256=zj82SdI-MDfZq1i0n47PuZMLLx_0oKpE-ZaykJZs6BU,22225
|
|
27
|
+
petal_qc/thermal/IRCore.py,sha256=Iasus1wy1pDQvBMPhcPYN1gFHZGv7tO5KJlpJZGuck4,3029
|
|
28
|
+
petal_qc/thermal/IRDataGetter.py,sha256=dX_FjeGc7qxinJ1JPC_4rSLSJlYtkKuAL31LURfv2a8,9662
|
|
29
|
+
petal_qc/thermal/IRPetal.py,sha256=X6I7JmyWf_9mPHjTsuBztM-1b5wre2NW4VM-6dz4Gow,38208
|
|
30
|
+
petal_qc/thermal/IRPetalParam.py,sha256=BcS302s4kyAuGm_F9zIlKVsPJkftSG71GGMzAl5eZMo,3366
|
|
31
|
+
petal_qc/thermal/PetalColorMaps.py,sha256=6CvJHzRdojLHu3BROYSekHw8g_BJ1lJ_edyhovTIydU,3831
|
|
32
|
+
petal_qc/thermal/Petal_IR_Analysis.py,sha256=8Deh_bJ5B7DdaUV18saboF7fXZ_8Bt1vkUlsk5RqVeo,3910
|
|
33
|
+
petal_qc/thermal/PipeFit.py,sha256=qbNvi547U9EttfRxCaIrizK69Hw3mJOKuG4SGRQaHRk,17191
|
|
34
|
+
petal_qc/thermal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
|
+
petal_qc/thermal/analyze_IRCore.py,sha256=v9cf5GAP_yfL829WK5Qyv1fOl5LdIsLfZEVPQQXiQ1A,13740
|
|
36
|
+
petal_qc/thermal/contours.py,sha256=ampCKm4byZYKb_4eJFjIkdFIl2bqVXD2mV13d2XUWlw,8244
|
|
37
|
+
petal_qc/thermal/create_IRCore.py,sha256=S4M7OQYHcuh7lX3XmDHWOnIhT_1EIr-XdbsRgMGOOEQ,5678
|
|
38
|
+
petal_qc/thermal/pipe_read.py,sha256=HrAtEbf8pMhJDETzkevodiTbuprIOh4yHv6PzpRoz7Q,5040
|
|
39
|
+
petal_qc/thermal/show_IR_petal.py,sha256=PGAq7qiWmchYx4tGPgWJxeHi2N-pM_C1a4tmXYe0htY,13029
|
|
40
|
+
petal_qc/utils/Geometry.py,sha256=XwA_aojk880N-jC1_bnMYFK0bcD-L96JPS81NUerJf0,19765
|
|
41
|
+
petal_qc/utils/Progress.py,sha256=gCti4n2xfCcOTlAff5GchabGE5BCwavvDZYYKdbEsXU,4064
|
|
42
|
+
petal_qc/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
|
+
petal_qc/utils/all_files.py,sha256=4ja_DkbTYPY3gUPBAZq0p7KB9lnXZx-OCnpTHg9tm4I,1044
|
|
44
|
+
petal_qc/utils/docx_utils.py,sha256=Eye16PF8W0mPBVdQvgFKWxPYV7-hzBgANPDZtUEjzf8,5805
|
|
45
|
+
petal_qc/utils/fit_utils.py,sha256=3KUGWpBMV-bVDkQHWBigXot8chOpjAVBJ5H5b5dbdjk,5349
|
|
46
|
+
petal_qc/utils/utils.py,sha256=CqCsNIcEg6FQb3DN70tmqeLVLlQqsRfDzhfGevlnfBc,4035
|
|
47
|
+
petal_qc-0.0.0.dist-info/METADATA,sha256=rg1E5POenrFwIY540PaK6cYolr9epkR7V3OPUO7HDWo,943
|
|
48
|
+
petal_qc-0.0.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
49
|
+
petal_qc-0.0.0.dist-info/entry_points.txt,sha256=ZsBmzA1gRvZSe4ZKcxlo0b-RBjySccqBhL6g_CJhNaM,92
|
|
50
|
+
petal_qc-0.0.0.dist-info/top_level.txt,sha256=CCo1Xe6kLS79PruhsB6bk2CuL9VFtNdNpgJjYUs4jk4,9
|
|
51
|
+
petal_qc-0.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
petal_qc
|