AN_RB_PLI3.a5.ipynb 21.7 KB
Newer Older
1
2
3
4
5
6
7
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<h1><center>Analysis of a PLI3.a5 HWC in an RB Circuit</center></h1>\n",
8
    "<img src=\"https://gitlab.cern.ch/LHCData/lhc-sm-hwc/raw/master/figures/rb/RB.png\" width=75%>\n",
9
10
11
    "\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",
12
    "<img src=\"https://gitlab.cern.ch/LHCData/lhc-sm-hwc/raw/master/figures/rb/PLI3_current.png\" width=50%>\n",
13
14
15
16
17
    "\n",
    "The required analysis and signatures are listed below.\n",
    "\n",
    "|Responsible|Type of analysis|Criterion|\n",
    "|-----------|----------------|---------|\n",
18
19
20
    "|-|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",
21
22
23
24
25
26
27
28
29
    "\n",
    "source: Powering Procedure and Acceptance Criteria for the 13 kA Dipole Circuits, MP3 Procedure, <a href=\"https://edms.cern.ch/document/874713/5.1\">https://edms.cern.ch/document/874713/5.1</a>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Analysis Assumptions\n",
30
31
32
    "- 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",
    "- In case a signal is not needed for the analysis, a particular analysis is skipped. In other words, all signals have to be available in order to perform an 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",
33
34
    "\n",
    "# Plot Convention\n",
35
36
    "- 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",
37
    "- 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",
38
39
40
    "- 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",
41
    "- Each plot has an individual time-synchronization mentioned explicitly in the description.\n",
42
    "- If an axis has a single signal, then the color of the label matches the signal's color. Otherwise, the label color is black."
43
44
45
46
47
48
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
49
    "# 0. Initialise Working Environment"
