AN_RB_PLI3.a5.ipynb 22.2 KB
Newer Older
1
2
3
4
{
 "cells": [
  {
   "cell_type": "markdown",
5
6
7
   "metadata": {
    "deletable": false
   },
8
9
   "source": [
    "<h1><center>Analysis of a PLI3.a5 HWC in an RB Circuit</center></h1>\n",
10
    "<img src=\"https://gitlab.cern.ch/LHCData/lhc-sm-hwc/raw/master/figures/rb/RB.png\" width=75%>\n",
11
12
13
    "\n",
    "PLI3.A2 is a simple current cycle at I_INTERM_2 during TIME_INTERM_2, while PLI3.A5 is a current cycle with 2 current levels (I_SM, I_INTERM_2) during TIME_INTERM_2 each. PLI3.A5 can be performed with calorimetric measurement (original purpose). In case of calorimetric measurement, the cryogenic cooling must be stable and maintained constant during the whole cycle. The aim of this test is to check the performance of the current leads and also the splices resistance, and, in case of calorimetric measurements, to detect abnormal heating in the magnets environment.\n",
    "\n",
14
    "<img src=\"https://gitlab.cern.ch/LHCData/lhc-sm-hwc/raw/master/figures/rb/PLI3_current.png\" width=50%>\n",
15
16
17
18
19
    "\n",
    "The required analysis and signatures are listed below.\n",
    "\n",
    "|Responsible|Type of analysis|Criterion|\n",
    "|-----------|----------------|---------|\n",
20
21
22
    "|-|Automatic analysis on earth current and error current|I_EARTH_PLI2_S1 < I_EARTH_MAX and I_ERR_PLI2_S1 < I_ERR_MAX|\n",
    "|MP3|Splice signals|From board A and board B separately R_bus_max <3 nOhm. Individual R_splice_max<0.5nOhm R_mag<50 nOhm|\n",
    "|MP3|Current lead|46 < TT891A < 54K; Abs(U_RES)< 40mV; and no drift Abs(U_HTS) < 0.5mV|\n",
23
    "\n",
24
    "source: Powering Procedure and Acceptance Criteria for the 13 kA Dipole Circuits, MP3 Procedure, <a href=\"https://edms.cern.ch/document/874713\">https://edms.cern.ch/document/874713</a>"
25
26
27
28
   ]
  },
  {
   "cell_type": "markdown",
29
30
31
   "metadata": {
    "deletable": false
   },
32
33
   "source": [
    "# Analysis Assumptions\n",
34
35
    "- We consider standard analysis scenarios, i.e., all signals can be queried. If a signal is missing, an analysis can raise a warning and continue or an error and abort the analysis.\n",
    "- It is recommended to execute each cell one after another. However, since the signals are queried prior to analysis, any order of execution is allowed. In case an analysis cell is aborted, the following ones may not be executed (e.g. I\\_MEAS not present). \n",
36
37
    "\n",
    "# Plot Convention\n",
38
39
    "- Scales are labeled with signal name followed by a comma and a unit in square brackets, e.g., I_MEAS, [A].\n",
    "- If a reference signal is present, it is represented with a dashed line.\n",
40
    "- If the main current is present, its axis is on the left. Remaining signals are attached to the axis on the right. The legend of these signals is located on the lower left and upper right, respectively.\n",
41
42
43
    "- The grid comes from the left axis.\n",
    "- The title contains timestamp, circuit name, and signal name allowing to re-access the signal.\n",
    "- The plots assigned to the left scale have colors: blue (C0) and orange (C1). Plots presented on the right have colors red (C2) and green (C3).\n",
44
    "- Each plot has an individual time-synchronization mentioned explicitly in the description.\n",
45
    "- If an axis has a single signal, then the color of the label matches the signal's color. Otherwise, the label color is black."
46
47
48
49
   ]
  },
  {
   "cell_type": "markdown",
50
51
52
   "metadata": {
    "deletable": false
   },
53
   "source": [
54
    "# 0. Initialise Working Environment"
55
56
57
58
   ]
  },
  {
   "cell_type": "code",
59
   "execution_count": null,
60
   "metadata": {
61
    "deletable": false,
62
63
    "scrolled": false
   },
64
   "outputs": [],
65
   "source": [
66
    "# External libraries\n",
67
    "print('Loading (1/11)'); import sys; import pandas as pd\n",
68
    "print('Loading (2/11)'); from IPython.display import display, Javascript, clear_output\n",
69
70
    "\n",
    "# Internal libraries\n",
71
72
73
74
75
76
77
78
79
    "print('Loading (3/11)'); import lhcsmapi\n",
    "print('Loading (4/11)'); from lhcsmapi.Time import Time\n",
    "print('Loading (5/11)'); from lhcsmapi.Timer import Timer\n",
    "print('Loading (6/11)'); from lhcsmapi.analysis.RbCircuitQuery import RbCircuitQuery\n",
    "print('Loading (7/11)'); from lhcsmapi.analysis.RbCircuitAnalysis import RbCircuitAnalysis\n",
    "print('Loading (8/11)'); from lhcsmapi.analysis.report_template import apply_report_template\n",
    "print('Loading (9/11)'); from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator\n",
    "print('Loading (10/11)'); from lhcsmapi.pyedsl.PlotBuilder import create_hwc_plot_title_with_circuit_name\n",
    "print('Loading (11/11)'); from lhcsmapi.analysis.expert_input import get_expert_decision\n",
80
    "\n",
81
82
83
    "pd.set_option('display.max_columns', None) \n",
    "pd.set_option('display.max_rows', None)\n",
    "\n",
84
85
    "clear_output()\n",
    "lhcsmapi.get_lhcsmapi_version()\n",
86
87
    "lhcsmapi.get_lhcsmhwc_version('../__init__.py')\n",
    "print('Analysis performed by %s' % HwcSearchModuleMediator.get_user())"
88
89
90
91
   ]
  },
  {
   "cell_type": "markdown",
92
93
94
   "metadata": {
    "deletable": false
   },
95
   "source": [
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
    "# 1. User Input\n",
    "1. Copy code from AccTesting and paste into an empty cell below\n",
    "<img src=\"https://gitlab.cern.ch/LHCData/lhc-sm-hwc/-/raw/master/figures/swan-manual-acctesting-integration.png\">\n",
    "\n",
    "    - If you only want to test the notebook only for the copy&paste feature (without opening the AccTesting), please copy and execute the code below\n",
    "    ```\n",
    "    hwc_test = 'PLI3.a5'\n",
    "    circuit_name = 'RB.A12'\n",
    "    campaign = 'HWC_2017'\n",
    "    t_start = '2017-04-22 08:57:30.399'\n",
    "    t_end = '2017-04-22 11:32:09.824'\n",
    "    ```\n",
    "\n",
    "2. To analyze a historical test with a browser GUI, copy and execute the following code in the cell below\n",
    "```\n",
    "circuit_type = 'RB'\n",
    "hwc_test = 'PLI3.a5'\n",
    "hwcb = HwcSearchModuleMediator(circuit_type=circuit_type, hwc_test=hwc_test, hwc_summary_path='/eos/project/l/lhcsm/hwc/HWC_Summary.csv')\n",
    "```\n",
    "\n",
    "    - After opening the browser GUI, choose a circuit name in order to display HWC test with, campaign name as well as start and end time"
117
118
119
120
   ]
  },
  {
   "cell_type": "code",
121
   "execution_count": null,
122
   "metadata": {
123
    "deletable": false,
Michal Maciejewski's avatar
Michal Maciejewski committed
124
    "scrolled": false
125
   },
126
   "outputs": [],
127
   "source": []
128
  },
129
130
131
132
133
134
135
136
137
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print('hwc_test = \\'%s\\'\\ncircuit_name = \\'%s\\'\\ncampaign = \\'%s\\'\\nt_start = \\'%s\\'\\nt_end = \\'%s\\'' % (hwc_test, circuit_name, campaign, t_start, t_end))"
   ]
  },
