Commit 7a88b937 authored by Aleksandra Mnich's avatar Aleksandra Mnich
Browse files

Merge branch 'dev' into 'master'

Release 1.5.66

See merge request !58
parents 52a93d2c c142ba6c
Pipeline #3456537 failed with stages
in 5 minutes
......@@ -3,3 +3,4 @@
**.sys.v#.*
.idea/
venv
\ No newline at end of file
......@@ -90,7 +90,7 @@ notebooks_exec:
image: gitlab-registry.cern.ch/db/swan-spark-notebooks:latest
stage: test
artifacts:
when: on_failure
when: always
paths:
- report.xml
- results
......
......@@ -31,26 +31,28 @@
"- The grid comes from the left axis\n",
"- Title contains timestamp, circuit name, signal name allowing for re-access the signal.\n",
"- The plots assigned to the left scale got colors: blue (C0) and orange (C1). Plots presented on the right have colors red (C2) and green (C3).\n",
"- Each plot has an individual time-synchronization mentioned explicitly in the description.\n",
"- If an axis has a single signal, change color of the label to match the signal's color. Otherwise, the label color is black.\n",
 
 
 
 
 
 
 
 
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
"# 0. Initialise Working Environment"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
},
"source": [
"# 0. Initialise Working Environment"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
"scrolled": true
},
"outputs": [],
"source": [
"# External libraries\n",
"print('Loading (1/16)'); import pandas as pd\n",
......@@ -68,11 +70,11 @@
"print('Loading (11/16)'); from lhcsmapi.analysis.report_template import apply_report_template\n",
"print('Loading (12/16)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule\n",
"print('Loading (13/16)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator\n",
"print('Loading (14/16)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (15/16)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType\n",
"print('Loading (14/14)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (16/16)'); import lhcsmnb.utils\n",
"\n",
"clear_output()\n",
"lhcsmapi.get_lhcsmapi_version()\n",
"lhcsmapi.get_lhcsmhwc_version('../__init__.py')"
]
......@@ -83,15 +85,18 @@
"deletable": false
},
"source": [
"# 1. Select FGC Post Mortem Entry"
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": [
},
{
"cell_type": "markdown",
"metadata": {
"tags": [
"skip_cell"
]
},
"source": [
"In order to perform the analysis of a FPA in an RCD/O 600A circuit please:\n",
"1. Select circuit name (e.g., RC.A12B1)\n",
"2. Choose start and end time\n",
"3. Choose analysis mode (Automatic by default)\n",
......@@ -116,15 +121,15 @@
" end_date_time='2021-01-31 00:00:00+01:00'), circuit_type='600A_RCBXHV')"
]
},
{
"cell_type": "markdown",
 
 
"source": [
"# 2. Query All Signals Prior to Analysis"
]
 
 
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
......@@ -161,14 +166,14 @@
" timestamp_pic_rcbxv = query_rcbxv.find_timestamp_pic(timestamp_fgc_rcbxv, spark=spark)\n",
"\n",
" # QDS NXCALS - To check if there was any drift of QDS cards prior to the trigger\n",
" # # RCBXH\n",
" i_meas_nxcals_rcbxh_df = query_rcbxh.query_pc_nxcals(timestamp_fgc_rcbxh, signal_names=['I_MEAS'], spark=spark)[0]\n",
" i_meas_nxcals_rcbxv_df = query_rcbxv.query_pc_nxcals(timestamp_fgc_rcbxv, signal_names=['I_MEAS'], spark=spark)[0]\n",
" u_res_nxcals_rcbxv_df = query_rcbxv.query_iqps_nxcals(timestamp_fgc_rcbxv, signal_names=['U_RES'], spark=spark)[0]\n",
 
 
" u_res_nxcals_rcbxh_df = query_rcbxh.query_iqps_nxcals(timestamp_fgc_rcbxh, signal_names=['U_RES'], spark=spark)[0]\n",
 
" i_meas_nxcals_rcbxv_df = query_rcbxv.query_pc_nxcals(timestamp_fgc_rcbxv, signal_names=['I_MEAS'], spark=spark)[0]\n",
" u_res_nxcals_rcbxv_df = query_rcbxv.query_iqps_nxcals(timestamp_fgc_rcbxv, signal_names=['U_RES'], spark=spark)[0]\n",
"\n",
" # QDS PM\n",
" # # RCBXH\n",
" source_timestamp_qds_rcbxh_df = query_rcbxh.find_source_timestamp_qds_board_ab(timestamp_fgc_rcbxh, duration=[(2, 's'), (2, 's')])\n",
" timestamp_qds_rcbxh = lhcsmnb.utils.get_at(source_timestamp_qds_rcbxh_df, 0, 'timestamp', default=np.nan)\n",
......@@ -412,11 +417,11 @@
"metadata": {
"deletable": false
},
"outputs": [],
"source": [
 
"analysis_rcbxv.plot_i_earth_pc(circuit_names[1], timestamp_fgc_rcbxv, i_earth_rcbxv_df)\n",
"analysis_rcbxv.calculate_max_i_earth_pc(i_earth_rcbxv_df, col_name='I_Earth_max_V')"
]
},
{
"cell_type": "markdown",
......@@ -426,18 +431,19 @@
"source": [
"# 5. QDS\n",
"The quench voltage U_RES is calculated according to the following formula:\n",
"\n",
"\\begin{equation}\n",
"\n",
"U_{\\text{RES}} = U_{\\text{DIFF}} + L d/dt (I+U_{\\text{DIFF}}/R).\n",
"\\end{equation}\n",
"\n",
"Note that I_DCCT is the QPS signal name, even though the current is actually measured not with a DCCT, but with a LEM detector, hence the poorer quality w.r.t. to the FGC I_A/B/MEAS signals that are measured with a DCCT.\n",
"\n",
"It can be seen from the sign convention in the figure below that a resistive voltage always has opposite sign to the measured current.\n",
"\n",
"<img src=\"https://gitlab.cern.ch/LHCData/lhc-sm-hwc/-/raw/master/figures/600A/600A_without_EE.png\" width=75%>\n",
"\n",
"The QPS signals that are communicated to the post-mortem system have only 12 bit resolution.\n",
"As U_DIFF contributes directly to U_RES, the resolution of U_RES is, at least partially, limited by that of U_DIFF. Moreover, U_RES is affected by the noisy time derivative of the current signal.\n",
"The QPS signals that are communicated to the post-mortem system have only 12 bit resolution.\n",
"\n",
"## 5.1. Resistive Voltage\n",
"\n",
"*ANALYSIS*:\n",
......
......@@ -29,26 +29,28 @@
"- If a reference signal is present, it is represented with a dashed line.\n",
"- 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",
"- 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",
"- Each plot has an individual time-synchronization mentioned explicitly in the description.\n",
"- If an axis has a single signal, then the color of the label matches the signal's color. Otherwise, the label color is black."
 
 
"- Each plot has an individual time-synchronization mentioned explicitly in the description.\n",
"- If an axis has a single signal, then the color of the label matches the signal's color. Otherwise, the label color is black."
 
 
{
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
"# 0. Initialise Working Environment"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
},
"source": [
"# 0. Initialise Working Environment"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
},
"outputs": [],
"source": [
"# External libraries\n",
"print('Loading (1/16)'); import pandas as pd\n",
......@@ -66,11 +68,11 @@
"print('Loading (11/16)'); from lhcsmapi.analysis.report_template import apply_report_template\n",
"print('Loading (12/16)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule\n",
"print('Loading (13/16)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator\n",
"print('Loading (14/16)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (15/16)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType\n",
"print('Loading (14/14)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (16/16)'); import lhcsmnb.utils\n",
"\n",
"clear_output()\n",
"lhcsmapi.get_lhcsmapi_version()\n",
"lhcsmapi.get_lhcsmhwc_version('../__init__.py')"
]
......@@ -81,15 +83,18 @@
"deletable": false
},
"source": [
"# 1. Select FGC Post Mortem Entry"
]
},
{
"cell_type": "markdown",
"metadata": {
"deleteable": false,
},
{
"cell_type": "markdown",
"metadata": {
"deleteable": false,
"tags": [
"skip_cell"
]
},
"source": [
"In order to perform the analysis of a FPA in an RCD/O 600A circuit please:\n",
"1. Select circuit name (e.g., RC.A12B1)\n",
"2. Choose start and end time\n",
......@@ -115,23 +120,23 @@
"fgc_pm_search = FgcPmSearchModuleMediator(DateTimeBaseModule(start_date_time='2021-01-26 00:00:00+01:00',\n",
" end_date_time='2021-01-31 00:00:00+01:00'), circuit_type='600A_RCDO')"
]
},
{
 
 
"metadata": {
"deletable": false
},
"source": [
"# 2. Query All Signals Prior to Analysis"
]
},
 
 
"cell_type": "code",
"execution_count": null,
"metadata": {
 
 
"tags": [
"skip_output"
]
},
"outputs": [],
......@@ -153,14 +158,14 @@
" i_meas_rcd_df, i_a_rcd_df, i_ref_rcd_df, i_earth_rcd_df = query_rcd.query_pc_pm(timestamp_fgc_rcd, timestamp_fgc_rcd, signal_names=['I_MEAS', 'I_A', 'I_REF', 'I_EARTH'])\n",
" events_action_rcd_df, events_symbol_rcd_df = query_rcd.query_pc_pm_events(timestamp_fgc_rcd, signal_names=['ACTION', 'SYMBOL'])\n",
" # RCO\n",
" i_meas_rco_df, i_a_rco_df, i_ref_rco_df, i_earth_rco_df = query_rco.query_pc_pm(timestamp_fgc_rco, timestamp_fgc_rco, signal_names=['I_MEAS', 'I_A', 'I_REF', 'I_EARTH'])\n",
" events_action_rco_df, events_symbol_rco_df = query_rco.query_pc_pm_events(timestamp_fgc_rco, signal_names=['ACTION', 'SYMBOL'])\n",
" timestamp_pic_rcd = query_rcd.find_timestamp_pic(timestamp_fgc_rcd, spark=spark)\n",
 
" timestamp_pic_rco = query_rco.find_timestamp_pic(timestamp_fgc_rco, spark=spark)\n",
 
 
 
 
 
" # # RCO\n",
" timestamp_pic_rco = query_rco.find_timestamp_pic(timestamp_fgc_rco, spark=spark)\n",
"\n",
" # QDS NXCALS - To check if there was any drift of QDS cards prior to the trigger\n",
" # # RCD\n",
......@@ -301,17 +306,18 @@
"metadata": {
"deletable": false
},
"outputs": [],
"source": [
]
"t_quench = analysis_rcd.estimate_quench_start_from_i_ref_i_a(i_ref_rcd_df, i_a_rcd_df)\n",
"t_quench = 0 if t_quench is None else t_quench\n",
"t_quench_correction = analysis_rcd.plot_i_meas_pc_with_cursor(circuit_names[0], timestamp_fgc_rcd, [i_meas_rcd_df, i_a_rcd_df, i_ref_rcd_df], t_quench)"
]
},
{
"cell_type": "code",
 
"execution_count": null,
"metadata": {
"deletable": false
},
"outputs": [],
"source": [
......@@ -430,11 +436,11 @@
"- t = 0 s corresponds to the FGC timestamp"
]
},
{
"cell_type": "code",
 
"execution_count": null,
"metadata": {
"deletable": false
},
"outputs": [],
"source": [
......@@ -444,18 +450,19 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"source": [
"deletable": false
},
"outputs": [],
"source": [
]
 
" analysis_rcd.results_table['EE_RCD analysis'] = get_expert_decision('EE_RCD analysis: ', ['PASS', 'FAIL'])"
]
},
"metadata": {
 
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
......
......@@ -29,26 +29,28 @@
"- If a reference signal is present, it is represented with a dashed line.\n",
"- 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",
"- 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",
"- Each plot has an individual time-synchronization mentioned explicitly in the description.\n",
"- If an axis has a single signal, then the color of the label matches the signal's color. Otherwise, the label color is black."
 
 
"- Each plot has an individual time-synchronization mentioned explicitly in the description.\n",
"- If an axis has a single signal, then the color of the label matches the signal's color. Otherwise, the label color is black."
 
 
{
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
"# 0. Initialise Working Environment"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
},
"source": [
"# 0. Initialise Working Environment"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
},
"outputs": [],
"source": [
"# External libraries\n",
"print('Loading (1/16)'); import pandas as pd\n",
......@@ -66,11 +68,11 @@
"print('Loading (11/16)'); from lhcsmapi.analysis.report_template import apply_report_template\n",
"print('Loading (12/16)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule\n",
"print('Loading (13/16)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator\n",
"print('Loading (14/16)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (15/16)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType\n",
"print('Loading (14/14)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (16/16)'); import lhcsmnb.utils\n",
"\n",
"clear_output()\n",
"lhcsmapi.get_lhcsmapi_version()\n",
"lhcsmapi.get_lhcsmhwc_version('../__init__.py')"
]
......@@ -82,14 +84,16 @@
},
"source": [
"# 1. Select FGC Post Mortem Entry"
]
},
{
"cell_type": "markdown",
"metadata": {
"deleteable": false,
{
"cell_type": "markdown",
"metadata": {
"deleteable": false,
"tags": [
"skip_cell"
]
},
"source": [
"In order to perform the analysis of a FPA in an 600A circuit with/without EE please:\n",
"1. Select circuit family (e.g., RCS)\n",
......@@ -101,22 +105,22 @@
"**Note that 24 hours is the maximum duration of a single PM query for an event. To avoid delays in querying events, please restrict your query duration as much as possible.**"
]
},
{
"cell_type": "code",
 
 
"metadata": {
"deletable": false,
"scrolled": false,
"tags": [
"parameters"
]
},
"outputs": [],
"source": [
"circuit_type = '600A'\n",
" end_date_time='2021-01-31 00:00:00+01:00'), circuit_type=circuit_type)"
"fgc_pm_search = FgcPmSearchModuleMediator(DateTimeBaseModule(start_date_time='2021-01-26 00:00:00+01:00',\n",
" end_date_time='2021-01-31 00:00:00+01:00'), circuit_type=circuit_type)"
]
},
{
"cell_type": "markdown",
......@@ -125,14 +129,14 @@
},
"source": [
"# 2. Query All Signals Prior to Analysis"
]
},
 
 
 
 
"execution_count": null,
 
 
"deleteable": false,
"scrolled": false,
"tags": [
"skip_output"
]
......@@ -338,11 +342,11 @@
"metadata": {
"deletable": false
},
"outputs": [],
"source": [
" print('Circuit %s does not contain an EE system, analysis skipped.' % circuit_name)"
"if 'EE' in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_name):\n",
" analysis.analyze_u_dump_res_ee(circuit_name, timestamp_fgc, i_meas_df, u_dump_res_df, col_name='U_EE_max')\n",
"else:\n",
" print('Circuit %s does not contain an EE system, analysis skipped.' % circuit_name)"
]
},
......@@ -351,18 +355,19 @@
"execution_count": null,
"metadata": {
"deletable": false
},
"outputs": [],
"else:\n",
"source": [
"if 'EE' in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_name):\n",
" analysis.results_table['EE analysis'] = get_expert_decision('EE analysis: ', ['PASS', 'FAIL']) \n",
"else:\n",
},
" analysis.results_table['EE analysis'] = 'No EE'"
]
},
{
"deletable": false
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
"# 6. QDS\n",
......
......@@ -25,26 +25,27 @@
"- It is recommended to execute each cell one after another. However, since the signals are queried prior to an 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",
"\n",
"# Plot Convention\n",
"- Scales are labeled with signal name followed by a comma and a unit in the square bracket, e.g., I_MEAS, [A]\n",
"- If a reference signal is present, it is represented with a dashed line\n",
"- 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",
"- The grid comes from the left axis\n",
"- Title contains timestamp, circuit name, signal name allowing for re-access the signal.\n",
"- The plots assigned to the left scale got colors: blue (C0) and orange (C1). Plots presented on the right have colors red (C2) and green (C3).\n",
"- 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",
"- The grid comes from the left axis\n",
"- Title contains timestamp, circuit name, signal name allowing for re-access the signal.\n",
"- The plots assigned to the left scale got colors: blue (C0) and orange (C1). Plots presented on the right have colors red (C2) and green (C3).\n",
"- Each plot has an individual time-synchronization mentioned explicitly in the description.\n",
"- If an axis has a single signal, change color of the label to match the signal's color. Otherwise, the label color is black."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
},
"outputs": [],
"source": [
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
},
"outputs": [],
"source": [
"# External libraries\n",
"print('Loading (1/15)'); import pandas as pd\n",
"print('Loading (2/15)'); import numpy as np\n",
"print('Loading (3/15)'); import sys\n",
"print('Loading (4/15)'); from IPython.display import display, Javascript, clear_output, HTML\n",
"\n",
......@@ -62,11 +63,11 @@
"print('Loading (15/15)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType\n",
"\n",
"clear_output()\n",
"lhcsmapi.get_lhcsmapi_version()\n",
"lhcsmapi.get_lhcsmhwc_version('../__init__.py')"
]
 
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false
......@@ -78,14 +79,15 @@
{
"cell_type": "markdown",
"metadata": {
"deleteable": false,
"tags": [
"skip_cell"
]
},
"source": [
"skip_cell"
]
},
"source": [
"In order to perform the analysis of a FPA in an IPQ circuit please:\n",
"1. Select circuit name prefix (e.g., RQ5)\n",
"2. Choose start and end time\n",
"3. Choose analysis mode (Automatic by default)\n",
"\n",
"Once these inputs are provided, click 'Find FGC PM entries' button. This will trigger a search of the PM database in order to provide a list of timestamps of FGC events associated with the selected circuit name for the provided period of time. Select one timestamp from the 'FGC PM Entries' list to be processed by the following cells.\n",
......@@ -170,11 +172,11 @@
"metadata": {
"deletable": false
},
"source": [
"# 4. PC\n",
"- calculation of the ramp rate\n",
"## 4.1. Main Current\n",
"\n",
"*ANALYSIS*: \n",
"- calculation of the ramp rate\n",
"- calculation of the duration of a plateau prior to a quench\n",
"- calculation of DCCT MIIts\n",
......@@ -182,18 +184,19 @@
"**You may manually adjust the automatically calculated quench start by clicking the right button on a mouse of a plot with current zoom.**\n",
"\n",
"*GRAPHS*: \n",
"- t = 0 s corresponds to the FGC timestamp\n",
"- one plot for each power converter"
"cell_type": "code",
]
},
{
"cell_type": "code",
"deletable": false
 
"metadata": {
"deletable": false
},
"import matplotlib as mpl\n",
 
"source": [
"import matplotlib as mpl\n",
"mpl.rcParams['savefig.dpi'] = 80\n",
"mpl.rcParams['figure.dpi'] = 80\n",
"%matplotlib notebook\n",
......
......@@ -26,26 +26,27 @@
"- It is recommended to execute each cell one after another. However, since the signals are queried prior to an 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",
"\n",
"# Plot Convention\n",
"- Scales are labeled with signal name followed by a comma and a unit in the square bracket, e.g., I_MEAS, [A]\n",
"- If a reference signal is present, it is represented with a dashed line\n",
"- 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",
"- The grid comes from the left axis\n",
"- Title contains timestamp, circuit name, signal name allowing for re-access the signal.\n",
"- The plots assigned to the left scale got colors: blue (C0) and orange (C1). Plots presented on the right have colors red (C2) and green (C3).\n",
"- 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",
"- The grid comes from the left axis\n",
"- Title contains timestamp, circuit name, signal name allowing for re-access the signal.\n",
"- The plots assigned to the left scale got colors: blue (C0) and orange (C1). Plots presented on the right have colors red (C2) and green (C3).\n",
"- Each plot has an individual time-synchronization mentioned explicitly in the description.\n",
"- If an axis has a single signal, change color of the label to match the signal's color. Otherwise, the label color is black."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
},
"outputs": [],
"source": [
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
},
"outputs": [],
"source": [
"# External libraries\n",
"print('Loading (1/15)'); import pandas as pd\n",
"print('Loading (2/15)'); import numpy as np\n",
"print('Loading (3/15)'); import sys\n",
"print('Loading (4/15)'); from IPython.display import display, Javascript, clear_output, HTML\n",
"\n",
......@@ -63,30 +64,42 @@