50
51
52
53
   ]
  },
  {
   "cell_type": "code",
54
   "execution_count": null,
55
   "metadata": {
56
    "editable": false,
57
58
    "scrolled": false
   },
59
   "outputs": [],
60
   "source": [
Michal Maciejewski's avatar
Michal Maciejewski committed
61
62
    "import io\n",
    "import re\n",
63
    "import sys\n",
64
    "import time\n",
65
    "import pandas as pd\n",
66
67
    "import numpy as np\n",
    "from IPython.display import display, Javascript\n",
68
69
70
71
72
73
    "\n",
    "# lhc-sm-api\n",
    "from lhcsmapi.Time import Time\n",
    "from lhcsmapi.Timer import Timer\n",
    "\n",
    "# GUI\n",
74
    "from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator\n",
75
76
77
78
79
    "\n",
    "# Query\n",
    "from lhcsmapi.analysis.RbCircuitQuery import RbCircuitQuery\n",
    "\n",
    "# Analysis\n",
80
    "from lhcsmapi.analysis.report_template import apply_report_template\n",
81
    "from lhcsmapi.pyedsl.AssertionBuilder import AssertionBuilder\n",
82
83
    "from lhcsmapi.analysis.RbCircuitAnalysis import RbCircuitAnalysis\n",
    "from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import convert_to_col\n",
84
    "\n",
85
    "import lhcsmapi\n",
86
87
    "print('Analysis executed with lhcsmapi version: {}'.format(lhcsmapi.__version__))\n",
    "\n",
Michal Maciejewski's avatar
Michal Maciejewski committed
88
89
90
    "with io.open(\"../__init__.py\", \"rt\", encoding=\"utf8\") as f:\n",
    "    version = re.search(r'__version__ = \"(.*?)\"', f.read()).group(1)\n",
    "    print('Analysis executed with lhc-sm-hwc notebooks version: {}'.format(version))"
91
92
93
94
95
96
97
98
99
100
101
102
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1. Select PLI3.a5 HWC Test\n",
    "- Choose a circuit name in order to display HWC test with, campaign name as well as start and end time"
   ]
  },
  {
   "cell_type": "code",
103
   "execution_count": null,
104
   "metadata": {
105
    "editable": false,
106
107
    "scrolled": true
   },
108
   "outputs": [],
109
110
111
   "source": [
    "circuit_type = 'RB'\n",
    "hwc_test = 'PLI3.a5'\n",
112
    "hwcb = HwcSearchModuleMediator(circuit_type=circuit_type, hwc_test=hwc_test, hwc_summary_path='/eos/project/l/lhcsm/hwc/HWC_Summary.csv')"
113
114
115
116
117
118
119
120
121
122
123
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2. Query All Signals Prior to Analysis"
   ]
  },
  {
   "cell_type": "code",
124
   "execution_count": null,
125
   "metadata": {
126
    "editable": false,
127
128
129
130
    "tags": [
     "skip_output"
    ]
   },
131
   "outputs": [],
132
133
134
135
   "source": [
    "circuit_name = hwcb.get_circuit_name()\n",
    "t_start = hwcb.get_start_time()\n",
    "t_end = hwcb.get_end_time()\n",
136
    "is_automatic = hwcb.is_automatic_mode()\n",
137
    "rb_query = RbCircuitQuery(circuit_type, circuit_name, max_executions=12)\n",
138
    "rb_analysis = RbCircuitAnalysis(circuit_type, pd.DataFrame(), is_automatic=is_automatic)\n",
139
140
    "\n",
    "with Timer():\n",
141
142
143
    "    # PC\n",
    "    i_meas_nxcals_df = rb_query.query_signal_nxcals(t_start, t_end, system='PC', signal_names='I_MEAS', spark=spark)[0]\n",
    "    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",
144
145
    "    plateau_start, plateau_end = rb_query.calculate_current_plateau_start_end(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), \n",
    "                                                                              i_meas_threshold=500, min_duration_in_sec=1, spark=spark)\n",
146
147
    "\n",
    "    # BUSBAR\n",
148
149
150
    "    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, \n",
    "                                                                          signal_name='U_RES', spark=spark)\n",
    "    res_busbar_row_df = rb_analysis.calculate_resistance(i_meas_feature_df, u_res_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_name)\n",
151
    "    res_busbar_df = convert_to_col(res_busbar_row_df, signal_name='U_RES')\n",
152
    "    \n",
153
    "    # MAGNET\n",
154
155
156
    "    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, \n",
    "                                                                          signal_name='U_MAG', spark=spark)\n",
    "    res_magnet_row_df = rb_analysis.calculate_resistance(i_meas_feature_df, u_mag_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_name)\n",
157
    "    res_magnet_df = convert_to_col(res_magnet_row_df, signal_name='U_MAG')\n",
158
    "    \n",
159
160
161
    "    # LEADS\n",
    "    u_res_nxcals_dfs = rb_query.query_signal_nxcals(t_start, t_end, 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, system=['LEADS_EVEN', 'LEADS_ODD'], signal_names='U_HTS', spark=spark)\n",
162
    "\n",
163
164
165
    "    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"
166
167
168
169
170
171
172
173
174
175
176
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 3. Power Converter\n",
    "## 3.1. Plot of the Power Converter Main Current\n",
    "\n",
    "*QUERY*:\n",
    "\n",
177
178
179
    "|Variable Name\t|Variable Type\t|Variable Unit\t|Database|Comment\n",
    "|---------------|---------------|---------------|--------|------|\n",
    "|i_meas_df | DataFrame | A |NXCALS| Main power converter current, I_MEAS|\n",
180
181
    "\n",
    "*ANALYSIS*:\n",
182
    "\n",
183
184
    "- Calculation of the duration of current plateaus\n",
    "\n",
185
186
    "*GRAPHS*:\n",
    "\n",
187
188
    "- 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"
189
190
191
192
   ]
  },
  {
   "cell_type": "code",
193
   "execution_count": null,
194
   "metadata": {
195
196
    "deletable": false,
    "editable": false,
197
198
    "scrolled": false
   },
199
   "outputs": [],
200
201
   "source": [
    "ax = i_meas_nxcals_df.plot(figsize=(30, 10), grid=True)\n",
202
203
204
    "for ps, pe in zip(plateau_start, plateau_end):\n",
    "    ax.axvspan(xmin=(ps-Time.to_unix_timestamp(i_meas_raw_nxcals_df.index[0]))/1e9, \n",
    "               xmax=(pe-Time.to_unix_timestamp(i_meas_raw_nxcals_df.index[0]))/1e9, facecolor='xkcd:goldenrod')\n",
205
206
207
208
209
210
211
212
213
214
215
216
217
218
    "ax.set_xlabel(\"time, [s]\", fontsize=15)\n",
    "ax.set_ylabel(\"I_MEAS, [A]\", fontsize=15)\n",
    "ax.tick_params(labelsize=15)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 4. Busbar\n",
    "## 4.1. Busbar Resistance\n",
    "\n",
    "*QUERY*:\n",
    "\n",
219
220
221
222
    "|Variable Name\t|Variable Type\t|Variable Unit\t|Database|Comment\n",
    "|---------------|---------------|---------------|--------|------|\n",
    "|i_meas_feature_df | DataFrame | A |NXCALS| Mean, std, and count values of the main power converter current labeled (1,2,...) at the current plateaus, I_MEAS|\n",
    "|u_res_feature_df | DataFrame | V |NXCALS| Mean, std, and count values of the busbar voltage labeled (1,2,...) at the current plateaus, U_RES|\n",
223
224
    "\n",
    "*ANALYSIS*:\n",
225
    "\n",
226
227
    "- Calculation of the busbar resistance as the slope of a linear fit of U,I curve obtained from the corresponding mean alues of the voltage and current\n",
    "\n",
228
229
230
231
232
233
    "*CRITERIA*:\n",
    "\n",
    "- Check if the busbar resistance is below 3 nOhm\n",
    "\n",
    "*GRAPHS*:\n",
    "\n",
234
    "- The busbar resistance, R\n",
235
    "- The green box denotes the validity region of the busbar resostance (0, 3] nOhm"
236
237
238
239
   ]
  },
  {
   "cell_type": "code",
240
   "execution_count": null,
241
242
243
   "metadata": {
    "editable": false
   },
244
   "outputs": [],
245
   "source": [
246
    "res_busbar_outliers_df = rb_analysis.analyze_busbar_magnet_resistance(res_busbar_df, signal_name='R_RES', max_value=3e-9)"
247
248
249
250
   ]
  },
  {
   "cell_type": "code",
251
   "execution_count": null,
252
253
254
255
256
   "metadata": {
    "editable": false
   },
   "outputs": [],
   "source": [
257
    "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)"
258
259
   ]
  },
