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:
<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%>
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.
<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.
|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|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|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>
%% Cell type:markdown id: tags:
# 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.
- 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
- 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 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 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).
- 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.
%% Cell type:markdown id: tags:
# 0. Initialise Working Environment
%% Cell type:code id: tags:
``` python
# External libraries
print('Loading (1/11)'); import sys; import pandas as pd
print('Loading (2/11)'); from IPython.display import display, Javascript, clear_output
# Internal libraries
print('Loading (3/11)'); import lhcsmapi
print('Loading (4/11)'); from lhcsmapi.Time import Time
print('Loading (5/11)'); from lhcsmapi.Timer import Timer
print('Loading (6/11)'); from lhcsmapi.analysis.RbCircuitQuery import RbCircuitQuery
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 (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 (11/11)'); from lhcsmapi.analysis.expert_input import get_expert_decision
clear_output()
lhcsmapi.get_lhcsmapi_version()
lhcsmapi.get_lhcsmhwc_version('../__init__.py')
print('Analysis performed by %s' % HwcSearchModuleMediator.get_user())
```
%% Cell type:markdown id: tags:
# 1. User Input
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">
- 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'
circuit_name = 'RB.A12'
campaign = 'HWC_2017'
t_start = '2017-04-22 13:22:37.202'
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
```
circuit_type = 'RB'
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')
```
- 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:
``` python
hwc_test = 'PLI3.d2'
circuit_name = 'RB.A34'
campaign= 'Recommissioning post LS2'
t_start = '2021-03-24 22:19:06.563000000'
t_end = '2021-03-24 22:44:23.159000000'
```
%% Cell type:code id: tags:
``` 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))
```
%% Cell type:markdown id: tags:
# 2. Query All Signals Prior to Analysis
%% Cell type:code id: tags:skip_output
``` python
circuit_type = 'RB'
if 'hwcb' in locals():
circuit_name = hwcb.get_circuit_name()
t_start = Time.to_unix_timestamp(hwcb.get_start_time())
t_end = Time.to_unix_timestamp(hwcb.get_end_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())
is_automatic = hwcb.is_automatic_mode()
else:
t_start = Time.to_unix_timestamp(t_start)
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))
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)
is_automatic = False
rb_query = RbCircuitQuery(circuit_type, circuit_name, max_executions=30)
rb_analysis = RbCircuitAnalysis(circuit_type, results_table=None, is_automatic=is_automatic)
with Timer():
# 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]
source_timestamp_pc = rb_query.find_source_timestamp_pc(t_start, t_end)
timestamp_fgc = source_timestamp_pc.at[0, 'timestamp']
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']
# PIC
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')])
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'])
# 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_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):
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']
else:
timestamp_fgc_ref = float('nan')
print(qqqq)
# PIC Reference
#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]
# EE Voltage
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']
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]
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']
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]
# 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')
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')
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_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:
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:
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
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_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_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
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:
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:
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')
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')
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'])]
# DFB
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
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')])
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
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')])
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:
# 3. Timestamps
%% Cell type:code id: tags:
``` python
rb_analysis.create_timestamp_table(timestamp_dct)
```
%% Cell type:markdown id: tags:
# 4. Power Converter
## 4.1. Plot of the Power Converter Main Current
*GRAPHS*:
- t = 0 s corresponds to the start of the test
%% Cell type:code id: tags:
``` python
import matplotlib as mpl
mpl.rcParams['savefig.dpi'] = 80
mpl.rcParams['figure.dpi'] = 80
%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')
rb_analysis.plot_i_meas(i_meas_nxcals_df, title=title)
```
%% Cell type:markdown id: tags:
- t = 0 s corresponds to PIC timestamp
Delay between powering failure and EE may be different
%% Cell type:code id: tags:
``` python
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)
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)
ax.set_xlabel('Time, [s]', fontsize=15)
ax.set_ylabel('I, [A]', fontsize=15)
ax.title.set_size(20)
ax.tick_params(labelsize=15)
```
%% Cell type:markdown id: tags:
## 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).
*ANALYSIS*:
- The evolution of the characteristic time $\tau$ of an exponential decay $f(t)$ is obtained as
\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
\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
\begin{equation}
\tilde{\tau} = - \frac{\text{I_MEAS}}{\partial_t \text{I_MEAS}}
\end{equation}
*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
*PLOT*:
- 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 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.
%% Cell type:code id: tags:
``` python
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:
## 4.3. Analysis of the Power Converter Main Current Smoothness
*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$.
\begin{equation}
\frac{d i(t)}{dt} = \frac{i(t+dt)-i(t)}{dt}
\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).
*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
*PLOT*:
- 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
- t = 0 s corresponds to the PM timestamp of the FGC
%% Cell type:code id: tags:
``` 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')
rb_analysis.plot_i_meas_smoothness(i_meas_df, title=title)
```
%% Cell type:markdown id: tags:
## 4.4. Power Converter Voltage Analysis
*CRITERIA*
- Check if the V_MEAS voltage is within -3.7 +/- 0.5 V range 1 s after the EE timestamp, assuming that I_MEAS = ~9 kA.
*GRAPHS*
- t = 0 s corresponds to the PM timestamp of the FGC
%% Cell type:code id: tags:
``` 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='V_MEAS')
rb_analysis.assert_v_meas(timestamp_ee_even, min(timestamp_pic), t_after_ee=1, v_meas_df=v_meas_df, value_min=-4.2, value_max=-3.2, title=title, xmax=15)
```
%% Cell type:markdown id: tags:
# 5. Energy Extraction System
## 5.1. Analysis of the Energy Extraction Voltage
*ANALYSIS*:
- Calculate U_dump_res (t=0)
- Calculate the characteristic time of pseudo-exponential current decay with the charge approach
*CRITERIA*:
- Check if U_DUMP_RES (t=0) = (±10%) U_DUMP_RES reference.
- Check if the timestamp difference between FGC and EE an odd point is 100±50 ms
The opening delay was 300±50 ms prior to YETS 2017/8
- Check if the time stamp difference between FGC and EE an even point: 600±50 ms
*WARNING*:
- Check if the characteristic time of pseudo-exponential decay of I_MEAS from t=1 to 120 s is 110 s<-Tau <130 s
*GRAPHS*:
- t = 0 s corresponds to the PM timestamp of the FGC
First plot (global view):
- the power converter converter current on the left axis, I_MEAS
- the two energy extraction voltages on the right, U_DUMP_RES, U_DUMP_RES
Second plot (triggering view):
- the power converter current on the left axis, I_MEAS
- the power converter reference current on the left axis, STATUS.I_REF (should stop at the moment of the FGC PM timestamp)
- the two energy extraction voltages on the right axis, U_DUMP_RES, U_DUMP_RES
- the green dashed line denotes the PIC timestamp
%% Cell type:code id: tags:
``` python
rb_analysis.analyze_char_time_u_dump_res_ee(circuit_name, timestamp_fgc, [u_dump_res_odd_df, u_dump_res_even_df], i_meas_df)
```
%% Cell type:code id: tags:
``` python
rb_analysis.analyze_delay_time_u_dump_res_ee(circuit_name, min(timestamp_pic), min(timestamp_pic), [timestamp_ee_odd, timestamp_ee_even],
i_a_df, i_ref_df, [u_dump_res_odd_df, u_dump_res_even_df])
```
%% Cell type:code id: tags:
``` python
rb_analysis.compare_max_u_res_dump_to_reference(u_dump_res_odd_df, u_dump_res_odd_ref_df, 'U_DUMP_RES_ODD')
rb_analysis.compare_max_u_res_dump_to_reference(u_dump_res_even_df, u_dump_res_even_ref_df, 'U_DUMP_RES_EVEN')
```
%% Cell type:markdown id: tags:
## 5.2. Analysis of the Energy Extraction Temperature
*WARNING*
- Check if temperature profile is +/-25 K w.r.t. the reference temperature profile
*PLOT*:
- Temperature signals on the left axis, T
- A reference signal with an acceptable signal range is also provided on the left axis
- t = 0 s corresponds to PM timestamps of each temperature PM entry
%% Cell type:code id: tags:
``` python
rb_analysis.plot_ee_temp(circuit_name + '_EE_ODD', timestamp_ee_odd, t_res_odd_0_df + t_res_odd_1_df, t_res_odd_0_ref_df + t_res_odd_1_ref_df)
```
%% Cell type:code id: tags:
``` python
rb_analysis.analyze_ee_temp(circuit_name + '_EE_ODD', timestamp_ee_odd, t_res_odd_0_df + t_res_odd_1_df, t_res_odd_0_ref_df + t_res_odd_1_ref_df, abs_margin=25, scaling=1)
```
%% Cell type:code id: tags:
``` python
rb_analysis.plot_ee_temp(circuit_name + '_EE_EVEN', timestamp_ee_even, t_res_even_0_df + t_res_even_1_df, t_res_even_0_ref_df + t_res_even_1_ref_df)
```
%% Cell type:code id: tags:
``` python
rb_analysis.analyze_ee_temp(circuit_name + '_EE_EVEN', timestamp_ee_even, t_res_even_0_df + t_res_even_1_df, t_res_even_0_ref_df + t_res_even_1_ref_df, abs_margin=25, scaling=1)
```
%% Cell type:markdown id: tags:
# 6. Current Leads
## 6.1. Plot of Current Leads
*CRITERIA*:
- Check if the quench detection signal for U_HTS is below the threshold (3 mV)
- Check if the quench detection signal for U_RES is below the threshold (100 mV)
*GRAPHS*:
- t = 0 s corresponds to the FGC timestamp
%% Cell type:code id: tags:
``` python
timestamp = t_start if source_timestamp_leads_odd_df.empty else source_timestamp_leads_odd_df.loc[0, 'timestamp']
rb_analysis.analyze_leads_voltage(u_hts_odd_dfs, circuit_name, timestamp, signal='U_HTS', value_min=-0.003, value_max=0.003)
```
%% Cell type:code id: tags:
``` python
timestamp = t_start if source_timestamp_leads_even_df.empty else source_timestamp_leads_even_df.loc[0, 'timestamp']
rb_analysis.analyze_leads_voltage(u_hts_even_dfs, circuit_name, timestamp, signal='U_HTS', value_min=-0.003, value_max=0.003)
```
%% Cell type:code id: tags:
``` python
timestamp = t_start if source_timestamp_leads_odd_df.empty else source_timestamp_leads_odd_df.loc[0, 'timestamp']
rb_analysis.analyze_leads_voltage(u_res_odd_dfs, circuit_name, timestamp, signal='U_RES', value_min=-0.1, value_max=0.1)
```
%% Cell type:code id: tags:
``` python
timestamp = t_start if source_timestamp_leads_even_df.empty else source_timestamp_leads_even_df.loc[0, 'timestamp']
rb_analysis.analyze_leads_voltage(u_res_even_dfs, circuit_name, timestamp, signal='U_RES', value_min=-0.1, value_max=0.1)
```
%% Cell type:markdown id: tags:
# 7. Signature Decision
%% Cell type:code id: tags:
``` python
signature = get_expert_decision('Expert Signature Decision: ', ['PASSED', 'FAILED'])
```
%% Cell type:markdown id: tags:
# 8. Final Report
%% Cell type:code id: tags:
``` python
analysis_start_time = Time.get_analysis_start_time()
apply_report_template()
file_name_html = '{}_{}-{}-{}_{}.html'.format(circuit_name, hwc_test, Time.to_datetime(t_start).strftime("%Y-%m-%d-%Hh%M"), analysis_start_time, signature)
full_path = '/eos/project/m/mp3/RB/{}/{}/{}'.format(circuit_name, hwc_test, file_name_html)
!mkdir -p /eos/project/m/mp3/RB/$circuit_name/$hwc_test
print('Compact notebook report saved to (Windows): ' + '\\\\cernbox-smb' + full_path.replace('/', '\\'))
display(Javascript('IPython.notebook.save_notebook();'))
Time.sleep(5)
!{sys.executable} -m jupyter nbconvert --to html $'AN_RB_PLI3.d2.ipynb' --output /eos/project/m/mp3/RB/$circuit_name/$hwc_test/$file_name_html --TemplateExporter.exclude_input=True --TagRemovePreprocessor.remove_all_outputs_tags='["skip_output"]'
```
%% Cell type:code id: tags:
``` python
```
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment