Commit e84cd9b8 authored by Michal Maciejewski's avatar Michal Maciejewski
Browse files

Added plots of PIC2 current profiles

parent 3b7773c7
......@@ -9,11 +9,10 @@
"Figure below shows a generic circuit diagram, equipped with EE and parallel resistor, as well as lead resistances and a quench resistance.\n",
"\n",
"<img src=\"https://gitlab.cern.ch/LHCData/lhc-sm-hwc/-/raw/master/figures/600A/600A_without_EE.png\" width=75%>\n",
"source: Test Procedure and Acceptance Criteria for the 600 A Circuits, MP3 Procedure, <a href=\"https://edms.cern.ch/document/874716/5.3\">https://edms.cern.ch/document/874716/5.3</a>"
]
},
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
......@@ -31,41 +30,33 @@
"- 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",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 0. Initialise Working Environment"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"deletable": false,
"editable": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Analysis executed with lhcsmapi version: 1.3.323\n",
"Analysis executed with lhc-sm-hwc notebooks version: 1.1.0\n"
]
}
],
"source": [
"import io\n",
"import re\n",
"import sys\n",
"import pandas as pd\n",
"import numpy as np\n",
"from datetime import datetime\n",
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 0. Initialise Working Environment"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"editable": 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",
"# Internal libraries\n",
"print('Loading (5/15)'); import lhcsmapi\n",
"print('Loading (6/15)'); from lhcsmapi.Time import Time\n",
"print('Loading (7/15)'); from lhcsmapi.Timer import Timer\n",
"print('Loading (8/15)'); from lhcsmapi.analysis.R600ACircuitQuery import R600ACircuitQuery\n",
"print('Loading (9/15)'); from lhcsmapi.analysis.R600ACircuitAnalysis import R600ACircuitAnalysis\n",
"print('Loading (10/15)'); from lhcsmapi.analysis.expert_input import get_expert_decision\n",
......@@ -86,16 +77,10 @@
"metadata": {},
"source": [
"# 1. Select FGC Post Mortem Entry"
]
},
" print('Analysis executed with lhc-sm-hwc notebooks version: {}'.format(version))"
]
},
{
"cell_type": "markdown",
"metadata": {},
{
"cell_type": "markdown",
"metadata": {
"tags": [
"skip_cell"
......@@ -110,16 +95,14 @@
"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",
"\n",
"**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.**"
]
},
"\n",
"**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",
"execution_count": null,
{
"cell_type": "code",
"metadata": {
"deletable": false,
"editable": false,
"scrolled": false
},
"outputs": [],
......@@ -136,17 +119,15 @@
]
},
{
"cell_type": "code",
"execution_count": null,
},
{
"metadata": {
"editable": false,
"tags": [
"skip_output"
"Selected FGC PM event RCBXV1.R1: 2017-04-26 17:07:49.220000+02:00; RCBXH1.R1: 2017-04-26 17:07:49.240000+02:00.\n",
"The analysis is executed in Automatic mode.\n",
]
},
"outputs": [],
"source": [
"with Timer():\n",
" author = fgc_pm_search.get_author()\n",
......@@ -195,22 +176,10 @@
"\n",
" u_hts_leads_rcbxh_dfs = query_rcbxh.query_leads(timestamp_fgc_rcbxh, source_timestamp_leads_rcbxh_df, system=leads_name, signal_names=['U_HTS'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
" u_res_leads_rcbxh_dfs = query_rcbxh.query_leads(timestamp_fgc_rcbxh, source_timestamp_leads_rcbxh_df, system=leads_name, signal_names=['U_RES'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
"\n",
" # # RCBXV\n",
"fgc_pm_search = FgcPmSearchModuleMediator(DateTimeBaseModule(start_date_time='2017-04-26 00:00:00+01:00',\n",
" end_date_time='2017-04-28 00:00:00+01:00'), R600ARcbxhvFgcPmSearchBaseModule(), circuit_type='600A_RCBXHV')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 2. Query All Signals Prior to Analysis"
]
},
{
" leads_name = [x for x in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_names[1]) if 'LEADS' in x][0]\n",
" source_timestamp_leads_rcbxv_df = query_rcbxv.find_timestamp_leads(timestamp_fgc_rcbxv, leads_name)\n",
"\n",
" u_hts_leads_rcbxv_dfs = query_rcbxv.query_leads(timestamp_fgc_rcbxv, source_timestamp_leads_rcbxv_df, system=leads_name, signal_names=['U_HTS'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
" u_res_leads_rcbxv_dfs = query_rcbxv.query_leads(timestamp_fgc_rcbxv, source_timestamp_leads_rcbxv_df, system=leads_name, signal_names=['U_RES'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
......@@ -221,10 +190,15 @@
"analysis_rcbxv = R600ACircuitAnalysis(circuit_type, results_table, is_automatic=is_automatic)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 3. Timestamps\n",
"\n",
"The analysis for MP3 consists of checking the existence of PM file and of consistency of the PM timestamps (PC, QPS). The criterion of passing this test described in detail in 600APIC2.\n",
"In short the following criteria should be checked:\n",
"\n",
"- 2 PM DQAMGNA (A+B) files and 1 PM EE file should be generated for 600 A circuits with EE\n",
"- Difference between QPS board A and B timestamp = 1 ms\n",
"- PC timestamp is QPS timestamp +/- 20 ms\n",
......@@ -265,17 +239,10 @@
"- calculation of the quench current\n",
"- calculation of the duration of a plateau / the ramp rate before a quench (based on PM event buffer)\n",
"\n",
"*GRAPHS*:\n",
"- dashed blue line denotes the start of a quench (I_A starts to deviate from I_REF)\n",
" source_timestamp_leads_rcbxh_df = query_rcbxh.find_timestamp_leads(timestamp_fgc_rcbxh, leads_name)\n",
"\n",
" u_hts_leads_rcbxh_dfs = query_rcbxh.query_leads(timestamp_fgc_rcbxh, source_timestamp_leads_rcbxh_df, system=leads_name, signal_names=['U_HTS'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
" u_res_leads_rcbxh_dfs = query_rcbxh.query_leads(timestamp_fgc_rcbxh, source_timestamp_leads_rcbxh_df, system=leads_name, signal_names=['U_RES'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
"\n",
" # # RCBXV\n",
" leads_name = [x for x in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_names[1]) if 'LEADS' in x][0]\n",
"- t = 0 s corresponds to the FGC timestamp"
]
},
{
"cell_type": "code",
......@@ -312,20 +279,10 @@
]
},
{
"cell_type": "code",
"execution_count": null,
" 'QDS_A_RCBXV':source_timestamp_qds_rcbxv_df.loc[0, 'timestamp'] if len(source_timestamp_qds_rcbxv_df) > 0 else np.nan, \n",
" 'QDS_B_RCBXV':source_timestamp_qds_rcbxv_df.loc[1, 'timestamp'] if len(source_timestamp_qds_rcbxv_df) > 1 else np.nan}\n",
"\n",
"analysis_rcbxh.create_timestamp_table(timestamp_dct, circuit_name=circuit_names[0])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"metadata": {
"deletable": false,
"editable": false
},
"outputs": [],
......@@ -369,21 +326,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4.2. Earth Current\n",
"\n",
"scrolled": false
},
"outputs": [],
"source": [
"analysis_rcbxh.plot_i_meas_pc_zoom(circuit_names[0], timestamp_fgc_rcbxh, t_quench, [i_meas_rcbxh_df, i_a_rcbxh_df, i_ref_rcbxh_df], xlim=(t_quench-0.1, t_quench+0.1))\n",
"\n",
"analysis_rcbxh.analyze_i_meas_pc_trigger(timestamp_fgc_rcbxh, events_action_rcbxh_df, events_symbol_rcbxh_df)\n",
"analysis_rcbxh.calculate_current_miits(i_meas_rcbxh_df, t_quench, col_name='I_MEAS MIITs H')\n",
"analysis_rcbxh.calculate_quench_current(i_meas_rcbxh_df, t_quench, col_name='I_Q_H')\n",
"analysis_rcbxh.calculate_current_slope(i_meas_rcbxh_df, col_name=['Ramp Rate H', 'Plateau Duration H'])"
]
"*ANALYSIS*:\n",
"- calculation of the maximum absolute earth current (maintaining the sign)\n",
"\n",
"*GRAPHS*:\n",
"- t = 0 s corresponds to the FGC timestamp"
......@@ -405,19 +351,10 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
"analysis_rcbxv.plot_i_meas_pc_zoom(circuit_names[1], timestamp_fgc_rcbxv, t_quench, [i_meas_rcbxv_df, i_a_rcbxv_df, i_ref_rcbxv_df], xlim=(t_quench-0.1, t_quench+0.1))\n",
"\n",
"analysis_rcbxv.analyze_i_meas_pc_trigger(timestamp_fgc_rcbxv, events_action_rcbxv_df, events_symbol_rcbxv_df)\n",
"analysis_rcbxv.calculate_current_miits(i_meas_rcbxv_df, t_quench, col_name='I_MEAS MIITs V')\n",
"analysis_rcbxv.calculate_quench_current(i_meas_rcbxv_df, t_quench, col_name='I_Q_V')\n",
"analysis_rcbxv.calculate_current_slope(i_meas_rcbxv_df, col_name=['Ramp Rate V', 'Plateau Duration V'])"
]
},
{
"editable": false
},
"outputs": [],
"source": [
"analysis_rcbxv.plot_i_earth_pc(circuit_names[1], timestamp_fgc_rcbxv, i_earth_rcbxv_df)\n",
......@@ -464,32 +401,33 @@
"deletable": false,
"editable": false
},
"outputs": [],
"source": [
},
"outputs": [],
"analysis_rcbxh.plot_u_res(circuit_names[0], timestamp_qds_rcbxh, u_res_nxcals_rcbxh_df, i_meas_nxcals_rcbxh_df)"
"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='Earth Current V')"
]
},
{
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
"editable": false
},
"outputs": [],
"source": [
"u_res_rcbxh_slope_df = analysis_rcbxh.calculate_u_res_slope(u_res_rcbxh_df, col_name='dUres/dt H')\n",
"analysis_rcbxh.plot_u_res_slope(circuit_names[0], timestamp_qds_rcbxh, u_res_rcbxh_df, u_res_rcbxh_slope_df)"
]
"U_{\\text{RES}} = U_{\\text{DIFF}} + L d/dt (I+U_{\\text{DIFF}}/R).\n",
 
},
 