260
261
262
263
264
265
266
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4.2. Magnet Resistance\n",
    "*QUERY*:\n",
    "\n",
267
268
    "|Variable Name\t|Variable Type\t|Variable Unit\t|Database|Comment\n",
    "|---------------|---------------|---------------|--------|------|\n",
269
    "|res_magnet_df | DataFrame | Ohm |NXCALS| Magnet resistance, R_MAG|\n",
270
271
    "\n",
    "*ANALYSIS*:\n",
272
    "\n",
273
    "- 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",
274
275
    "\n",
    "*CRITERIA*\n",
276
    "\n",
277
278
279
280
281
    "- Check if the resistance is below 50 nOhm\n",
    "\n",
    "*GRAPHS*:\n",
    "\n",
    "- The magnet resistance, R\n",
282
    "- The green box denotes the validity region of the magnet resistance (0, 50] nOhm\n"
283
284
285
286
   ]
  },
  {
   "cell_type": "code",
287
   "execution_count": null,
288
289
290
   "metadata": {
    "editable": false
   },
291
   "outputs": [],
292
   "source": [
293
    "res_magnet_outliers_df = rb_analysis.analyze_busbar_magnet_resistance(res_magnet_df, signal_name='R_MAG', max_value=50e-9)"
294
295
296
297
   ]
  },
  {
   "cell_type": "code",
298
   "execution_count": null,
299
300
301
302
303
   "metadata": {
    "editable": false
   },
   "outputs": [],
   "source": [
304
    "RbCircuitQuery.query_and_plot_outlier_voltage(res_magnet_outliers_df, t_start, t_end, i_meas_raw_nxcals_df.index[0], plateau_start, plateau_end, spark=spark)"
305
306
   ]
  },
307
308
309
310
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
311
312
    "# 5. DFB\n",
    "## 5.1. DFB Voltage - U_RES\n",
313
314
315
316
317
    "\n",
    "U_RES - Voltage of the resistive part of the current lead (QPS threshold at 100 mV, 100 ms)  \n",
    "\n",
    "*QUERY*:\n",
    "\n",
318
319
    "|Variable Name\t|Variable Type\t|Variable Unit\t|Database|Comment\n",
    "|---------------|---------------|---------------|--------|------|\n",
