Commit 1baaabba authored by thbuffet's avatar thbuffet
Browse files

update AN_RB_PLI3.d2

parent 0890fb85
Pipeline #2452299 passed with stage
in 24 seconds
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
<h1><center>Analysis of PLI3.d2 HWC Test in an RB Circuit</center></h1> <h1><center>Analysis of PLI3.d2 HWC Test in an RB Circuit</center></h1>
<img src="https://gitlab.cern.ch/LHCData/lhc-sm-hwc/raw/master/figures/rb/RB.png" width=75%> <img src="https://gitlab.cern.ch/LHCData/lhc-sm-hwc/raw/master/figures/rb/RB.png" width=75%>
The circuit is powered up to I_INTERM_2. After a short plateau a powering failure is simulated by the power converter. After a minute the EE system is activated by a quench simulation in a current lead. The circuit is powered up to I_INTERM_2. After a short plateau a powering failure is simulated by the power converter. After a minute the EE system is activated by a quench simulation in a current lead.
The aim of this test is to verify the correct functionality of the PC when a powering failure is generated. The aim of this test is to verify the correct functionality of the PC when a powering failure is generated.
<img src="https://gitlab.cern.ch/LHCData/lhc-sm-hwc/raw/master/figures/rb/PLI3_current.png" width=50%> <img src="https://gitlab.cern.ch/LHCData/lhc-sm-hwc/raw/master/figures/rb/PLI3_current.png" width=50%>
The required analysis and signatures are listed below. The required analysis and signatures are listed below.
|Responsible|Type of analysis|Criterion| |Responsible|Type of analysis|Criterion|
|-----------|----------------|---------| |-----------|----------------|---------|
|PC|PC voltage check|PC voltage ~ -1.5 V ± 0.5 V, 1 s after the EE activation. The current decay time constant should be within 20% of Decay_Time_const. Smooth exponential waveform on the PC voltage and current during the whole decay| |PC|PC voltage check|PC voltage ~ -1.5 V ± 0.5 V, 1 s after the EE activation. The current decay time constant should be within 20% of Decay_Time_const. Smooth exponential waveform on the PC voltage and current during the whole decay|
|PC|Earth Current Analysis|The maximum earth current <50 mA during EE activation disregarding the peak at the opening of the EE system.| |PC|Earth Current Analysis|The maximum earth current <50 mA during EE activation disregarding the peak at the opening of the EE system.|
|EE|Energy discharge|Maximum voltage on EE resistance ($R*I$±10%) and maximum temperature of the EE resistance (±10% from theoretical value)| |EE|Energy discharge|Maximum voltage on EE resistance ($R*I$±10%) and maximum temperature of the EE resistance (±10% from theoretical value)|
|EE|Energy discharge|Time delay on switch opening (300±50ms at odd point and 600±50ms at even point)| |EE|Energy discharge|Time delay on switch opening (300±50ms at odd point and 600±50ms at even point)|
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> 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>
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# Analysis Assumptions # Analysis Assumptions
- 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. - 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.
- 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). - 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).
# Plot Convention # Plot Convention
- Scales are labeled with signal name followed by a comma and a unit in square brackets, e.g., I_MEAS, [A]. - Scales are labeled with signal name followed by a comma and a unit in square brackets, e.g., I_MEAS, [A].
- If a reference signal is present, it is represented with a dashed line. - If a reference signal is present, it is represented with a dashed line.
- 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. - 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.
- The grid comes from the left axis. - The grid comes from the left axis.
- The title contains timestamp, circuit name, and signal name allowing to re-access the signal. - The title contains timestamp, circuit name, and signal name allowing to re-access the signal.
- 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). - 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).
- Each plot has an individual time-synchronization mentioned explicitly in the description. - Each plot has an individual time-synchronization mentioned explicitly in the description.
- If an axis has a single signal, then the color of the label matches the signal's color. Otherwise, the label color is black. - 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 id: tags: %% Cell type:markdown id: tags:
# 0. Initialise Working Environment # 0. Initialise Working Environment
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
# External libraries # External libraries
print('Loading (1/11)'); import sys; import pandas as pd print('Loading (1/11)'); import sys; import pandas as pd
print('Loading (2/11)'); from IPython.display import display, Javascript, clear_output print('Loading (2/11)'); from IPython.display import display, Javascript, clear_output
# Internal libraries # Internal libraries
print('Loading (3/11)'); import lhcsmapi print('Loading (3/11)'); import lhcsmapi
print('Loading (4/11)'); from lhcsmapi.Time import Time print('Loading (4/11)'); from lhcsmapi.Time import Time
print('Loading (5/11)'); from lhcsmapi.Timer import Timer print('Loading (5/11)'); from lhcsmapi.Timer import Timer
print('Loading (6/11)'); from lhcsmapi.analysis.RbCircuitQuery import RbCircuitQuery print('Loading (6/11)'); from lhcsmapi.analysis.RbCircuitQuery import RbCircuitQuery
print('Loading (7/11)'); from lhcsmapi.analysis.RbCircuitAnalysis import RbCircuitAnalysis print('Loading (7/11)'); from lhcsmapi.analysis.RbCircuitAnalysis import RbCircuitAnalysis
print('Loading (8/11)'); from lhcsmapi.analysis.report_template import apply_report_template print('Loading (8/11)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (9/11)'); from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator print('Loading (9/11)'); from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator
print('Loading (10/11)'); from lhcsmapi.pyedsl.PlotBuilder import create_hwc_plot_title_with_circuit_name print('Loading (10/11)'); from lhcsmapi.pyedsl.PlotBuilder import create_hwc_plot_title_with_circuit_name
print('Loading (11/11)'); from lhcsmapi.analysis.expert_input import get_expert_decision print('Loading (11/11)'); from lhcsmapi.analysis.expert_input import get_expert_decision
clear_output() clear_output()
lhcsmapi.get_lhcsmapi_version() lhcsmapi.get_lhcsmapi_version()
lhcsmapi.get_lhcsmhwc_version('../__init__.py') lhcsmapi.get_lhcsmhwc_version('../__init__.py')
print('Analysis performed by %s' % HwcSearchModuleMediator.get_user()) print('Analysis performed by %s' % HwcSearchModuleMediator.get_user())
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# 1. User Input # 1. User Input
1. Copy code from AccTesting and paste into an empty cell below 1. Copy code from AccTesting and paste into an empty cell below
<img src="https://gitlab.cern.ch/LHCData/lhc-sm-hwc/-/raw/master/figures/swan-manual-acctesting-integration.png"> <img src="https://gitlab.cern.ch/LHCData/lhc-sm-hwc/-/raw/master/figures/swan-manual-acctesting-integration.png">
- 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 - 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
``` ```
hwc_test = 'PLI3.d2' hwc_test = 'PLI3.d2'
circuit_name = 'RB.A12' circuit_name = 'RB.A12'
campaign = 'HWC_2017' campaign = 'HWC_2017'
t_start = '2017-04-22 13:22:37.202' t_start = '2017-04-22 13:22:37.202'
t_end = '2017-04-22 14:01:44.575' t_end = '2017-04-22 14:01:44.575'
``` ```
2. To analyze a historical test with a browser GUI, copy and execute the following code in the cell below 2. To analyze a historical test with a browser GUI, copy and execute the following code in the cell below
``` ```
circuit_type = 'RB' circuit_type = 'RB'
hwc_test = 'PLI3.d2' hwc_test = 'PLI3.d2'
hwcb = HwcSearchModuleMediator(circuit_type=circuit_type, hwc_test=hwc_test, hwc_summary_path='/eos/project/l/lhcsm/hwc/HWC_Summary.csv') hwcb = HwcSearchModuleMediator(circuit_type=circuit_type, hwc_test=hwc_test, hwc_summary_path='/eos/project/l/lhcsm/hwc/HWC_Summary.csv')
``` ```
- 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 - 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
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
hwc_test = 'PLI3.d2' hwc_test = 'PLI3.d2'
circuit_name = 'RB.A34' circuit_name = 'RB.A34'
campaign= 'Recommissioning post LS2' campaign= 'Recommissioning post LS2'
t_start = '2021-03-24 22:19:06.563000000' t_start = '2021-03-24 22:19:06.563000000'
t_end = '2021-03-24 22:44:23.159000000' t_end = '2021-03-24 22:44:23.159000000'
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
print('hwc_test = \'%s\'\ncircuit_name = \'%s\'\ncampaign = \'%s\'\nt_start = \'%s\'\nt_end = \'%s\'' % (hwc_test, circuit_name, campaign, t_start, t_end)) print('hwc_test = \'%s\'\ncircuit_name = \'%s\'\ncampaign = \'%s\'\nt_start = \'%s\'\nt_end = \'%s\'' % (hwc_test, circuit_name, campaign, t_start, t_end))
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# 2. Query All Signals Prior to Analysis # 2. Query All Signals Prior to Analysis
%% Cell type:code id: tags:skip_output %% Cell type:code id: tags:skip_output
``` python ``` python
circuit_type = 'RB' circuit_type = 'RB'
if 'hwcb' in locals(): if 'hwcb' in locals():
circuit_name = hwcb.get_circuit_name() circuit_name = hwcb.get_circuit_name()
t_start = Time.to_unix_timestamp(hwcb.get_start_time()) t_start = Time.to_unix_timestamp(hwcb.get_start_time())
t_end = Time.to_unix_timestamp(hwcb.get_end_time()) t_end = Time.to_unix_timestamp(hwcb.get_end_time())
t_start_ref = Time.to_unix_timestamp(hwcb.get_ref_start_time()) t_start_ref = Time.to_unix_timestamp(hwcb.get_ref_start_time())
t_end_ref = Time.to_unix_timestamp(hwcb.get_ref_end_time()) t_end_ref = Time.to_unix_timestamp(hwcb.get_ref_end_time())
is_automatic = hwcb.is_automatic_mode() is_automatic = hwcb.is_automatic_mode()
else: else:
t_start = Time.to_unix_timestamp(t_start) t_start = Time.to_unix_timestamp(t_start)
t_end = Time.to_unix_timestamp(t_end) t_end = Time.to_unix_timestamp(t_end)
t_start_ref, t_end_ref = HwcSearchModuleMediator.get_last_ref_start_end_time('/eos/project/l/lhcsm/hwc/HWC_Summary.csv', circuit_name, hwc_test, Time.to_string_short(t_start)) t_start_ref, t_end_ref = HwcSearchModuleMediator.get_last_ref_start_end_time('/eos/project/l/lhcsm/hwc/HWC_Summary.csv', circuit_name, hwc_test, Time.to_string_short(t_start))
print(t_start_ref, t_end_ref) print(t_start_ref, t_end_ref)
t_start_ref, t_end_ref = Time.to_unix_timestamp(t_start_ref), Time.to_unix_timestamp(t_end_ref) t_start_ref, t_end_ref = Time.to_unix_timestamp(t_start_ref), Time.to_unix_timestamp(t_end_ref)
is_automatic = False is_automatic = False
rb_query = RbCircuitQuery(circuit_type, circuit_name, max_executions=30) rb_query = RbCircuitQuery(circuit_type, circuit_name, max_executions=30)
rb_analysis = RbCircuitAnalysis(circuit_type, results_table=None, is_automatic=is_automatic) rb_analysis = RbCircuitAnalysis(circuit_type, results_table=None, is_automatic=is_automatic)
with Timer(): with Timer():
# PC # PC
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] 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]
source_timestamp_pc = rb_query.find_source_timestamp_pc(t_start, t_end) source_timestamp_pc = rb_query.find_source_timestamp_pc(t_start, t_end)
timestamp_fgc = source_timestamp_pc.at[0, 'timestamp'] timestamp_fgc = source_timestamp_pc.at[0, 'timestamp']
source_timestamp_pc_ref = rb_query.find_source_timestamp_pc(t_start_ref, t_end_ref) source_timestamp_pc_ref = rb_query.find_source_timestamp_pc(t_start_ref, t_end_ref)
timestamp_fgc_ref = source_timestamp_pc_ref.at[0, 'timestamp'] timestamp_fgc_ref = source_timestamp_pc_ref.at[0, 'timestamp']
# PIC # PIC
timestamp_pic = rb_query.find_timestamp_pic(timestamp_fgc, spark=spark, duration=[(t_end-timestamp_fgc, 'ns')]) timestamp_pic = rb_query.find_timestamp_pic(timestamp_fgc, spark=spark, duration=[(t_end-timestamp_fgc, 'ns')])
timestamp_pic_ref = rb_query.find_timestamp_pic(timestamp_fgc_ref, spark=spark, duration=[(t_end_ref-timestamp_fgc_ref, 'ns')]) timestamp_pic_ref = rb_query.find_timestamp_pic(timestamp_fgc_ref, spark=spark, duration=[(t_end_ref-timestamp_fgc_ref, 'ns')])
i_a_df, i_ref_df = rb_query.query_pc_pm(timestamp_fgc, timestamp_fgc, signal_names=['I_A', 'I_REF']) i_a_df, i_ref_df = rb_query.query_pc_pm(timestamp_fgc, timestamp_fgc, signal_names=['I_A', 'I_REF'])
i_meas_df, i_earth_df, i_earth_pcnt_df, v_meas_df = rb_query.query_pc_pm(timestamp_fgc, min(timestamp_pic), signal_names=['I_MEAS', 'I_EARTH', 'I_EARTH_PCNT', 'V_MEAS']) i_meas_df, i_earth_df, i_earth_pcnt_df, v_meas_df = rb_query.query_pc_pm(timestamp_fgc, min(timestamp_pic), signal_names=['I_MEAS', 'I_EARTH', 'I_EARTH_PCNT', 'V_MEAS'])
# PC Reference # PC Reference
i_meas_nxcals_pic_sync_df = rb_query.query_signal_nxcals(t_start, t_end, t0=min(timestamp_pic), system='PC', signal_names='I_MEAS', spark=spark)[0] i_meas_nxcals_pic_sync_df = rb_query.query_signal_nxcals(t_start, t_end, t0=min(timestamp_pic), system='PC', signal_names='I_MEAS', spark=spark)[0]
i_meas_nxcals_pic_sync_ref_df = rb_query.query_signal_nxcals(t_start_ref, t_end_ref, t0=min(timestamp_pic_ref), system='PC', signal_names='I_MEAS', spark=spark)[0] i_meas_nxcals_pic_sync_ref_df = rb_query.query_signal_nxcals(t_start_ref, t_end_ref, t0=min(timestamp_pic_ref), system='PC', signal_names='I_MEAS', spark=spark)[0]
if isinstance(t_start_ref, int): if isinstance(t_start_ref, int):
source_timestamp_pc_ref = rb_query.find_source_timestamp_pc(t_start_ref, t_end_ref) source_timestamp_pc_ref = rb_query.find_source_timestamp_pc(t_start_ref, t_end_ref)
timestamp_fgc_ref = source_timestamp_pc_ref.at[0, 'timestamp'] timestamp_fgc_ref = source_timestamp_pc_ref.at[0, 'timestamp']
else: else:
timestamp_fgc_ref = float('nan') timestamp_fgc_ref = float('nan')
print(qqqq)
# PIC Reference # PIC Reference
#timestamp_pic_ref = rb_query.find_timestamp_pic(timestamp_fgc_ref, spark=spark, duration=[(t_end_ref-timestamp_fgc_ref, 'ns')]) #timestamp_pic_ref = rb_query.find_timestamp_pic(timestamp_fgc_ref, spark=spark, duration=[(t_end_ref-timestamp_fgc_ref, 'ns')])
i_meas_ref_df = rb_query.query_pc_pm(timestamp_fgc_ref, min(timestamp_pic_ref), signal_names=['I_MEAS'])[0] i_meas_ref_df = rb_query.query_pc_pm(timestamp_fgc_ref, min(timestamp_pic_ref), signal_names=['I_MEAS'])[0]
# EE Voltage # EE Voltage
source_timestamp_ee_odd_df = rb_query.find_source_timestamp_ee(timestamp_fgc, system='EE_ODD') source_timestamp_ee_odd_df = rb_query.find_source_timestamp_ee(timestamp_fgc, system='EE_ODD')
timestamp_ee_odd = source_timestamp_ee_odd_df.loc[0, 'timestamp'] timestamp_ee_odd = source_timestamp_ee_odd_df.loc[0, 'timestamp']
source_ee_odd = source_timestamp_ee_odd_df.loc[0, 'source'] source_ee_odd = source_timestamp_ee_odd_df.loc[0, 'source']
u_dump_res_odd_df = rb_query.query_ee_u_dump_res_pm(timestamp_ee_odd, min(timestamp_pic), system='EE_ODD', signal_names=['U_DUMP_RES'])[0] u_dump_res_odd_df = rb_query.query_ee_u_dump_res_pm(timestamp_ee_odd, min(timestamp_pic), system='EE_ODD', signal_names=['U_DUMP_RES'])[0]
source_timestamp_ee_even_df = rb_query.find_source_timestamp_ee(timestamp_fgc, system='EE_EVEN') source_timestamp_ee_even_df = rb_query.find_source_timestamp_ee(timestamp_fgc, system='EE_EVEN')
timestamp_ee_even = source_timestamp_ee_even_df.loc[0, 'timestamp'] timestamp_ee_even = source_timestamp_ee_even_df.loc[0, 'timestamp']
source_ee_even = source_timestamp_ee_even_df.loc[0, 'source'] source_ee_even = source_timestamp_ee_even_df.loc[0, 'source']
u_dump_res_even_df = rb_query.query_ee_u_dump_res_pm(timestamp_ee_even, min(timestamp_pic), system='EE_EVEN', signal_names=['U_DUMP_RES'])[0] u_dump_res_even_df = rb_query.query_ee_u_dump_res_pm(timestamp_ee_even, min(timestamp_pic), system='EE_EVEN', signal_names=['U_DUMP_RES'])[0]
# EE Temperature # EE Temperature
t_res_odd_0_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_odd_df.loc[0, 'timestamp'], min(timestamp_pic), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_ODD') t_res_odd_0_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_odd_df.loc[0, 'timestamp'], min(timestamp_pic), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_ODD')
if len(source_timestamp_ee_odd_df) > 1: if len(source_timestamp_ee_odd_df) > 1:
t_res_odd_1_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_odd_df.loc[1, 'timestamp'], min(timestamp_pic), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_ODD') t_res_odd_1_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_odd_df.loc[1, 'timestamp'], min(timestamp_pic), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_ODD')
else: else:
t_res_odd_1_df = [pd.DataFrame(columns=['T_RES_BODY_1']), pd.DataFrame(columns=['T_RES_BODY_2']), pd.DataFrame(columns=['T_RES_BODY_3'])] t_res_odd_1_df = [pd.DataFrame(columns=['T_RES_BODY_1']), pd.DataFrame(columns=['T_RES_BODY_2']), pd.DataFrame(columns=['T_RES_BODY_3'])]
t_res_even_0_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_even_df.loc[0, 'timestamp'], min(timestamp_pic), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_EVEN') t_res_even_0_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_even_df.loc[0, 'timestamp'], min(timestamp_pic), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_EVEN')
if len(source_timestamp_ee_even_df) > 1: if len(source_timestamp_ee_even_df) > 1:
t_res_even_1_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_even_df.loc[1, 'timestamp'], min(timestamp_pic), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_EVEN') t_res_even_1_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_even_df.loc[1, 'timestamp'], min(timestamp_pic), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_EVEN')
else: else:
t_res_even_1_df = [pd.DataFrame(columns=['T_RES_BODY_1']), pd.DataFrame(columns=['T_RES_BODY_2']), pd.DataFrame(columns=['T_RES_BODY_3'])] t_res_even_1_df = [pd.DataFrame(columns=['T_RES_BODY_1']), pd.DataFrame(columns=['T_RES_BODY_2']), pd.DataFrame(columns=['T_RES_BODY_3'])]
# EE Voltage Reference # EE Voltage Reference
if isinstance(t_start_ref, int): if isinstance(t_start_ref, int):
source_timestamp_ee_odd_ref_df = rb_query.find_source_timestamp_ee(timestamp_fgc_ref, system='EE_ODD') source_timestamp_ee_odd_ref_df = rb_query.find_source_timestamp_ee(timestamp_fgc_ref, system='EE_ODD')
source_timestamp_ee_even_ref_df = rb_query.find_source_timestamp_ee(timestamp_fgc_ref, system='EE_EVEN') source_timestamp_ee_even_ref_df = rb_query.find_source_timestamp_ee(timestamp_fgc_ref, system='EE_EVEN')
u_dump_res_odd_ref_df = rb_query.query_ee_u_dump_res_pm(source_timestamp_ee_odd_ref_df.loc[0, 'timestamp'], min(timestamp_pic_ref), system='EE_ODD', signal_names=['U_DUMP_RES'])[0] u_dump_res_odd_ref_df = rb_query.query_ee_u_dump_res_pm(source_timestamp_ee_odd_ref_df.loc[0, 'timestamp'], min(timestamp_pic_ref), system='EE_ODD', signal_names=['U_DUMP_RES'])[0]
u_dump_res_even_ref_df = rb_query.query_ee_u_dump_res_pm(source_timestamp_ee_even_ref_df.loc[0, 'timestamp'], min(timestamp_pic_ref), system='EE_EVEN', signal_names=['U_DUMP_RES'])[0] u_dump_res_even_ref_df = rb_query.query_ee_u_dump_res_pm(source_timestamp_ee_even_ref_df.loc[0, 'timestamp'], min(timestamp_pic_ref), system='EE_EVEN', signal_names=['U_DUMP_RES'])[0]
# EE Temperature Reference # EE Temperature Reference
t_res_odd_0_ref_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_odd_ref_df.loc[0, 'timestamp'], min(timestamp_pic_ref), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_ODD') t_res_odd_0_ref_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_odd_ref_df.loc[0, 'timestamp'], min(timestamp_pic_ref), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_ODD')
if len(source_timestamp_ee_odd_ref_df) > 1: if len(source_timestamp_ee_odd_ref_df) > 1:
t_res_odd_1_ref_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_odd_ref_df.loc[1, 'timestamp'], min(timestamp_pic_ref), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_ODD') t_res_odd_1_ref_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_odd_ref_df.loc[1, 'timestamp'], min(timestamp_pic_ref), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_ODD')
else: else:
t_res_odd_1_ref_df = [pd.DataFrame(columns=['T_RES_BODY_1']), pd.DataFrame(columns=['T_RES_BODY_2']), pd.DataFrame(columns=['T_RES_BODY_3'])] t_res_odd_1_ref_df = [pd.DataFrame(columns=['T_RES_BODY_1']), pd.DataFrame(columns=['T_RES_BODY_2']), pd.DataFrame(columns=['T_RES_BODY_3'])]
t_res_even_0_ref_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_even_ref_df.loc[0, 'timestamp'], min(timestamp_pic_ref), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_EVEN') t_res_even_0_ref_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_even_ref_df.loc[0, 'timestamp'], min(timestamp_pic_ref), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_EVEN')
if len(source_timestamp_ee_even_ref_df) > 1: if len(source_timestamp_ee_even_ref_df) > 1:
t_res_even_1_ref_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_even_ref_df.loc[1, 'timestamp'], min(timestamp_pic_ref), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_EVEN') t_res_even_1_ref_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_even_ref_df.loc[1, 'timestamp'], min(timestamp_pic_ref), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_EVEN')
else: else:
t_res_even_1_ref_df = [pd.DataFrame(columns=['T_RES_BODY_1']), pd.DataFrame(columns=['T_RES_BODY_2']), pd.DataFrame(columns=['T_RES_BODY_3'])] t_res_even_1_ref_df = [pd.DataFrame(columns=['T_RES_BODY_1']), pd.DataFrame(columns=['T_RES_BODY_2']), pd.DataFrame(columns=['T_RES_BODY_3'])]
# DFB # DFB
source_timestamp_leads_odd_df = rb_query.find_timestamp_leads(timestamp_fgc, 'LEADS_ODD') source_timestamp_leads_odd_df = rb_query.find_timestamp_leads(timestamp_fgc, 'LEADS_ODD')
t0 = t_start if source_timestamp_leads_odd_df.empty else timestamp_fgc t0 = t_start if source_timestamp_leads_odd_df.empty else timestamp_fgc
u_hts_odd_dfs = rb_query.query_leads(t0, source_timestamp_leads_odd_df, system='LEADS_ODD', signal_names=['U_HTS'], spark=spark, duration=[(t_end-t_start, 'ns')]) u_hts_odd_dfs = rb_query.query_leads(t0, source_timestamp_leads_odd_df, system='LEADS_ODD', signal_names=['U_HTS'], spark=spark, duration=[(t_end-t_start, 'ns')])
u_res_odd_dfs = rb_query.query_leads(t0, source_timestamp_leads_odd_df, system='LEADS_ODD', signal_names=['U_RES'], spark=spark, duration=[(t_end-t_start, 'ns')]) u_res_odd_dfs = rb_query.query_leads(t0, source_timestamp_leads_odd_df, system='LEADS_ODD', signal_names=['U_RES'], spark=spark, duration=[(t_end-t_start, 'ns')])
source_timestamp_leads_even_df = rb_query.find_timestamp_leads(timestamp_fgc, 'LEADS_EVEN') source_timestamp_leads_even_df = rb_query.find_timestamp_leads(timestamp_fgc, 'LEADS_EVEN')
t0 = t_start if source_timestamp_leads_even_df.empty else timestamp_fgc t0 = t_start if source_timestamp_leads_even_df.empty else timestamp_fgc
u_hts_even_dfs = rb_query.query_leads(t_start, source_timestamp_leads_even_df, system='LEADS_EVEN', signal_names=['U_HTS'], spark=spark, duration=[(t_end-t_start, 'ns')]) u_hts_even_dfs = rb_query.query_leads(t_start, source_timestamp_leads_even_df, system='LEADS_EVEN', signal_names=['U_HTS'], spark=spark, duration=[(t_end-t_start, 'ns')])
u_res_even_dfs = rb_query.query_leads(t_start, source_timestamp_leads_even_df, system='LEADS_EVEN', signal_names=['U_RES'], spark=spark, duration=[(t_end-t_start, 'ns')]) u_res_even_dfs = rb_query.query_leads(t_start, source_timestamp_leads_even_df, system='LEADS_EVEN', signal_names=['U_RES'], spark=spark, duration=[(t_end-t_start, 'ns')])
timestamp_dct = {'FGC': timestamp_fgc, 'PIC': min(timestamp_pic), 'EE_EVEN': timestamp_ee_even, 'EE_ODD': timestamp_ee_odd, 'LEADS_ODD': source_timestamp_leads_odd_df, 'LEADS_EVEN': source_timestamp_leads_even_df} timestamp_dct = {'FGC': timestamp_fgc, 'PIC': min(timestamp_pic), 'EE_EVEN': timestamp_ee_even, 'EE_ODD': timestamp_ee_odd, 'LEADS_ODD': source_timestamp_leads_odd_df, 'LEADS_EVEN': source_timestamp_leads_even_df}
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# 3. Timestamps # 3. Timestamps
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
rb_analysis.create_timestamp_table(timestamp_dct) rb_analysis.create_timestamp_table(timestamp_dct)
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# 4. Power Converter # 4. Power Converter
## 4.1. Plot of the Power Converter Main Current ## 4.1. Plot of the Power Converter Main Current
*GRAPHS*: *GRAPHS*:
- t = 0 s corresponds to the start of the test - t = 0 s corresponds to the start of the test
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
import matplotlib as mpl import matplotlib as mpl
mpl.rcParams['savefig.dpi'] = 80 mpl.rcParams['savefig.dpi'] = 80
mpl.rcParams['figure.dpi'] = 80 mpl.rcParams['figure.dpi'] = 80
%matplotlib notebook %matplotlib notebook
title = create_hwc_plot_title_with_circuit_name(circuit_name=circuit_name, hwc_test=hwc_test, t_start=t_start, t_end=t_end, signal='I_MEAS') title = create_hwc_plot_title_with_circuit_name(circuit_name=circuit_name, hwc_test=hwc_test, t_start=t_start, t_end=t_end, signal='I_MEAS')
rb_analysis.plot_i_meas(i_meas_nxcals_df, title=title) rb_analysis.plot_i_meas(i_meas_nxcals_df, title=title)
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
- t = 0 s corresponds to PIC timestamp - t = 0 s corresponds to PIC timestamp
Delay between powering failure and EE may be different Delay between powering failure and EE may be different
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
i_meas_nxcals_pic_sync_df.rename(columns={'I_MEAS': '%s:I_MEAS' % circuit_name}, inplace=True) i_meas_nxcals_pic_sync_df.rename(columns={'I_MEAS': '%s:I_MEAS' % circuit_name}, inplace=True)
i_meas_nxcals_pic_sync_ref_df.rename(columns={'I_MEAS': '%s:I_MEAS_REF' % circuit_name}, inplace=True) i_meas_nxcals_pic_sync_ref_df.rename(columns={'I_MEAS': '%s:I_MEAS_REF' % circuit_name}, inplace=True)
ax = i_meas_nxcals_pic_sync_df.plot(figsize=(13.5, 6)) ax = i_meas_nxcals_pic_sync_df.plot(figsize=(13.5, 6))
i_meas_nxcals_pic_sync_ref_df.plot(ax=ax, grid=True, title=title) i_meas_nxcals_pic_sync_ref_df.plot(ax=ax, grid=True, title=title)
ax.set_xlabel('Time, [s]', fontsize=15) ax.set_xlabel('Time, [s]', fontsize=15)
ax.set_ylabel('I, [A]', fontsize=15) ax.set_ylabel('I, [A]', fontsize=15)
ax.title.set_size(20) ax.title.set_size(20)
ax.tick_params(labelsize=15) ax.tick_params(labelsize=15)
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## 4.2. Analysis of the Power Converter Main Current ## 4.2. Analysis of the Power Converter Main Current
This analysis module displays the main current of the power converter (I_MEAS) compared to the one obtained from the reference FPA (HWC PNO.b2 test with opening of EE systems and without magnet quench). This analysis module displays the main current of the power converter (I_MEAS) compared to the one obtained from the reference FPA (HWC PNO.b2 test with opening of EE systems and without magnet quench).
*ANALYSIS*: *ANALYSIS*:
- The evolution of the characteristic time $\tau$ of an exponential decay $f(t)$ is obtained as - The evolution of the characteristic time $\tau$ of an exponential decay $f(t)$ is obtained as
\begin{equation} \begin{equation}
-\frac{f(t)}{\partial_t f(t)} = -\frac{f_0 e^{-t/\tilde{\tau}}}{\partial_t (f_0 e^{-t/\tilde{\tau}})} = -\frac{f_0 e^{-t/\tilde{\tau}}}{-f_0/\tilde{\tau} e^{-t/\tilde{\tau}}}=-\frac{1}{-1/\tau}=\tau -\frac{f(t)}{\partial_t f(t)} = -\frac{f_0 e^{-t/\tilde{\tau}}}{\partial_t (f_0 e^{-t/\tilde{\tau}})} = -\frac{f_0 e^{-t/\tilde{\tau}}}{-f_0/\tilde{\tau} e^{-t/\tilde{\tau}}}=-\frac{1}{-1/\tau}=\tau
\end{equation} \end{equation}
Naturally, this formula only applies to exponential decayed characterised by a time constant. Nonetheless, for pseudo-exponential decays, this formula gives a notion of the change of the characteristic time $\tilde{\tau}$. For a circuit we compute the time-varying characteristic time as Naturally, this formula only applies to exponential decayed characterised by a time constant. Nonetheless, for pseudo-exponential decays, this formula gives a notion of the change of the characteristic time $\tilde{\tau}$. For a circuit we compute the time-varying characteristic time as
\begin{equation} \begin{equation}
\tilde{\tau} = - \frac{\text{I_MEAS}}{\partial_t \text{I_MEAS}} \tilde{\tau} = - \frac{\text{I_MEAS}}{\partial_t \text{I_MEAS}}
\end{equation} \end{equation}
*CRITERIA* *CRITERIA*
- Check if the characteristic time of pseudo-exponential decay of I_MEAS from t=1 to 120 s is 90 s< Tau <110 s - Check if the characteristic time of pseudo-exponential decay of I_MEAS from t=1 to 120 s is 90 s< Tau <110 s
*PLOT*: *PLOT*:
- The main power converter current (analyzed and reference) on the left axis, I_MEAS - The main power converter current (analyzed and reference) on the left axis, I_MEAS
- The characteristic time calculated for the main current (reference and actual) on the right axis, -I_MEAS/dI_MEAS_dt - The characteristic time calculated for the main current (reference and actual) on the right axis, -I_MEAS/dI_MEAS_dt
The actual characteristic time contains steps, which indicate a quenching magnet (decrease of circuit inductance); note that for the reference one the steps are not present. Timing of PIC abort, FGC timestamp, and the maximum current are reported next to the graph. The actual characteristic time contains steps, which indicate a quenching magnet (decrease of circuit inductance); note that for the reference one the steps are not present. Timing of PIC abort, FGC timestamp, and the maximum current are reported next to the graph.
- t = 0 s corresponds to the respective (analyzed and reference) FGC timestamps. - t = 0 s corresponds to the respective (analyzed and reference) FGC timestamps.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
rb_analysis.analyze_i_meas_pc(circuit_name, timestamp_fgc, timestamp_fgc_ref, min(timestamp_pic), i_meas_df, i_meas_ref_df) rb_analysis.analyze_i_meas_pc(circuit_name, timestamp_fgc, timestamp_fgc_ref, min(timestamp_pic), i_meas_df, i_meas_ref_df)
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## 4.3. Analysis of the Power Converter Main Current Smoothness ## 4.3. Analysis of the Power Converter Main Current Smoothness
*ANALYSIS*: *ANALYSIS*:
- The current smoothness is evaluated on the basis of its second derivative. The derivative is calculated as a rolling division of current and time differences. The rolling window is fixed and equal to 10 points; with the sampling time equal to 0.1 s the time difference is equal to $dt=1 s$. - The current smoothness is evaluated on the basis of its second derivative. The derivative is calculated as a rolling division of current and time differences. The rolling window is fixed and equal to 10 points; with the sampling time equal to 0.1 s the time difference is equal to $dt=1 s$.
\begin{equation} \begin{equation}
\frac{d i(t)}{dt} = \frac{i(t+dt)-i(t)}{dt} \frac{d i(t)}{dt} = \frac{i(t+dt)-i(t)}{dt}
\end{equation} \end{equation}
To obtain the second derivative of the current decay, the formula above is applied twice to the current profile from PM after the second EE opening (for t > 1 s). To obtain the second derivative of the current decay, the formula above is applied twice to the current profile from PM after the second EE opening (for t > 1 s).
*CRITERIA* *CRITERIA*
- Check if the second derivative of the current decay of I_MEAS from t = 1 s is -10 A/s^2< dI_MEAS/dt^2 < 10 A/s^2 - Check if the second derivative of the current decay of I_MEAS from t = 1 s is -10 A/s^2< dI_MEAS/dt^2 < 10 A/s^2
*PLOT*: *PLOT*:
- The second derivative of the main power converter current on the left axis, dI_MEAS/dt^2 - The second derivative of the main power converter current on the left axis, dI_MEAS/dt^2
- Green bar denotes the acceptance threshold for the second derivative of the main power converter current - Green bar denotes the acceptance threshold for the second derivative of the main power converter current
- t = 0 s corresponds to the PM timestamp of the FGC - t = 0 s corresponds to the PM timestamp of the FGC
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
title = create_hwc_plot_title_with_circuit_name(circuit_name=circuit_name, hwc_test=hwc_test, t_start=t_start, t_end=t_end, signal='I_MEAS smoothness') title = create_hwc_plot_title_with_circuit_name(circuit_name=circuit_name, hwc_test=hwc_test, t_start=t_start, t_end=t_end, signal='I_MEAS smoothness')
rb_analysis.plot_i_meas_smoothness(i_meas_df, title=title) rb_analysis.plot_i_meas_smoothness(i_meas_df, title=title)
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## 4.4. Power Converter Voltage Analysis ## 4.4. Power Converter Voltage Analysis