"cell_type": "code",
"execution_count": null,
"metadata": {
"\n",
"<img src=\"https://gitlab.cern.ch/LHCData/lhc-sm-hwc/-/raw/master/figures/600A/600A_without_EE.png\" width=75%>\n",
"deletable": false,
"editable": false
},
"outputs": [],
"source": [
"analysis_rcbxv.plot_u_res(circuit_names[1], timestamp_qds_rcbxv, u_res_nxcals_rcbxv_df, i_meas_nxcals_rcbxv_df)"
]
},
......
......@@ -9,11 +9,10 @@
"source": [
"<h1><center>Analysis of an FPA in an 600A Circuit - RCD-RCO Family</center></h1>\n",
"\n",
"Figure below shows a generic circuit diagram, equipped with parallel resistance, as well as lead resistances and a quench resistance.\n",
"\n",
"<img src=\"https://gitlab.cern.ch/LHCData/lhc-sm-hwc/-/raw/master/figures/600A/600A_without_EE.png\" width=75%>\n",
"<img src=\"https://gitlab.cern.ch/LHCData/lhc-sm-hwc/-/raw/master/figures/600A/600A_without_EE.png\" width=75%>\n",
"source: Test Procedure and Acceptance Criteria for the 600 A Circuits, MP3 Procedure, <a href=\"https://edms.cern.ch/document/874716/5.3\">https://edms.cern.ch/document/874716/5.3</a>"
]
},
{
......@@ -29,41 +28,33 @@
"# Plot Convention\n",
"- 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",
"- 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 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."
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false,
"editable": false
},
"source": [
"# 0. Initialise Working Environment"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
"editable": false
},
"outputs": [],
"source": [
"import io\n",
"import re\n",
"import sys\n",
"import pandas as pd\n",
"import numpy as np\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."
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false,
"editable": false
},
"source": [
"# 0. Initialise Working Environment"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"editable": 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",
......@@ -187,22 +178,10 @@
" # QDS PM\n",
" # # RCD\n",
" source_timestamp_qds_rcd_df = query_rcd.find_source_timestamp_qds(timestamp_fgc_rcd, duration=[(2, 's'), (2, 's')])\n",
" timestamp_qds_rcd = np.nan if source_timestamp_qds_rcd_df.empty else source_timestamp_qds_rcd_df.loc[0, 'timestamp']\n",
" i_dcct_rcd_df, i_didt_rcd_df, u_res_rcd_df, u_diff_rcd_df = query_rcd.query_qds_pm(timestamp_qds_rcd, timestamp_qds_rcd, \n",
" timestamp_qds_rcd = np.nan if source_timestamp_qds_rcd_df.empty else source_timestamp_qds_rcd_df.loc[0, 'timestamp']\n",
" i_dcct_rcd_df, i_didt_rcd_df, u_res_rcd_df, u_diff_rcd_df = query_rcd.query_qds_pm(timestamp_qds_rcd, timestamp_qds_rcd, \n",
" signal_names=['I_DCCT', 'I_DIDT', 'U_RES', 'U_DIFF'])\n",
" # # RCO\n",
" source_timestamp_qds_rco_df = query_rco.find_source_timestamp_qds(timestamp_fgc_rco, duration=[(2, 's'), (2, 's')])\n",
" timestamp_qds_rco = np.nan if source_timestamp_qds_rco_df.empty else source_timestamp_qds_rco_df.loc[0, 'timestamp']\n",
" i_dcct_rco_df, i_didt_rco_df, u_res_rco_df, u_diff_rco_df = query_rco.query_qds_pm(timestamp_qds_rco, timestamp_qds_rco, \n",
" signal_names=['I_DCCT', 'I_DIDT', 'U_RES', 'U_DIFF'])\n",
" # LEADS\n",
" # # RCD\n",
" leads_name = [x for x in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_names[0]) if 'LEADS' in x][0]\n",
" source_timestamp_leads_rcd_df = query_rcd.find_timestamp_leads(timestamp_fgc_rcd, leads_name)\n",
" signal_names=['I_DCCT', 'I_DIDT', 'U_RES', 'U_DIFF'])\n",
" # # RCO\n",
" source_timestamp_qds_rco_df = query_rco.find_source_timestamp_qds(timestamp_fgc_rco, duration=[(2, 's'), (2, 's')])\n",
" timestamp_qds_rco = np.nan if source_timestamp_qds_rco_df.empty else source_timestamp_qds_rco_df.loc[0, 'timestamp']\n",
" i_dcct_rco_df, i_didt_rco_df, u_res_rco_df, u_diff_rco_df = query_rco.query_qds_pm(timestamp_qds_rco, timestamp_qds_rco, \n",
......@@ -213,10 +192,15 @@
" source_timestamp_leads_rcd_df = query_rcd.find_timestamp_leads(timestamp_fgc_rcd, leads_name)\n",
"\n",
" u_hts_leads_rcd_dfs = query_rcd.query_leads(timestamp_fgc_rcd, source_timestamp_leads_rcd_df, system=leads_name, signal_names=['U_HTS'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
" u_res_leads_rcd_dfs = query_rcd.query_leads(timestamp_fgc_rcd, source_timestamp_leads_rcd_df, system=leads_name, signal_names=['U_RES'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
"\n",
" # # RCO\n",
" leads_name = [x for x in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_names[1]) if 'LEADS' in x][0]\n",
" source_timestamp_leads_rco_df = query_rco.find_timestamp_leads(timestamp_fgc_rco, leads_name)\n",
"\n",
" u_hts_leads_rco_dfs = query_rco.query_leads(timestamp_fgc_rco, source_timestamp_leads_rco_df, system=leads_name, signal_names=['U_HTS'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
" u_res_leads_rco_dfs = query_rco.query_leads(timestamp_fgc_rco, source_timestamp_leads_rco_df, system=leads_name, signal_names=['U_RES'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
"\n",
" # Create results table - RCD/O\n",
" results_table = query_rcd.create_report_analysis_template_rcd(timestamp_fgc_rcd, timestamp_fgc_rco, circuit_names, author=author)\n",
" analysis_rcd = R600ACircuitAnalysis(circuit_type, results_table, is_automatic=is_automatic)\n",
......@@ -257,17 +241,10 @@
" 'QDS_B_RCD':source_timestamp_qds_rcd_df.loc[1, 'timestamp'] if len(source_timestamp_qds_rcd_df) > 1 else np.nan,\n",
" 'QDS_A_RCO':source_timestamp_qds_rco_df.loc[0, 'timestamp'] if len(source_timestamp_qds_rco_df) > 0 else np.nan, \n",
" 'QDS_B_RCO':source_timestamp_qds_rco_df.loc[1, 'timestamp'] if len(source_timestamp_qds_rco_df) > 1 else np.nan}\n",
"\n",
"analysis_rcd.create_timestamp_table(timestamp_dct, circuit_names[0])"
"deletable": false
},
"source": [
"# 4. PC\n",
"## 4.1. Main Current\n",
"\n",
"*QUERY*: \n",
]
},
{
"cell_type": "markdown",
"metadata": {
......@@ -307,20 +284,10 @@
"analysis_rcd.plot_i_meas_pc(circuit_names[0], timestamp_fgc_rcd, [i_meas_rcd_df, i_a_rcd_df, i_ref_rcd_df], xlim=(t_quench-1, t_quench+1))"
]
},
{
"cell_type": "code",
},
"outputs": [],
"source": [
"analysis_rcd.plot_i_meas_pc_zoom(circuit_names[0], timestamp_fgc_rcd, t_quench, [i_meas_rcd_df, i_a_rcd_df, i_ref_rcd_df], xlim=(t_quench-0.1, t_quench+0.1))\n",
"\n",
"analysis_rcd.analyze_i_meas_pc_trigger(timestamp_fgc_rcd, events_action_rcd_df, events_symbol_rcd_df)\n",
"analysis_rcd.calculate_current_miits(i_meas_rcd_df, t_quench, col_name='I_MEAS MIITs RCD')\n",
"analysis_rcd.calculate_quench_current(i_meas_rcd_df, t_quench, col_name='I_Q_RCD')\n",
"analysis_rcd.calculate_current_slope(i_meas_rcd_df, col_name=['Ramp Rate RCD', 'Plateau Duration RCD'])"
]
"execution_count": null,
"metadata": {
"deletable": false,
"editable": false
},
......@@ -354,21 +321,10 @@
"metadata": {
"deletable": false,
"editable": false
},
"outputs": [],
"editable": false,
"scrolled": false
},
"outputs": [],
"source": [
"analysis_rcd.results_table[['Circuit Name', 'Date', 'Time', 'I_Q_RCD', 'I_Q_RCO', 'I_MEAS MIITs RCD', 'I_MEAS MIITs RCO', 'Ramp Rate RCD', 'Ramp Rate RCO', 'Plateau Duration RCD', 'Plateau Duration RCO']]"
]
},
{
"cell_type": "markdown",
"metadata": {
"source": [
"analysis_rco.plot_i_meas_pc_zoom(circuit_names[1], timestamp_fgc_rco, t_quench, [i_meas_rco_df, i_a_rco_df, i_ref_rco_df], xlim=(t_quench-0.1, t_quench+0.1))\n",
"\n",
"analysis_rco.analyze_i_meas_pc_trigger(timestamp_fgc_rco, events_action_rco_df, events_symbol_rco_df)\n",
"analysis_rco.calculate_current_miits(i_meas_rco_df, t_quench, col_name='I_MEAS MIITs RCO')\n",
......@@ -390,19 +346,10 @@
]
},
{
"cell_type": "markdown",
"metadata": {
},
"outputs": [],
"source": [
"analysis_rcd.plot_i_earth_pc(circuit_names[0], timestamp_fgc_rcd, i_earth_rcd_df)\n",
"analysis_rcd.calculate_max_i_earth_pc(i_earth_rcd_df, col_name='Earth Current RCD')"
]
},
{
"cell_type": "code",
"deletable": false
},
"source": [
"## 4.2. Earth Current\n",
"\n",
......@@ -448,32 +395,33 @@
"# 5. QDS\n",
"\n",
"The quench voltage U_RES is calculated according to the following formula:\n",
"\n",
"\\begin{equation}\n",
"\n",
"Note that **rc** in the table above denotes RCD and RCO, i.e., there are two signals for each circuit.\n",
"U_{\\text{RES}} = U_{\\text{DIFF}} + L d/dt (I+U_{\\text{DIFF}}/R).\n",
"*ANALYSIS*: \n",
"- Check if the U_RES signal before a quench is increasing for at least one board, which would indicate a QPS trip\n",
"\\end{equation}\n",
"\n",
"*GRAPHS*:\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",
"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",
"- t = 0 s corresponds to the FGC timestamp\n",
"<img src=\"https://gitlab.cern.ch/LHCData/lhc-sm-hwc/-/raw/master/figures/600A/600A_without_EE.png\" width=75%>\n",
"\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."
]
},
{
"cell_type": "markdown",
"metadata": {
{
 
"deletable": false
 
"source": [
"## 5.1. Resistive Voltage\n",
"\n",
"editable": false
},
"*ANALYSIS*: \n",
"- Check if the U_RES signal before a quench is increasing for at least one board, which would indicate a QPS trip\n",
"- Calculate the initial voltage slope of U_RES signal. The slope is calculated as a ratio of the voltage change from 50 to 200 mV and the corresponding time change.\n",
"\n",
"*GRAPHS*:\n",
"First plot (U_RES and I_MEAS prior to a quench)\n",
"- t = 0 s corresponds to the FGC timestamp\n",
"\n",
......
......@@ -9,11 +9,10 @@
"source": [
"<h1><center>Analysis of an FPA in an 600A Circuit - with/without Energy Extraction</center></h1>\n",
"\n",
"Figure 1 shows a generic circuit diagram, equipped with EE and parallel resistor, as well as lead resistances and a quench resistance.\n",
"\n",
"<img src=\"https://gitlab.cern.ch/LHCData/lhc-sm-hwc/-/raw/master/figures/600A/600A.png\" width=75%>\n",
"<img src=\"https://gitlab.cern.ch/LHCData/lhc-sm-hwc/-/raw/master/figures/600A/600A.png\" width=75%>\n",
"source: Test Procedure and Acceptance Criteria for the 600 A Circuits, MP3 Procedure, <a href=\"https://edms.cern.ch/document/874716/5.3\">https://edms.cern.ch/document/874716/5.3</a>"
]
},
{
......@@ -29,41 +28,33 @@
"# Plot Convention\n",
"- 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",
"- 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 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."
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false,
"editable": false
},
"source": [
"# 0. Initialise Working Environment"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
"editable": false
},
"outputs": [],
"source": [
"import io\n",
"import re\n",
"import sys\n",
"import pandas as pd\n",
"import numpy as np\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."
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false,
"editable": false
},
"source": [
"# 0. Initialise Working Environment"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"editable": 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",
......@@ -167,20 +158,10 @@
"\n",
" # PIC\n",
" timestamp_pic = query.find_timestamp_pic(timestamp_fgc, spark=spark)\n",
"\n",
" # EE\n",
"\n",
" # EE\n",
" if 'EE' in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_name):\n",
" query.max_executions += 2\n",
" source_timestamp_ee_df = query.find_source_timestamp_ee(timestamp_fgc)\n",
" timestamp_ee = source_timestamp_ee_df.loc[0, 'timestamp']\n",
" u_dump_res_df = query.query_ee_u_dump_res_pm(timestamp_ee, timestamp_fgc, system='EE', signal_names=['U_DUMP_RES'])[0]\n",
" else:\n",
" source_timestamp_ee_df = pd.DataFrame()\n",
" results_table['EE max voltage'] = 'No EE'\n",
" if 'EE' in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_name):\n",
" query.max_executions += 2\n",
" source_timestamp_ee_df = query.find_source_timestamp_ee(timestamp_fgc)\n",
" timestamp_ee = source_timestamp_ee_df.loc[0, 'timestamp']\n",
" u_dump_res_df = query.query_ee_u_dump_res_pm(timestamp_ee, timestamp_fgc, system='EE', signal_names=['U_DUMP_RES'])[0]\n",
......@@ -191,10 +172,15 @@
" # QDS\n",
" # To check if there was any drift of QDS cards prior to the trigger\n",
" i_meas_nxcals_df = query.query_pc_nxcals(timestamp_fgc, signal_names=['I_MEAS'], spark=spark)[0]\n",
" u_res_nxcals_df = query.query_iqps_nxcals(timestamp_fgc, signal_names=['U_RES'], spark=spark)[0]\n",
"\n",
" source_timestamp_qds_df = query.find_source_timestamp_qds(timestamp_fgc, duration=[(2, 's'), (2, 's')])\n",
" timestamp_qds = np.nan if source_timestamp_qds_df.empty else source_timestamp_qds_df.loc[0, 'timestamp']\n",
" i_dcct_df, i_didt_df, u_res_df, u_diff_df = query.query_qds_pm(timestamp_qds, timestamp_qds, signal_names=['I_DCCT', 'I_DIDT', 'U_RES', 'U_DIFF'])\n",
"\n",
" # LEADS\n",
" leads_name = [x for x in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_name) if 'LEADS' in x][0]\n",
" source_timestamp_leads_df = query.find_timestamp_leads(timestamp_fgc, leads_name)\n",
"\n",
" u_hts_leads_dfs = query.query_leads(timestamp_fgc, source_timestamp_leads_df, system=leads_name, signal_names=['U_HTS'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
" u_res_leads_dfs = query.query_leads(timestamp_fgc, source_timestamp_leads_df, system=leads_name, signal_names=['U_RES'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
......@@ -210,15 +196,10 @@
},
"source": [
"# 3. Timestamps\n",</