320
    "|u_res_nxcals_dfs\t|list of DataFrames\t|V\t|NXCALS|Voltage of the resistive part of even and odd leads, U_RES|\n",
321
    "\n",
322
323
    "*CRITERIA*:\n",
    "- Check if, at constant current, U_RES is constant (no drift < 2mV/h)\n",
324
    "\n",
325
    "*GRAPHS*:\n",
326
    "- t = 0 s corresponds to the start time of the test\n"
327
328
329
330
   ]
  },
  {
   "cell_type": "code",
331
   "execution_count": null,
332
333
334
335
   "metadata": {
    "deletable": false,
    "editable": false
   },
336
   "outputs": [],
337
   "source": [
338
    "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))"
339
340
341
342
343
344
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
345
    "## 5.2. DFB Voltage - U_HTS\n",
346
347
348
349
350
    "\n",
    "U_HTS - Voltage of the HTS part of the current lead (QPS threshold at 1 mV, 100 ms)  \n",
    "\n",
    "*QUERY*:\n",
    "\n",
351
352
    "|Variable Name\t|Variable Type\t|Variable Unit\t|Database|Comment\n",
    "|---------------|---------------|---------------|--------|------|\n",
353
    "|u_hts_nxcals_dfs\t|list of DataFrames\t|V\t|NXCALS|Voltage of the HTS part of even and odd leads, U_HTS|\n",
354
    "\n",
355
    "*CRITERIA*:  \n",
356
    "- Check if the voltage is below 50% of the threshold -> Abs(U_HTS) < 0.5 mV\n",
357
    "\n",
358
    "*GRAPHS*:\n",
359
    "- t = 0 s corresponds to the start time of the test"
360
361
362
363
   ]
  },
  {
   "cell_type": "code",
364
   "execution_count": null,
365
   "metadata": {
366
367
    "deletable": false,
    "editable": false,
368
369
    "scrolled": false
   },
370
   "outputs": [],
371
   "source": [
372
    "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))"
373
374
375
376
377
378
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
379
    "## 5.3. DFB Temperature - TT893.TEMPERATURECALC\n",
380
381
382
383
384
385
386
387
    "\n",
    "TT893.TEMPERATURECALC - Temperature at the top of the current lead (supposed to be at the room temperature) \n",
    "\n",
    "*QUERY*:\n",
    "- NXCALS for temperature at the top of the current lead (even and odd), TT893.TEMPERATURECALC\n",
    "\n",
    "*INPUT*:  \n",
    "\n",
388
389
    "|Variable Name\t|Variable Type\t|Variable Unit\t|Database|Comment\n",
    "|---------------|---------------|---------------|--------|------|\n",
390
    "|tt893_nxcals_dfs\t|list of DataFrames\t|K\t|NXCALS|Temperature at the top of the current lead, TT893.TEMPERATURECALC|\n",
391
    "\n",
392
393
394
395
396
    "*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",
397
398
399
    "\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",
400
    "- t = 0 s corresponds to the start time of the test"
401
402
403
404
   ]
  },
  {
   "cell_type": "code",
405
   "execution_count": null,
406
   "metadata": {
407
408
    "deletable": false,
    "editable": false,
409
410
    "scrolled": false
   },
411
   "outputs": [],
412
   "source": [
413
    "RbCircuitAnalysis.assert_tt893_min_max_value(tt893_nxcals_dfs, value_range=(280, 320))"
414
415
416
417
418
419
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
420
    "## 5.4. DFB Temperature - TT891A.TEMPERATURECALC\n",
421
422
423
424
425
    "\n",
    "TT891A.TEMPERATURECALC - Temperature between the HTS and resistive part of the current leads (supposed to be regulated around 50 K)\n",
    "\n",
    "*QUERY*:\n",
    "\n",
426
427
    "|Variable Name\t|Variable Type\t|Variable Unit\t|Database|Comment\n",
    "|---------------|---------------|---------------|--------|------|\n",
428
    "|tt891a_nxcals_dfs\t|list of DataFrames\t|K\t|NXCALS|Temperature between the HTS and resistive part of the current lead, TT891A.TEMPERATURECALC|\n",
429
    "\n",
430
431
432
433
434
    "*CRITERIA*:\n",
    "\n",
    "- Check if the temperature is regulated around 50 K -> 46 K < TT891A < 54 K, even without current\n",
    "\n",
    "*GRAPHS*:\n",
435
436
437
438
    "\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",
439
    "- t = 0 s corresponds to the start time of the test\n"
440
441
442
443
   ]
  },
  {
   "cell_type": "code",
444
   "execution_count": null,
445
   "metadata": {
446
447
    "deletable": false,
    "editable": false,
448
449
    "scrolled": false
   },
450
   "outputs": [],
451
   "source": [
452
    "RbCircuitAnalysis.assert_tt891a_min_max_value(tt891a_nxcals_dfs, value_range=(46, 54))"
453
454
455
456
457
458
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
459
    "## 5.5. DFB Valve Regulation - CV891.POSST\n",
460
461
462
    "\n",
    "CV891.POSST - Valve for regulation of TT891A\n",
    "\n",
463
    "*QUERY*: \n",
464
    "\n",
465
466
467
    "|Variable Name\t|Variable Type\t|Variable Unit\t|Database|Comment\n",
    "|---------------|---------------|---------------|--------|------|\n",
    "|cv891_nxcals_dfs\t|list of DataFrames\t|%\t|NXCALS|Valve for regulation of TT891A, CV891.POSST|\n",
468
    "\n",
469
470
471
472
473
474
    "*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",
475
476
477
478
    "\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",
479
    "- Green box denotes the valve opening validity region [2, 50] % of the TT891A temperature regulation"
480
481
482
483
   ]
  },
  {
   "cell_type": "code",
484
   "execution_count": null,
485
   "metadata": {
486
487
    "deletable": false,
    "editable": false,
488
489
    "scrolled": false
   },
490
   "outputs": [],
491
   "source": [
492
    "RbCircuitAnalysis.assert_cv891_min_max_value(cv891_nxcals_dfs, value_range=(2, 50))"
493
494
495
496
   ]
  },
  {
   "cell_type": "code",
497
   "execution_count": null,
498
499
500
501
   "metadata": {
    "deletable": false,
    "editable": false
   },
502
   "outputs": [],
503
   "source": [
504
    "RbCircuitAnalysis.assert_cv891_min_max_variation(cv891_nxcals_dfs, 8, plateau_start, plateau_end, Time.to_unix_timestamp(t_start))"
505
506
507
508
509
510
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
511
    "# 6. Final Report"
512
513
514
515
   ]
  },
  {
   "cell_type": "code",
516
   "execution_count": null,
517
518
519
520
   "metadata": {
    "deletable": false,
    "editable": false
   },
521
   "outputs": [],
522
523
   "source": [
    "campaign = hwcb.get_campaign()\n",
524
    "apply_report_template()\n",
525
    "file_name_html = '{}-{}_report.html'.format(Time.to_datetime(t_start).strftime(\"%Y.%m.%d_%H%M%S.%f\"), Time.to_datetime(t_end).strftime(\"%Y.%m.%d_%H%M%S.%f\"))\n",
526
    "full_path = '/eos/project/l/lhcsm/hwc/RB/{}/{}/{}/{}'.format(circuit_name, hwc_test, campaign, file_name_html)\n",
527
    "!mkdir -p /eos/project/l/lhcsm/hwc/RB/$circuit_name/$hwc_test/$campaign\n",
528
529
530
531
    "print('Compact notebook report saved to (Windows): ' + '\\\\\\\\cernbox-smb' + full_path.replace('/', '\\\\'))\n",
    "display(Javascript('IPython.notebook.save_notebook();'))\n",
    "time.sleep(5)\n",
    "!{sys.executable} -m jupyter nbconvert --to html $'AN_RB_PLI3.a5.ipynb' --output /eos/project/l/lhcsm/hwc/RB/$circuit_name/$hwc_test/$campaign/$file_name_html --TemplateExporter.exclude_input=True --TagRemovePreprocessor.remove_all_outputs_tags='[\"skip_output\"]'"
532
   ]
Michal Maciejewski's avatar
Michal Maciejewski committed
533
534
535
536
537
538
539
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
  }
 ],
 "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": {
   "bundled_options": [
    "SparkMetrics",
    "NXCALS"
   ],
Michal Maciejewski's avatar
Michal Maciejewski committed
565
   "list_of_options": []
566
567
568
569
570
571
572
573
574
575
576
577
578
  },
  "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
579
580
581
582
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
583
}