138
139
  {
   "cell_type": "markdown",
140
141
142
   "metadata": {
    "deletable": false
   },
143
144
145
146
147
148
   "source": [
    "# 2. Query All Signals Prior to Analysis"
   ]
  },
  {
   "cell_type": "code",
149
   "execution_count": null,
150
   "metadata": {
151
    "deleteable": false,
152
    "scrolled": true,
153
154
155
156
    "tags": [
     "skip_output"
    ]
   },
157
   "outputs": [],
158
   "source": [
159
160
161
162
163
164
165
166
167
168
169
    "circuit_type = 'RB'\n",
    "if 'hwcb' in locals():\n",
    "    circuit_name = hwcb.get_circuit_name()\n",
    "    t_start = Time.to_unix_timestamp(hwcb.get_start_time())\n",
    "    t_end = Time.to_unix_timestamp(hwcb.get_end_time())\n",
    "    is_automatic = hwcb.is_automatic_mode()\n",
    "else:\n",
    "    t_start = Time.to_unix_timestamp(t_start)\n",
    "    t_end = Time.to_unix_timestamp(t_end)\n",
    "    is_automatic = False\n",
    "\n",
Michal Maciejewski's avatar
Michal Maciejewski committed
170
    "rb_query = RbCircuitQuery(circuit_type, circuit_name, max_executions=6)\n",
171
    "rb_analysis = RbCircuitAnalysis(circuit_type, None, is_automatic=is_automatic)\n",
172
173
    "\n",
    "with Timer():\n",
174
    "    from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis\n",
175
    "    # PC\n",
Michal Maciejewski's avatar
Michal Maciejewski committed
176
    "    i_meas_nxcals_df = rb_query.query_signal_nxcals(t_start, t_end, t0=t_start, system='PC', signal_names='I_MEAS', spark=spark)[0]\n",
177
    "    i_meas_raw_nxcals_df = rb_query.query_raw_signal_nxcals(t_start, t_end, system='PC', signal_names='I_MEAS', spark=spark)[0]\n",
Michal Maciejewski's avatar
Michal Maciejewski committed
178
    "    plateau_start, plateau_end = rb_analysis.find_plateau_start_and_end(i_meas_raw_nxcals_df, i_meas_threshold=0, min_duration_in_sec=360, time_shift_in_sec=(240, 60))\n",
179
180
    "\n",
    "    # BUSBAR\n",
181
    "    u_res_feature_df, i_meas_feature_df = rb_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_RES', spark=spark)\n",
182
    "    res_busbar_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rb_analysis, i_meas_feature_df, u_res_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_name)\n",
183
    "    res_busbar_df = rb_analysis.convert_to_col(res_busbar_row_df, signal_name='U_RES')\n",
184
    "    \n",
185
    "    # MAGNET\n",
186
    "    u_mag_feature_df, i_meas_feature_df = rb_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_MAG', spark=spark)\n",
187
    "    res_magnet_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rb_analysis, i_meas_feature_df, u_mag_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_name)\n",
188
    "    res_magnet_df = rb_analysis.convert_to_col(res_magnet_row_df, signal_name='U_MAG')\n",
189
    "    \n",
190
    "    # LEADS\n",
Michal Maciejewski's avatar
Michal Maciejewski committed
191
192
    "    u_res_nxcals_dfs = rb_query.query_signal_nxcals(t_start, t_end, t0=t_start, system=['LEADS_EVEN', 'LEADS_ODD'], signal_names='U_RES', spark=spark)\n",
    "    u_hts_nxcals_dfs = rb_query.query_signal_nxcals(t_start, t_end, t0=t_start, system=['LEADS_EVEN', 'LEADS_ODD'], signal_names='U_HTS', spark=spark)\n",
193
    "\n",
194
    "    # DFB\n",
195
196
197
    "    tt891a_nxcals_dfs = rb_query.query_dfb_signal_nxcals(t_start, t_end, system=['LEADS_EVEN_WINCCOA', 'LEADS_ODD_WINCCOA'], signal_names='TT891A', spark=spark)\n",
    "    tt893_nxcals_dfs = rb_query.query_dfb_signal_nxcals(t_start, t_end, system=['LEADS_EVEN_WINCCOA', 'LEADS_ODD_WINCCOA'], signal_names='TT893', spark=spark)\n",
    "    cv891_nxcals_dfs = rb_query.query_dfb_signal_nxcals(t_start, t_end, system=['LEADS_EVEN_WINCCOA', 'LEADS_ODD_WINCCOA'], signal_names='CV891', spark=spark)\n"
198
199
200
201
   ]
  },
  {
   "cell_type": "markdown",
202
203
204
   "metadata": {
    "deletable": false
   },
205
206
207
208
209
   "source": [
    "# 3. Power Converter\n",
    "## 3.1. Plot of the Power Converter Main Current\n",
    "\n",
    "*ANALYSIS*:\n",
210
    "\n",
211
212
    "- Calculation of the duration of current plateaus\n",
    "\n",
213
214
    "*GRAPHS*:\n",
    "\n",
215
216
    "- t = 0 s corresponds to the start of the test\n",
    "- Orange box(es) represent period(s) of time with constant current used for calculation of busbar resistance and DFB thresholds"
217
218
219
220
   ]
  },
  {
   "cell_type": "code",
221
   "execution_count": null,
222
   "metadata": {
223
    "deletable": false,
224
225
    "scrolled": false
   },
226
   "outputs": [],
227
   "source": [
228
229
230
231
232
233
    "import matplotlib as mpl\n",
    "mpl.rcParams['savefig.dpi'] = 80\n",
    "mpl.rcParams['figure.dpi'] = 80\n",
    "%matplotlib notebook\n",
    "title = '%s, %s: %s-%s' % (circuit_name, hwc_test, Time.to_string(t_start).split('.')[0], Time.to_string(t_end).split('.')[0])\n",
    "rb_analysis.plot_i_meas_with_current_plateau(i_meas_nxcals_df, t0=i_meas_raw_nxcals_df.index[0], plateau_start=plateau_start, plateau_end=plateau_end, title=title)"
234
235
236
237
   ]
  },
  {
   "cell_type": "markdown",
238
239
240
   "metadata": {
    "deletable": false
   },
241
242
243
244
245
   "source": [
    "# 4. Busbar\n",
    "## 4.1. Busbar Resistance\n",
    "\n",
    "*ANALYSIS*:\n",
246
    "\n",
Michal Maciejewski's avatar
Michal Maciejewski committed
247
    "- Calculation of the busbar resistance as the slope of a linear fit of U,I curve obtained from the corresponding mean values of the voltage and current\n",
248
    "\n",
249
250
251
252
253
254
    "*CRITERIA*:\n",
    "\n",
    "- Check if the busbar resistance is below 3 nOhm\n",
    "\n",
    "*GRAPHS*:\n",
    "\n",
255
    "- The busbar resistance, R\n",
256
    "- The green box denotes the validity region of the busbar resostance (0, 3] nOhm"
257
258
259
260
   ]
  },
  {
   "cell_type": "code",
261
   "execution_count": null,
262
263
264
   "metadata": {
    "deletable": false
   },
265
   "outputs": [],
266
   "source": [
267
268
    "title = '%s, %s: %s-%s' % (circuit_name, hwc_test, Time.to_string(t_start).split('.')[0], Time.to_string(t_end).split('.')[0])\n",
    "res_busbar_outliers_df = rb_analysis.analyze_busbar_magnet_resistance(res_busbar_df, signal_name='R_RES', value_max=3e-9, title=title)"
269
270
271
272
   ]
  },
  {
   "cell_type": "code",
273
   "execution_count": null,
274
   "metadata": {
275
    "deletable": false
276
277
278
   },
   "outputs": [],
   "source": [
279
    "RbCircuitQuery.query_and_plot_outlier_voltage(res_busbar_outliers_df, t_start, t_end, i_meas_raw_nxcals_df.index[0], plateau_start, plateau_end, spark=spark)"
280
281
   ]
  },
