Commit 6c1ff8e9 authored by Agata Malgorzata Chadaj's avatar Agata Malgorzata Chadaj
Browse files

Merge branch 'SIGMON-207_update_RB_FPA_SNAP_notebbok' into 'dev'

Sigmon 207 update rb fpa snap notebbok

See merge request !44
parents fedb019e 566a1237
Pipeline #3163644 canceled with stages
%% Cell type:markdown id: tags:
<h1><center>Analysis of an FPA SNAP in an RB Circuit</center></h1>
<h1><center>Analysis of an FPA iQPS SNAP in an RB Circuit</center></h1>
<img src="https://gitlab.cern.ch/LHCData/lhc-sm-hwc/raw/master/figures/rb/RB.png" width=75%>
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.
- In case a signal is not needed for the analysis, a particular analysis is skipped. In other words, all signals have to be available in order to perform an analysis.
- 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
# Initialise Working Environment
%% Cell type:code id: tags:
``` python
# External libraries
print('Loading (1/11)'); import sys
print('Loading (2/11)'); from IPython.display import display, Javascript, HTML, clear_output
print('Loading (1/12)'); import sys
print('Loading (2/12)'); from IPython.display import display, Javascript, HTML, clear_output
print('Loading (3/11)'); import pandas as pd
print('Loading (3/12)'); import pandas as pd
# Internal libraries
print('Loading (4/11)'); import lhcsmapi
print('Loading (5/11)'); from lhcsmapi.Time import Time
print('Loading (6/11)'); from lhcsmapi.Timer import Timer
print('Loading (7/11)'); from lhcsmapi.analysis.RbCircuitQuery import RbCircuitQuery
print('Loading (8/11)'); from lhcsmapi.analysis.RbCircuitAnalysis import RbCircuitAnalysis
print('Loading (9/11)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (10/11)'); from lhcsmapi.gui.qh.DateTimeBaseModule import DateTimeBaseModule
print('Loading (11/11)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator
print('Loading (4/12)'); import lhcsmapi
print('Loading (5/12)'); from lhcsmapi.Time import Time
print('Loading (6/12)'); from lhcsmapi.Timer import Timer
print('Loading (7/12)'); from lhcsmapi.analysis.RbCircuitQuery import RbCircuitQuery
print('Loading (8/12)'); from lhcsmapi.analysis.RbCircuitAnalysis import RbCircuitAnalysis
print('Loading (9/12)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (10/12)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule
print('Loading (11/12)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator
print('Loading (12/12)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType
clear_output()
lhcsmapi.get_lhcsmapi_version()
lhcsmapi.get_lhcsmhwc_version('../__init__.py')
```
%% Cell type:markdown id: tags:
# 1. Select FGC Post Mortem Entry
# Select FGC Post Mortem Entry
%% Cell type:markdown id: tags:skip_cell
In order to perform the analysis of a FPA in an RB circuit please:
1. Select circuit name (e.g., RB.A12)
2. Choose start and end time
3. Choose analysis mode (Automatic by default)
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.
**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 id: tags:
``` python
circuit_type = 'RB'
fgc_pm_search = FgcPmSearchModuleMediator(DateTimeBaseModule(start_date_time='2018-12-12 00:00:00+01:00',
end_date_time='2018-12-13 00:00:00+01:00'), circuit_type=circuit_type)
fgc_pm_search = FgcPmSearchModuleMediator(DateTimeBaseModule(start_date_time='2021-05-14 00:00:00+01:00',
end_date_time='2021-05-15 00:00:00+01:00'), circuit_type=circuit_type)
```
%% Cell type:markdown id: tags:
# 2. Query All Signals Prior to Analysis
# Query All Signals Prior to Analysis
%% Cell type:code id: tags:skip_output
%% Cell type:code id: tags:
``` python
timestamp_fgc = fgc_pm_search.get_fgc_timestamp()
circuit_name = fgc_pm_search.get_fgc_circuit()
author = fgc_pm_search.get_author()
is_automatic = fgc_pm_search.is_automatic_mode()
rb_query = RbCircuitQuery(circuit_type, circuit_name, max_executions=22)
with Timer():
# PIC
if not are_all_parameters_injected(NbType.FGC, locals()):
timestamp_fgc = fgc_pm_search.get_fgc_timestamp()
circuit_name = fgc_pm_search.get_fgc_circuit()
author = fgc_pm_search.get_author()
is_automatic = fgc_pm_search.is_automatic_mode()
rb_query = RbCircuitQuery(circuit_type, circuit_name, max_executions=4)
# PIC
timestamp_pic = rb_query.find_timestamp_pic(timestamp_fgc, spark=spark)
# PC Current
# PC Current
i_meas_df, i_a_df, i_earth_df, i_earth_pcnt_df, i_ref_df = rb_query.query_pc_pm(timestamp_fgc, timestamp_fgc, signal_names=['I_MEAS', 'I_A', 'I_EARTH', 'I_EARTH_PCNT', 'I_REF'])
timestamp_fgc_ref = rb_query.get_timestamp_ref(col='fgcPm')
i_meas_ref_df, i_earth_ref_df, i_earth_pcnt_ref_df = rb_query.query_pc_pm(timestamp_fgc_ref, timestamp_fgc_ref, signal_names=['I_MEAS', 'I_EARTH', 'I_EARTH_PCNT'])
# 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, timestamp_fgc, 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, timestamp_fgc, 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'], timestamp_fgc, 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'], timestamp_fgc, 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'], timestamp_fgc, 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'], timestamp_fgc, 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 TEMPERATURE REF
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')
t_res_odd_0_ref_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_odd_ref_df.loc[0, 'timestamp'], timestamp_fgc_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'], timestamp_fgc_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'], timestamp_fgc_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'], timestamp_fgc_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'])]
# U_DIODE
# u_diode_rb_dfs = rb_query.query_voltage_nxcals('DIODE_RB', 'U_DIODE_RB', timestamp_fgc, spark=spark, duration=[(50, 's'), (350, 's')])
# QDS
source_timestamp_qds_df = rb_query.find_source_timestamp_qds_board_ab(timestamp_fgc)
iqps_board_type_df = rb_query.query_pm_iqps_board_type(source_timestamp_qds_df)
source_timestamp_qds_df['iqps_board_type'] = iqps_board_type_df['iqps_board_type']
source_timestamp_qds_df.rename(columns={'source': 'magnet', 'timestamp': 'timestamp_iqps'}, inplace=True)
# QDS
source_timestamp_qds_df = rb_query.find_source_timestamp_qds_board_ab(timestamp_fgc, duration=[(10, 's'), (10, 's')])
u_qds_dfs = rb_query.query_voltage_logic_iqps(source_timestamp_qds_df, signal_names=['U_QS0', 'U_1', 'U_2'], filter_window=3)
source_timestamp_qds_df.drop_duplicates(subset=['source', 'timestamp'], inplace=True)
source_timestamp_qds_df.reset_index(drop=True, inplace=True)
# U_EARTH
# u_earth_rb_dfs = rb_query.query_voltage_nxcals('VF', 'U_EARTH_RB', timestamp_fgc, spark=spark, duration=[(50, 's'), (350, 's')])
iqps_board_type_df = rb_query.query_pm_iqps_board_type(source_timestamp_qds_df=source_timestamp_qds_df)
rb_analysis = RbCircuitAnalysis(circuit_type, None, is_automatic=is_automatic)
```
%% Cell type:markdown id: tags:
# 3. Timestamps
## 3.1. FPA
Table below provides timestamps ordered achronologically and represents the sequence of events that occurred in the analyzed circuit. Only the first PIC timestamp is reported. Note that for iQPS and nQPS only the first timestamp is reported. Tables with all iQPS and NQPS timestamps are presented in the section dedicated to magnet and quench protection analysis. The table also contains time difference in milliseconds from the first event and from the FGC event.
In short, the following criteria should be kept:
- The PC timestamp (51_self) is QPS time stamp +/-20 ms.
- Time stamp difference between FGC and EE at an odd (RR or UJ) point: 290±50 ms
After YETS 2017/8 the EE timestamp odd has been reduced and should now be 100+-50 ms after the FGC time stamp
- Time stamp difference between FGC and EE at an even (UA) point: 600±50 ms
%% Cell type:code id: tags:
``` python
timestamp_dct = {'FGC': timestamp_fgc, 'PIC': min(timestamp_pic), 'EE_EVEN': timestamp_ee_even, 'EE_ODD': timestamp_ee_odd}
rb_analysis.create_timestamp_table(timestamp_dct)
```
%% Cell type:markdown id: tags:
## 3.2. Reference
Table below contains reference timestamps of signals used for comparison to the analyzed FPA. The reference comes as the last PNO.b2 HWC test with activation of EE systems and no magnets quenching.
source_timestamp_qds_df['iqps_board_type'] = iqps_board_type_df['iqps_board_type']
%% Cell type:code id: tags:
u_qds_dfs = rb_query.query_voltage_logic_iqps(source_timestamp_qds_df=source_timestamp_qds_df, signal_names=['U_QS0', 'U_1', 'U_2'], filter_window=3)
``` python
timestamp_ref_dct = {'FGC': timestamp_fgc_ref,
'EE_ODD_first': source_timestamp_ee_odd_ref_df.loc[0, 'timestamp'], 'EE_ODD_second': source_timestamp_ee_odd_ref_df.loc[1, 'timestamp'],
'EE_EVEN_first': source_timestamp_ee_even_ref_df.loc[0, 'timestamp'], 'EE_EVEN_second': source_timestamp_ee_even_ref_df.loc[1, 'timestamp']}
rb_analysis.create_ref_timestamp_table(timestamp_ref_dct)
rb_analysis = RbCircuitAnalysis(circuit_type, None, is_automatic=is_automatic)
```
%% Cell type:markdown id: tags:
# 5. PIC
## 5.1. Analysis of the PIC Timestamp
*ANALYSIS*:
- Show warning if the two PIC timestamps differ by more than a 1 ms.
# PIC & Power Converter
%% Cell type:code id: tags:
``` python
rb_analysis.analyze_pic(timestamp_pic)
```
%% Cell type:markdown id: tags:
# 6. Power Converter
## 6.1. 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{\partial \text{I_MEAS}}{\partial_t}
\end{equation}
*CRITERIA*
- Characteristic time of pseudo-exponential decay of I_MEAS from t=1 to 120 s: 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:
## 6.2. Analysis of the Power Converter Earth Current
*CRITERIA*:
- Checks whether for t > 3 s, I_EARTH_PCNT is within +/-3 % w.r.t. the reference
*PLOT*:
t = 0 s corresponds to respective (actual and reference) FGC PM timestamps
First plot (absolute scale)
- The main power converter current on the left axis, I_A
- Actual and reference earth current on the right axis, IEARTH
Second plot (percentage scale)
- The main power converter current on the left axis, I_MEAS
- Actual and reference earth current on the right axis, I_EARTH_PCNT; I_EARTH_PCNT scaled according to the peak value of the main reference current
%% Cell type:code id: tags:
``` python
rb_analysis.analyze_i_earth_pc(circuit_type, timestamp_fgc, i_a_df, i_earth_df, i_earth_ref_df, xlim=(-1, 5))
```
%% Cell type:code id: tags:
``` python
rb_analysis.analyze_i_earth_pcnt_pc(circuit_type, circuit_name, timestamp_fgc, i_meas_df, i_meas_ref_df, i_earth_pcnt_df, i_earth_pcnt_ref_df, xlim=(-50, 350))
```
%% Cell type:markdown id: tags:
# 7. Energy Extraction System
## 7.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) = 0.075*I V (±10%).
- Check if the characteristic time of pseudo-exponential decay of I_MEAS from t=1 to 120 s is 110 s<-Tau <130 s
- Check if the timestamp difference between FGC and EE an odd point is 100±50 ms
The opening delay was 290±50 ms prior to YETS 2017/8
- Check if the time stamp difference between FGC and EE an even point: 600±50 ms
*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)
```
# Analysis of Quench Detection Voltage
%% Cell type:code id: tags:
``` python
rb_analysis.analyze_delay_time_u_dump_res_ee(circuit_name, timestamp_fgc, 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:markdown id: tags:
## 7.2. Analysis of the Energy Extraction Temperature
*CRITERIA*
- Checks whether temperature profile is +/-25 K w.r.t. the reference temperature profile
- Checks whether maximum temperatures are within [100, 200] K range
*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.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.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:
# 8. Quench Protection System
<img src="https://gitlab.cern.ch/LHCData/lhc-sm-hwc/raw/master/figures/rb/RB_QPS_Signals.png" width=75%>
The table below shows the sign of the resistive voltages and inductive voltages (for positive ramp rate) of U1 and U2. U_QS0=-U1-U2.
|Circuit |Resistive voltage U1 |Resistive voltage U2 |Inductive voltage U1 |Inductive voltage U2|
|-----------|-----------------------|-----------------------|-----------------------|--------------------|
|RB.A12 |Pos |Neg |Pos |Neg|
|RB.A23 |Neg |Pos |Neg |Pos|
|RB.A34 |Neg |Pos |Neg |Pos|
|RB.A45 |Neg |Pos |Neg |Pos|
|RB.A56 |Pos |Neg |Pos |Neg|
|RB.A67 |Pos |Neg |Pos |Neg|
|RB.A78 |Pos |Neg |Pos |Neg|
|RB.A81 |Neg |Pos |Neg |Pos|
The thresholds and evaluation times for the QPS on the RB circuits are given in the following table:
|Class |System |Threshold |Evaluation time |Signal |Comment|
|-------|-------|-----------|-------------------|-------|:------|
|DQAMCNMB_PMSTD |iQPS, DQQDL |100 mV |10 ms discrimination |U_QS0 |Old QPS. Detection of quench in one aperture based upon voltage difference between both apertures in same magnet U_QS0 >10 ms above threshold, otherwise discriminator is reset|
|DQAMCNMB_PMHSU |iQPS, nQPS |-|-|-|Firing of quench heaters by quench protection. Generation of PM buffers sometimes happens even if there is no heater firing.|
|DQAMGNSRB (slow sampling rate), DQAMGNSRB_PMREL (fast sampling rate) |nQPS, DQQDS |500 mV * |>20 ms moving average +1 ms discrimination |U_DIODE |New QPS. Detection of quench in both apertures based upon comparing voltage across the magnet (bypass diode) from 3 magnets in same half-cell and one reference from adjacent half-cell. 50Hz notch moving average filter (20ms worst case). The signals in the 2 classes are identical, only the sampling rate differs. The data with the slow sampling rate is no longer generated as they can be found in the logging database. The recording of data is usually triggered during a FPA, depending on current in circuit, and always when a symmetric quench occurs. The PM buffers are only sent if the DQAMGNS crate trips (what ever the reason).|
|DQAMGNSRB |nQPS, DQQBS| 4 mV | >10 s moving average | U_RES |New QPS. Busbar protection. The signal is not compensated for inductive voltage during ramp.|
|DQAMGNDRB_EVEN, DQAMGNDRB_ODD |iQPS, DQQDC |1 mV, 100 mV |1 s |U_HTS, U_RES |Old QPS. Leads protection. U_HTS is for the high temperature superconducting leads, and U_RES is for the room temperature leads.|
|DQAMGNDRB_EVEN, DQAMGNDRB_ODD |iQPS, DQQDB |+200 V | -50 V | U_BB1, U_BB2 |Old QPS. U_BB1 is the total voltage across the sector. U_BB2 is the voltage across the energy extraction (EE)|
|DQAMSNRB |-|-|-|-|Opening of energy extraction (EE) switches during fast power abort (FPA). 2 EE switches per sector. One for "even" points (EE2). One for "odd" points (EE1).|
*: It was 800 mV before LS1. After LS1 we changed it to 300 or 400 mV. During the training after LS1 we increased it to 500 mV.
%% Cell type:markdown id: tags:
## 8.1. Plot of Voltage Across All Magnets (U_DIODE_RB)
*PLOT*:
t = 0 s corresponds to the PM timestamp of the FGC
First plot (global)
- the power converter current on the left axis, I_MEAS
- diode voltage on the right axis, U_DIODE_RB
Second plot (zoom)
- the power converter current on the left axis, I_MEAS
- diode voltage on the right axis, U_DIODE_RB
%% Cell type:code id: tags:
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
``` python
rb_analysis.analyze_u_diode_nqps(circuit_name, timestamp_fgc, i_meas_df, u_diode_rb_dfs, 'U_DIODE_RB', 'DIODE_RB', xlim=(-5, 350))
```
source_timestamp_qds_df.rename(columns={'source': 'magnet', 'timestamp': 'timestamp_iqps'}, inplace=True)
%% Cell type:code id: tags:
rb_analysis.calc_min_max_iqps_u_qs0(u_qds_dfs, source_timestamp_qds_df, timestamp_fgc)
source_timestamp_qds_df['datetime_iqps'] = source_timestamp_qds_df['timestamp_iqps'].apply(lambda row:Time.to_string_short(row))
``` python
rb_analysis.analyze_u_diode_nqps(circuit_name, timestamp_fgc, i_meas_df, u_diode_rb_dfs, 'U_DIODE_RB', 'DIODE_RB', xlim=(-2, 3))
source_timestamp_qds_df.sort_values(['elec_position', 'iqps_board_type'])
```
%% Cell type:markdown id: tags:
## 8.3. Analysis of Quench Detection Voltage and Logic Signals for Quenched Magnets
%% Cell type:markdown id: tags:
*ANALYSIS*:
- finds the min and max value of U_QS0
*PLOT*:
t = 0 s corresponds to the PM timestamp of the QDS
Upper (iQPS analog signals)
- the quench detection voltage on the left axis, U_QS0
- the green box denotes an envelope of the +/- 100 mV quench detection threshold
%% Cell type:code id: tags:
``` python
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
rb_analysis.calc_min_max_iqps_u_qs0(u_qds_dfs, source_timestamp_qds_df, timestamp_fgc)
source_timestamp_qds_df['datetime_iqps'] = source_timestamp_qds_df['timestamp_iqps'].apply(lambda row:Time.to_string_short(row))
source_timestamp_qds_df
```
# Interactive plots of U_QS0
%% Cell type:code id: tags:
``` python
%matplotlib notebook
rb_analysis.display_qps_signal_browser(u_qds_dfs, source_timestamp_qds_df, timestamp_fgc)
```
%% Cell type:markdown id: tags:
## 8.4. Plot of Voltage Feelers
*ANALYSIS*:
- if the voltage of a voltage feeler is equal to 0 V, then it means that the corresponding card is disabled
- if the voltage of a voltage feeler is equal to -2000 V, then it means that the corresponding card is not communicating
*PLOT*:
t = 0 s corresponds to the PM timestamp of the FGC
First plot (global)
- the power converter current on the left axis, I_MEAS
- earth voltage on the right axis, U_EARTH_RB
Second plot (zoom)
- the power converter current on the left axis, I_MEAS
- earth voltage on the right axis, U_EARTH_RB
# Dataframes to be saved to CSV
%% Cell type:code id: tags:
``` python
# rb_analysis.analyze_voltage_feelers(circuit_name, timestamp_fgc, i_meas_df, u_earth_rb_dfs, 'U_EARTH_RB', 'VF')
from copy import deepcopy
results_0_df = deepcopy(source_timestamp_qds_df[source_timestamp_qds_df['iqps_board_type']=='0'].sort_values(['elec_position']).reset_index(drop=True))
results_0_df['U_QS0_max'] = results_0_df['U_QS0_max'].map('{:.3f}'.format)
results_0_df['t_U_QS0_max'] = results_0_df['t_U_QS0_max'].map('{:.3f}'.format)
results_0_df['U_QS0_min'] = results_0_df['U_QS0_min'].map('{:.3f}'.format)
results_0_df['t_U_QS0_min'] = results_0_df['t_U_QS0_min'].map('{:.3f}'.format)
results_1_df = deepcopy(source_timestamp_qds_df[source_timestamp_qds_df['iqps_board_type']=='1'].sort_values(['elec_position']).reset_index(drop=True))
results_1_df['U_QS0_max'] = results_1_df['U_QS0_max'].map('{:.3f}'.format)
results_1_df['t_U_QS0_max'] = results_1_df['t_U_QS0_max'].map('{:.3f}'.format)
results_1_df['U_QS0_min'] = results_1_df['U_QS0_min'].map('{:.3f}'.format)
results_1_df['t_U_QS0_min'] = results_1_df['t_U_QS0_min'].map('{:.3f}'.format)
```
%% Cell type:markdown id: tags:
# 9. Final Report
# Final Report
%% Cell type:code id: tags:
%% Cell type:code id: tags:ignore
``` python
analysis_start_time = Time.get_analysis_start_time()
date_time_fgc = Time.to_datetime(timestamp_fgc).strftime("%Y-%m-%d-%Hh%M")
!mkdir -p /eos/project/m/mp3/RB/$circuit_name/FPA
file_name = "{}_FPA_SNAP-{}-{}".format(circuit_name, date_time_fgc, analysis_start_time)
iqps_board_type = '0'
full_path = '/eos/project/m/mp3/RB/{}/FPA/{}_{}.csv'.format(circuit_name, file_name, iqps_board_type)
results_0_df.to_csv(full_path, index=False)
print('Board 0 results table saved to (Windows): ' + '\\\\cernbox-smb' + full_path.replace('/', '\\'))
iqps_board_type = '1'
full_path = '/eos/project/m/mp3/RB/{}/FPA/{}_{}.csv'.format(circuit_name, file_name, iqps_board_type)
results_1_df.to_csv(full_path, index=False)
print('Board 1 results table saved to (Windows): ' + '\\\\cernbox-smb' + full_path.replace('/', '\\'))
apply_report_template()
file_name_html = file_name + '.html'
full_path = '/eos/project/m/mp3/RB/{}/FPA/{}.html'.format(circuit_name, file_name)
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_FPA_SNAP.ipynb' --output /eos/project/m/mp3/RB/$circuit_name/FPA/$file_name_html --TemplateExporter.exclude_input=True --TagRemovePreprocessor.remove_all_outputs_tags='["skip_output"]' --TagRemovePreprocessor.remove_cell_tags='["skip_cell"]'
```
%% Cell type:code id: tags:
``` python
!{sys.executable} -m jupyter nbconvert --to html $'AN_RB_FPA_SNAP_local.ipynb' --output /eos/project/m/mp3/RB/$circuit_name/FPA/$file_name_html --TemplateExporter.exclude_input=True --TagRemovePreprocessor.remove_all_outputs_tags='["skip_output"]' --TagRemovePreprocessor.remove_cell_tags='["skip_cell"]'
```
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -91,7 +91,6 @@ RQ_NOTEBOOKS = [
HWC_NOTEBOOKS = [nb for notebooks in [RQ_NOTEBOOKS, RB_NOTEBOOKS, NQPS_NOTEBOOKS, IT_NOTEBOOKS,
IPQ_NOTEBOOKS, IPD_NOTEBOOKS, PGC_NOTEBOOKS] for nb in notebooks]
# TODO [SIGMON-207] add Zinur's AN_RB_FPA_SNAP
FGC_SEARCH_NOTEBOOKS = [
('600A', 'AN_600A_with_without_EE_FPA', 'RQS.R8B2', 1619628657780000000),
('60A', 'AN_60A_FPA', 'RCBH11.L8B1', 1611775844600000000),
......@@ -100,7 +99,7 @@ FGC_SEARCH_NOTEBOOKS = [
('ipq', 'AN_IPQ_FPA', 'RQ10.L4', 1614319551500000000),
('it', 'AN_IT_FPA', 'RQX.L5', 1611929411340000000),
('rb', 'AN_RB_FPA', 'RB.A12', 1622876168900000000),
# ('rb', 'AN_RB_FPA_SNAP'),
('rb', 'AN_RB_FPA_SNAP', 'RB.A12', 1620970127420000000)
]
FGC_2_SEARCH_NOTEBOOKS = [
......
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