petal-qc 0.0.9__py3-none-any.whl → 0.0.10__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/__init__.py +6 -1
- petal_qc/metrology/compare_Cores.py +27 -15
- petal_qc/metrology/coreMetrology.py +1 -1
- petal_qc/metrology/readAVSdata.py +695 -0
- petal_qc/metrology/uploadPetalInformation.py +758 -0
- petal_qc/test/getAVSjson.py +27 -0
- petal_qc/test/getAVStests.py +154 -0
- petal_qc/test/getPetalCoreTestSummary.py +89 -0
- petal_qc/test/prepareDESYfiles.py +25 -8
- petal_qc/thermal/IRCore.py +1 -1
- petal_qc/thermal/IRDataGetter.py +8 -8
- petal_qc/thermal/IRPetal.py +78 -7
- petal_qc/thermal/Petal_IR_Analysis.py +4 -3
- petal_qc/thermal/PipeFit.py +4 -3
- petal_qc/thermal/analyze_IRCore.py +12 -9
- petal_qc/thermal/coreThermal.py +9 -3
- petal_qc/thermal/create_IRCore.py +25 -5
- petal_qc/thermal/create_core_report.py +13 -4
- petal_qc/utils/Geometry.py +2 -2
- {petal_qc-0.0.9.dist-info → petal_qc-0.0.10.dist-info}/METADATA +1 -1
- {petal_qc-0.0.9.dist-info → petal_qc-0.0.10.dist-info}/RECORD +24 -19
- {petal_qc-0.0.9.dist-info → petal_qc-0.0.10.dist-info}/WHEEL +1 -1
- {petal_qc-0.0.9.dist-info → petal_qc-0.0.10.dist-info}/entry_points.txt +1 -0
- {petal_qc-0.0.9.dist-info → petal_qc-0.0.10.dist-info}/top_level.txt +0 -0
petal_qc/__init__.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""petal_qc python module."""
|
|
2
|
-
__version__ = "0.0.
|
|
2
|
+
__version__ = "0.0.10"
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
def coreMetrology():
|
|
@@ -23,6 +23,11 @@ def bustapeReport():
|
|
|
23
23
|
# from .BTreport.bustapeReport import main
|
|
24
24
|
main()
|
|
25
25
|
|
|
26
|
+
def uploadPetalInformation():
|
|
27
|
+
"""Read files from AVS nd create Petal core in PDB."""
|
|
28
|
+
from .metrology.uploadPetalInformation import main
|
|
29
|
+
main()
|
|
30
|
+
|
|
26
31
|
def dashBoard():
|
|
27
32
|
"""Launches the Core thermal analysis ahd PDB script."""
|
|
28
33
|
from .dashBoard import main
|
|
@@ -77,17 +77,21 @@ def read_data_files(options):
|
|
|
77
77
|
if not label in labels:
|
|
78
78
|
labels.append(label)
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
front[
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
try:
|
|
81
|
+
val = get_value(data, options.value)
|
|
82
|
+
if "front" in tmp[1].lower():
|
|
83
|
+
front[label] = val
|
|
84
|
+
else:
|
|
85
|
+
back[label] = val
|
|
86
|
+
except KeyError as E:
|
|
87
|
+
print("Error in {}:\n{}".format(fnam, E))
|
|
88
|
+
continue
|
|
85
89
|
|
|
86
90
|
labels.sort()
|
|
87
91
|
|
|
88
92
|
return front, back, labels
|
|
89
93
|
|
|
90
|
-
def draw_deltas(data, keys, fnam=None, title="Front"):
|
|
94
|
+
def draw_deltas(data, keys, fnam=None, title="Front", draw_text=True):
|
|
91
95
|
"""Plot the position deltas."""
|
|
92
96
|
key_table = {"Bot.": "PL01", "Slot": "PL02", "Top": "PL03",
|
|
93
97
|
"Bot-FD01": "PL01-FD01", "Bot-FD02": "PL01-FD02", "FD01-FD02": "FD01-FD02" }
|
|
@@ -123,8 +127,9 @@ def draw_deltas(data, keys, fnam=None, title="Front"):
|
|
|
123
127
|
LBL[k].append(label.split('.')[1].lstrip('0'))
|
|
124
128
|
|
|
125
129
|
ax[i].scatter(P[i][:,0], P[i][:,1])
|
|
126
|
-
|
|
127
|
-
|
|
130
|
+
if draw_text:
|
|
131
|
+
for j in range(len(LBL[i])):
|
|
132
|
+
ax[i].text(P[i][j,0], P[i][j,1], LBL[i][j]) #, ha='center', va='top')
|
|
128
133
|
|
|
129
134
|
save_figure(fig, fnam, prefix=title)
|
|
130
135
|
|
|
@@ -142,10 +147,12 @@ def show_positions(options):
|
|
|
142
147
|
|
|
143
148
|
front, back, labels = read_data_files(options)
|
|
144
149
|
val_name = options.value.split('/')[-1]
|
|
145
|
-
|
|
146
|
-
draw_deltas(
|
|
150
|
+
draw_text = not options.no_legend
|
|
151
|
+
draw_deltas(front, keys, fnam=options.out, title="{} - Front".format(val_name), draw_text=draw_text)
|
|
152
|
+
draw_deltas(back, keys, fnam=options.out, title="{} - Back".format(val_name), draw_text=draw_text)
|
|
147
153
|
|
|
148
|
-
|
|
154
|
+
if not options.no_show:
|
|
155
|
+
plt.show()
|
|
149
156
|
|
|
150
157
|
def show_flatness(options):
|
|
151
158
|
"""Show flatness plots."""
|
|
@@ -177,9 +184,10 @@ def show_flatness(options):
|
|
|
177
184
|
a.set_ylim(0, 1.2*max(y_lim[0][1], y_lim[1][1]))
|
|
178
185
|
x_lim = a.get_xlim()
|
|
179
186
|
a.fill_between(x_lim, 0, 0.050, facecolor="darkseagreen", alpha=0.1)
|
|
180
|
-
|
|
187
|
+
if not options.no_legend:
|
|
188
|
+
a.legend(ncol=3, fontsize="x-small")
|
|
181
189
|
|
|
182
|
-
save_figure(fig, options.out, prefix=
|
|
190
|
+
save_figure(fig, options.out, prefix=options.prefix)
|
|
183
191
|
|
|
184
192
|
def main(options):
|
|
185
193
|
"""Main entry."""
|
|
@@ -204,11 +212,13 @@ def main(options):
|
|
|
204
212
|
vback = [back[x] for x in labels]
|
|
205
213
|
ax.plot(X, vfront, '*', label="Front")
|
|
206
214
|
ax.plot(X, vback, 'o', label="Back")
|
|
207
|
-
|
|
215
|
+
if not options.no_legend:
|
|
216
|
+
ax.legend()
|
|
208
217
|
|
|
209
218
|
save_figure(fig, options.out, prefix=options.prefix)
|
|
210
219
|
|
|
211
|
-
|
|
220
|
+
if not options.no_show:
|
|
221
|
+
plt.show()
|
|
212
222
|
|
|
213
223
|
|
|
214
224
|
if __name__ == "__main__":
|
|
@@ -218,6 +228,8 @@ if __name__ == "__main__":
|
|
|
218
228
|
parser.add_argument("--value", default=None, help="Value to plot")
|
|
219
229
|
parser.add_argument("--prefix", default=None, help="prefix for out file")
|
|
220
230
|
parser.add_argument("--out", default=None, help="File to store the figure.")
|
|
231
|
+
parser.add_argument("--no-legend", dest="no_legend", default=False, action="store_true", help="Do not draw the legend")
|
|
232
|
+
parser.add_argument("--no-show", dest="no_show", default=False, action="store_true", help="Do not show the figure")
|
|
221
233
|
|
|
222
234
|
opts = parser.parse_args()
|
|
223
235
|
if len(opts.files) == 0:
|
|
@@ -16,7 +16,7 @@ import gi
|
|
|
16
16
|
gi.require_version("Gtk", "3.0")
|
|
17
17
|
from gi.repository import Gtk, GObject, Gio, GLib
|
|
18
18
|
|
|
19
|
-
__HELP__ = "https://petal-qc.docs.cern.ch"
|
|
19
|
+
__HELP__ = "https://petal-qc.docs.cern.ch/metrology.html"
|
|
20
20
|
|
|
21
21
|
class CommaSeparatedListAction(Action):
|
|
22
22
|
"""Create a list from the comma sepparated numbers at imput."""
|