282
283
284
285
286
287
288
289
290
291
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "busbar_metadata_resistance_df = rb_analysis.merge_busbar_metadata_with_resistance(res_busbar_df, circuit_type, circuit_name)\n",
    "rb_analysis.display_busbar_metadata_resistance_with_threshold(busbar_metadata_resistance_df, threshold=3e-9)"
   ]
  },
292
293
  {
   "cell_type": "markdown",
294
295
296
   "metadata": {
    "deletable": false
   },
297
298
299
300
   "source": [
    "## 4.2. Magnet Resistance\n",
    "\n",
    "*ANALYSIS*:\n",
301
    "\n",
302
    "- Calculation of the magnet resistance as the slope of a linear fit of U,I curve obtained from the corresponding mean alues of the voltage and current\n",
303
304
    "\n",
    "*CRITERIA*\n",
305
    "\n",
306
307
308
309
310
    "- Check if the resistance is below 50 nOhm\n",
    "\n",
    "*GRAPHS*:\n",
    "\n",
    "- The magnet resistance, R\n",
311
    "- The green box denotes the validity region of the magnet resistance (0, 50] nOhm\n"
312
313
314
315
   ]
  },
  {
   "cell_type": "code",
316
   "execution_count": null,
317
318
319
   "metadata": {
    "deletable": false
   },
320
   "outputs": [],
321
   "source": [
322
323
    "title = '%s, %s: %s-%s' % (circuit_name, hwc_test, Time.to_string(t_start).split('.')[0], Time.to_string(t_end).split('.')[0])\n",
    "res_magnet_outliers_df = rb_analysis.analyze_busbar_magnet_resistance(res_magnet_df, signal_name='R_MAG', value_max=50e-9, title=title)"
324
325
326
327
   ]
  },
  {
   "cell_type": "code",
328
   "execution_count": null,
329
   "metadata": {
330
331
    "deletable": false,
    "scrolled": false
332
   },
333
334
   "outputs": [],
   "source": [
335
    "RbCircuitQuery.query_and_plot_outlier_voltage(res_magnet_outliers_df.reset_index(), t_start, t_end, i_meas_raw_nxcals_df.index[0], plateau_start, plateau_end, spark=spark)"
336
337
   ]
  },
338
339
340
341
342
343
344
345
346
347
348
349
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "magnet_metadata_resistance_df = rb_analysis.merge_busbar_metadata_with_resistance(res_busbar_df, circuit_type, circuit_name)\n",
    "rb_analysis.display_busbar_metadata_resistance_with_threshold(magnet_metadata_resistance_df, threshold=50e-9)"
   ]
  },
350
351
  {
   "cell_type": "markdown",
352
353
354
   "metadata": {
    "deletable": false
   },
355
   "source": [
356
357
    "# 5. DFB\n",
    "## 5.1. DFB Voltage - U_RES\n",
358
    "\n",
359
360
    "*CRITERIA*:\n",
    "- Check if, at constant current, U_RES is constant (no drift < 2mV/h)\n",
361
    "\n",
362
    "*GRAPHS*:\n",
363
    "- t = 0 s corresponds to the start time of the test\n"
364
365
366
367
   ]
  },
  {
   "cell_type": "code",
368
   "execution_count": null,
369
   "metadata": {
370
    "deletable": false
371
   },
372
   "outputs": [],
373
   "source": [
374
    "RbCircuitAnalysis.assert_u_res_min_max_slope(u_res_nxcals_dfs, plateau_start, plateau_end, Time.to_unix_timestamp(t_start), slope_range=(-2, 2))"
375
376
377
378
   ]
  },
  {
   "cell_type": "markdown",
379
380
381
   "metadata": {
    "deletable": false
   },
382
   "source": [
383
    "## 5.2. DFB Voltage - U_HTS\n",
384
    "\n",
385
    "*CRITERIA*:  \n",
386
    "- Check if the voltage is below 50% of the threshold -> Abs(U_HTS) < 0.5 mV\n",
387
    "\n",
388
    "*GRAPHS*:\n",
389
    "- t = 0 s corresponds to the start time of the test"
390
391
392
393
   ]
  },
  {
   "cell_type": "code",
394
   "execution_count": null,
395
   "metadata": {
396
    "deletable": false,
397
398
    "scrolled": false
   },
399
   "outputs": [],
400
   "source": [
401
    "RbCircuitAnalysis.assert_u_hts_min_max_slope(u_hts_nxcals_dfs, plateau_start, plateau_end, Time.to_unix_timestamp(t_start), slope_range=(-0.5, 0.5))"
402
403
404
405
   ]
  },
  {
   "cell_type": "markdown",
406
407
408
   "metadata": {
    "deletable": false
   },
409
   "source": [
410
    "## 5.3. DFB Temperature - TT893.TEMPERATURECALC\n",
411
    "\n",
412
413
414
415
416
    "*CRITERIA*:\n",
    "\n",
    "- Check if the temperature is over the dew point, but not overheated -> 280 K < TT893 < 320 K, even without current\n",
    "\n",
    "*GRAPHS*:\n",
417
418
419
    "\n",
    "- Temperature at the top of the current lead on the right axis, TT893.TEMPERATURECALC\n",
    "- Green box denotes the temperature validity region [280, 320] K of the temperature at the top of the current lead\n",
420
    "- t = 0 s corresponds to the start time of the test"
421
422
423
424
   ]
  },
  {
   "cell_type": "code",
425
   "execution_count": null,
426
   "metadata": {
427
    "deletable": false,
428
429
    "scrolled": false
   },
430
   "outputs": [],
431
   "source": [
432
    "RbCircuitAnalysis.assert_tt893_min_max_value(tt893_nxcals_dfs, value_range=(280, 320))"
433
434
435
436
   ]
  },
  {
   "cell_type": "markdown",
437
438
439
   "metadata": {
    "deletable": false
   },
440
   "source": [
441
    "## 5.4. DFB Temperature - TT891A.TEMPERATURECALC\n",
442
    "\n",
443
444
445
446
447
    "*CRITERIA*:\n",
    "\n",
    "- Check if the temperature is regulated around 50 K -> 46 K < TT891A < 54 K, even without current\n",
    "\n",
    "*GRAPHS*:\n",
448
449
450
451
    "\n",
    "For odd and even leads\n",
    "- Main power converter current, I_MEAS\n",
    "- Temperature between the HTS and resistive part of the current lead on the right axis, TT891A.TEMPERATURECALC\n",
452
    "- t = 0 s corresponds to the start time of the test\n"
453
454
455
456
   ]
  },
  {
   "cell_type": "code",
457
   "execution_count": null,
458
   "metadata": {
459
    "deletable": false,
460
461
    "scrolled": false
   },
462
   "outputs": [],
463
   "source": [
464
    "RbCircuitAnalysis.assert_tt891a_min_max_value(tt891a_nxcals_dfs, value_range=(46, 54))"
465
466
467
468
   ]
  },
  {
   "cell_type": "markdown",
469
470
471
   "metadata": {
    "deletable": false
   },
472
   "source": [
473
    "## 5.5. DFB Valve Regulation - CV891.POSST\n",
474
    "\n",
475
476
477
478
479
480
    "*CRITERIA*:\n",
    "\n",
    "- Check if the valve is opened (>2%), but not fully (<50%)\n",
    "- Check if the valve variation (defined as difference between the maximum and minimum value) does not exceed 8% at constant current (the ramp of the current is excluded this criterion)\n",
    "\n",
    "*GRAPHS*:\n",
481
482
483
484
    "\n",
    "- Main power converter current, I_MEAS\n",
    "- Valve for regulation of TT891A, CV891.POSST\n",
    "- t = 0 s corresponds to the start time of the test\n",
485
    "- Green box denotes the valve opening validity region [2, 50] % of the TT891A temperature regulation"
486
487
488
489
   ]
  },
  {
   "cell_type": "code",
490
   "execution_count": null,
491
   "metadata": {
492
    "deletable": false,
493
494
    "scrolled": false
   },
495
   "outputs": [],
496
   "source": [
497
    "RbCircuitAnalysis.assert_cv891_min_max_value(cv891_nxcals_dfs, value_range=(2, 50))"
498
499
500
501
   ]
  },
  {
   "cell_type": "code",
502
   "execution_count": null,
503
   "metadata": {
504
    "deletable": false
505
   },
506
   "outputs": [],
507
   "source": [
508
    "RbCircuitAnalysis.assert_cv891_min_max_variation(cv891_nxcals_dfs, 8, plateau_start, plateau_end, Time.to_unix_timestamp(t_start))"
509
510
511
512
   ]
  },
  {
   "cell_type": "markdown",
513
514
515
   "metadata": {
    "deletable": false
   },
516
   "source": [
517
    "# 6. Signature Decision"
518
519
520
521
   ]
  },
  {
   "cell_type": "code",
522
   "execution_count": null,
523
524
525
   "metadata": {
    "deletable": false
   },
526
527
528
529
530
531
532
   "outputs": [],
   "source": [
    "signature = get_expert_decision('Expert Signature Decision: ', ['PASSED', 'FAILED'])"
   ]
  },
  {
   "cell_type": "markdown",
533
534
535
   "metadata": {
    "deletable": false
   },
536
537
538
539
540
541
542
   "source": [
    "# 7. Final Report"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
543
544
545
   "metadata": {
    "deletable": false
   },
546
   "outputs": [],
547
   "source": [
548
    "analysis_start_time = Time.get_analysis_start_time()\n",
549
    "apply_report_template()\n",
550
    "\n",
551
552
    "!mkdir -p /eos/project/m/mp3/RB/$circuit_name/$hwc_test\n",
    "\n",
553
554
555
556
557
558
559
560
561
562
    "file_name_csv = '{}_{}-{}-{}_{}_BUSBAR_RESISTANCE.csv'.format(circuit_name, hwc_test, Time.to_datetime(t_start).strftime(\"%Y-%m-%d-%Hh%M\"), analysis_start_time, signature)\n",
    "full_path = '/eos/project/m/mp3/RB/{}/{}/{}'.format(circuit_name, hwc_test, file_name_csv)\n",
    "busbar_metadata_resistance_df.to_csv(full_path)\n",
    "print('Busbar resistance table saved to (Windows): ' + '\\\\\\\\cernbox-smb' + full_path.replace('/', '\\\\'))\n",
    "\n",
    "file_name_csv = '{}_{}-{}-{}_{}_MAGNET_RESISTANCE.csv'.format(circuit_name, hwc_test, Time.to_datetime(t_start).strftime(\"%Y-%m-%d-%Hh%M\"), analysis_start_time, signature)\n",
    "full_path = '/eos/project/m/mp3/RB/{}/{}/{}'.format(circuit_name, hwc_test, file_name_csv)\n",
    "magnet_metadata_resistance_df.to_csv(full_path)\n",
    "print('Magnet resistance table saved to (Windows): ' + '\\\\\\\\cernbox-smb' + full_path.replace('/', '\\\\'))\n",
    "\n",
563
564
    "file_name_html = '{}_{}-{}-{}_{}.html'.format(circuit_name, hwc_test, Time.to_datetime(t_start).strftime(\"%Y-%m-%d-%Hh%M\"), analysis_start_time, signature)\n",
    "full_path = '/eos/project/m/mp3/RB/{}/{}/{}'.format(circuit_name, hwc_test, file_name_html)\n",
565
    "print('Compact notebook report saved to (Windows): ' + '\\\\\\\\cernbox-smb' + full_path.replace('/', '\\\\'))\n",
566
    "\n",
567
    "display(Javascript('IPython.notebook.save_notebook();'))\n",
568
    "Time.sleep(5)\n",
569
    "!{sys.executable} -m jupyter nbconvert --to html $'AN_RB_PLI3.a5.ipynb' --output /eos/project/m/mp3/RB/$circuit_name/$hwc_test/$file_name_html --TemplateExporter.exclude_input=True --TagRemovePreprocessor.remove_all_outputs_tags='[\"skip_output\"]'"
570
   ]
Michal Maciejewski's avatar
Michal Maciejewski committed
571
572
573
574
575
576
577
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  },
  "sparkconnect": {
599
600
601
   "bundled_options": [
    "NXCALS"
   ],
Michal Maciejewski's avatar
Michal Maciejewski committed
602
   "list_of_options": []
603
604
605
606
607
608
609
610
611
612
613
614
615
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": false,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
616
617
618
619
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
Michal Maciejewski's avatar
Michal Maciejewski committed
620
}