Commit 741c981b authored by Aleksandra Mnich's avatar Aleksandra Mnich
Browse files

Merge branch 'dev' of ssh://gitlab.cern.ch:7999/LHCData/lhc-sm-hwc into...

Merge branch 'dev' of ssh://gitlab.cern.ch:7999/LHCData/lhc-sm-hwc into SIGMON-225_update_AN_RB_PLI1.d2

 Conflicts:
	rb/AN_RB_PLI1.d2.ipynb
parents ede76ed4 fedb019e
Pipeline #3153480 canceled with stage
......@@ -31,27 +31,28 @@
%% Cell type:code id: tags:
``` python
# External libraries
print('Loading (1/15)'); import pandas as pd
print('Loading (2/15)'); import numpy as np
print('Loading (3/15)'); import sys
print('Loading (4/15)'); from IPython.display import display, Javascript, clear_output, HTML
print('Loading (1/16)'); import pandas as pd
print('Loading (2/16)'); import numpy as np
print('Loading (3/16)'); import sys
print('Loading (4/16)'); from IPython.display import display, Javascript, clear_output, HTML
# Internal libraries
print('Loading (5/15)'); import lhcsmapi
print('Loading (6/15)'); from lhcsmapi.Time import Time
print('Loading (7/15)'); from lhcsmapi.Timer import Timer
print('Loading (8/15)'); from lhcsmapi.analysis.R600ACircuitQuery import R600ACircuitQuery
print('Loading (9/15)'); from lhcsmapi.analysis.R600ACircuitAnalysis import R600ACircuitAnalysis
print('Loading (10/15)'); from lhcsmapi.analysis.expert_input import get_expert_decision
print('Loading (11/15)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (12/15)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule
print('Loading (13/15)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator
print('Loading (14/15)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata
print('Loading (15/15)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType
print('Loading (5/16)'); import lhcsmapi
print('Loading (6/16)'); from lhcsmapi.Time import Time
print('Loading (7/16)'); from lhcsmapi.Timer import Timer
print('Loading (8/16)'); from lhcsmapi.analysis.R600ACircuitQuery import R600ACircuitQuery
print('Loading (9/16)'); from lhcsmapi.analysis.R600ACircuitAnalysis import R600ACircuitAnalysis
print('Loading (10/16)'); from lhcsmapi.analysis.expert_input import get_expert_decision
print('Loading (11/16)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (12/16)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule
print('Loading (13/16)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator
print('Loading (14/16)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata
print('Loading (15/16)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType
print('Loading (16/16)'); import lhcsmnb.utils
clear_output()
lhcsmapi.get_lhcsmapi_version()
lhcsmapi.get_lhcsmhwc_version('../__init__.py')
```
......@@ -120,15 +121,15 @@
u_res_nxcals_rcbxv_df = query_rcbxv.query_iqps_nxcals(timestamp_fgc_rcbxv, signal_names=['U_RES'], spark=spark)[0]
# QDS PM
# # RCBXH
source_timestamp_qds_rcbxh_df = query_rcbxh.find_source_timestamp_qds_board_ab(timestamp_fgc_rcbxh, duration=[(2, 's'), (2, 's')])
timestamp_qds_rcbxh = np.nan if source_timestamp_qds_rcbxh_df.empty else source_timestamp_qds_rcbxh_df.loc[0, 'timestamp']
timestamp_qds_rcbxh = lhcsmnb.utils.get_at(source_timestamp_qds_rcbxh_df, 0, 'timestamp', default=np.nan)
i_dcct_rcbxh_df, i_didt_rcbxh_df, u_res_rcbxh_df, u_diff_rcbxh_df = query_rcbxh.query_qds_pm(timestamp_qds_rcbxh, timestamp_qds_rcbxh, signal_names=['I_DCCT', 'I_DIDT', 'U_RES', 'U_DIFF'])
# # RCBXV
source_timestamp_qds_rcbxv_df = query_rcbxv.find_source_timestamp_qds_board_ab(timestamp_fgc_rcbxv, duration=[(2, 's'), (2, 's')])
timestamp_qds_rcbxv = np.nan if source_timestamp_qds_rcbxv_df.empty else source_timestamp_qds_rcbxv_df.loc[0, 'timestamp']
timestamp_qds_rcbxv = lhcsmnb.utils.get_at(source_timestamp_qds_rcbxv_df, 0, 'timestamp', default=np.nan)
i_dcct_rcbxv_df, i_didt_rcbxv_df, u_res_rcbxv_df, u_diff_rcbxv_df = query_rcbxv.query_qds_pm(timestamp_qds_rcbxv, timestamp_qds_rcbxv, signal_names=['I_DCCT', 'I_DIDT', 'U_RES', 'U_DIFF'])
# LEADS
# # RCBXH
leads_name = [x for x in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_names[0]) if 'LEADS' in x][0]
source_timestamp_leads_rcbxh_df = query_rcbxh.find_timestamp_leads(timestamp_fgc_rcbxh, leads_name)
......@@ -165,14 +166,14 @@
%% Cell type:code id: tags:
``` python
timestamp_dct = {'FGC_RCBXH': timestamp_fgc_rcbxh, 'FGC_RCBXV': timestamp_fgc_rcbxv,
'PIC_RCBXH': timestamp_pic_rcbxh, 'PIC_RCBXV': timestamp_pic_rcbxv,
'QDS_A_RCBXH':source_timestamp_qds_rcbxh_df.loc[0, 'timestamp'] if len(source_timestamp_qds_rcbxh_df) > 0 else np.nan,
'QDS_B_RCBXH':source_timestamp_qds_rcbxh_df.loc[1, 'timestamp'] if len(source_timestamp_qds_rcbxh_df) > 1 else np.nan,
'QDS_A_RCBXV':source_timestamp_qds_rcbxv_df.loc[0, 'timestamp'] if len(source_timestamp_qds_rcbxv_df) > 0 else np.nan,
'QDS_B_RCBXV':source_timestamp_qds_rcbxv_df.loc[1, 'timestamp'] if len(source_timestamp_qds_rcbxv_df) > 1 else np.nan}
'QDS_A_RCBXH':lhcsmnb.utils.get_at(source_timestamp_qds_rcbxh_df, 0, 'timestamp', default=np.nan),
'QDS_B_RCBXH':lhcsmnb.utils.get_at(source_timestamp_qds_rcbxh_df, 1, 'timestamp', default=np.nan),
'QDS_A_RCBXV':lhcsmnb.utils.get_at(source_timestamp_qds_rcbxv_df, 0, 'timestamp', default=np.nan),
'QDS_B_RCBXV':lhcsmnb.utils.get_at(source_timestamp_qds_rcbxv_df, 1, 'timestamp', default=np.nan)}
analysis_rcbxh.create_timestamp_table(timestamp_dct, circuit_name=circuit_names[0])
```
%% Cell type:markdown id: tags:
......
......@@ -29,27 +29,28 @@
%% Cell type:code id: tags:
``` python
# External libraries
print('Loading (1/15)'); import pandas as pd
print('Loading (2/15)'); import numpy as np
print('Loading (3/15)'); import sys
print('Loading (4/15)'); from IPython.display import display, Javascript, clear_output, HTML
print('Loading (1/16)'); import pandas as pd
print('Loading (2/16)'); import numpy as np
print('Loading (3/16)'); import sys
print('Loading (4/16)'); from IPython.display import display, Javascript, clear_output, HTML
# Internal libraries
print('Loading (5/15)'); import lhcsmapi
print('Loading (6/15)'); from lhcsmapi.Time import Time
print('Loading (7/15)'); from lhcsmapi.Timer import Timer
print('Loading (8/15)'); from lhcsmapi.analysis.R600ACircuitQuery import R600ACircuitQuery
print('Loading (9/15)'); from lhcsmapi.analysis.R600ACircuitAnalysis import R600ACircuitAnalysis
print('Loading (10/15)'); from lhcsmapi.analysis.expert_input import get_expert_decision
print('Loading (11/15)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (12/15)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule
print('Loading (13/15)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator
print('Loading (14/15)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata
print('Loading (15/15)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType
print('Loading (5/16)'); import lhcsmapi
print('Loading (6/16)'); from lhcsmapi.Time import Time
print('Loading (7/16)'); from lhcsmapi.Timer import Timer
print('Loading (8/16)'); from lhcsmapi.analysis.R600ACircuitQuery import R600ACircuitQuery
print('Loading (9/16)'); from lhcsmapi.analysis.R600ACircuitAnalysis import R600ACircuitAnalysis
print('Loading (10/16)'); from lhcsmapi.analysis.expert_input import get_expert_decision
print('Loading (11/16)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (12/16)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule
print('Loading (13/16)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator
print('Loading (14/16)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata
print('Loading (15/16)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType
print('Loading (16/16)'); import lhcsmnb.utils
clear_output()
lhcsmapi.get_lhcsmapi_version()
lhcsmapi.get_lhcsmhwc_version('../__init__.py')
```
......@@ -119,23 +120,23 @@
# EE
# # RCD
source_timestamp_ee_rcd_df = query_rcd.find_source_timestamp_ee(timestamp_fgc_rcd)
if not source_timestamp_ee_rcd_df.empty:
timestamp_ee_rcd = source_timestamp_ee_rcd_df.loc[0, 'timestamp']
timestamp_ee_rcd = lhcsmnb.utils.get_at(source_timestamp_ee_rcd_df, 0, 'timestamp')
u_dump_res_rcd_df = query_rcd.query_ee_u_dump_res_pm(timestamp_ee_rcd, timestamp_fgc_rcd, system='EE', signal_names=['U_DUMP_RES'])[0]
else:
timestamp_ee_rcd = float('nan')
# QDS PM
# # RCD
source_timestamp_qds_rcd_df = query_rcd.find_source_timestamp_qds_board_ab(timestamp_fgc_rcd, duration=[(2, 's'), (2, 's')])
timestamp_qds_rcd = np.nan if source_timestamp_qds_rcd_df.empty else source_timestamp_qds_rcd_df.loc[0, 'timestamp']
timestamp_qds_rcd = lhcsmnb.utils.get_at(source_timestamp_qds_rcd_df, 0, 'timestamp', np.nan)
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, signal_names=['I_DCCT', 'I_DIDT', 'U_RES', 'U_DIFF'])
# # RCO
source_timestamp_qds_rco_df = query_rco.find_source_timestamp_qds_board_ab(timestamp_fgc_rco, duration=[(2, 's'), (2, 's')])
timestamp_qds_rco = np.nan if source_timestamp_qds_rco_df.empty else source_timestamp_qds_rco_df.loc[0, 'timestamp']
timestamp_qds_rco = lhcsmnb.utils.get_at(source_timestamp_qds_rco_df, 0, 'timestamp', np.nan)
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, signal_names=['I_DCCT', 'I_DIDT', 'U_RES', 'U_DIFF'])
# LEADS
# # RCD
leads_name = [x for x in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_names[0]) if 'LEADS' in x][0]
......@@ -157,14 +158,14 @@
analysis_rco = R600ACircuitAnalysis(circuit_type, results_table, is_automatic=is_automatic)
timestamp_dct = {'FGC_RCD': timestamp_fgc_rcd, 'FGC_RCO': timestamp_fgc_rco,
'PIC_RCD': timestamp_pic_rcd, 'PIC_RCO': timestamp_pic_rco,
'EE_RCD': timestamp_ee_rcd,
'QDS_A_RCD':source_timestamp_qds_rcd_df.loc[0, 'timestamp'] if len(source_timestamp_qds_rcd_df) > 0 else np.nan,
'QDS_B_RCD':source_timestamp_qds_rcd_df.loc[1, 'timestamp'] if len(source_timestamp_qds_rcd_df) > 1 else np.nan,
'QDS_A_RCO':source_timestamp_qds_rco_df.loc[0, 'timestamp'] if len(source_timestamp_qds_rco_df) > 0 else np.nan,
'QDS_B_RCO':source_timestamp_qds_rco_df.loc[1, 'timestamp'] if len(source_timestamp_qds_rco_df) > 1 else np.nan}
'QDS_A_RCD':lhcsmnb.utils.get_at(source_timestamp_qds_rcd_df, 0, 'timestamp', default=np.nan),
'QDS_B_RCD':lhcsmnb.utils.get_at(source_timestamp_qds_rcd_df, 1, 'timestamp', default=np.nan),
'QDS_A_RCO':lhcsmnb.utils.get_at(source_timestamp_qds_rco_df, 0, 'timestamp', default=np.nan),
'QDS_B_RCO':lhcsmnb.utils.get_at(source_timestamp_qds_rco_df, 1, 'timestamp', default=np.nan)}
```
%% Cell type:markdown id: tags:
# 3. Timestamps
......
......@@ -29,27 +29,28 @@
%% Cell type:code id: tags:
``` python
# External libraries
print('Loading (1/15)'); import pandas as pd
print('Loading (2/15)'); import numpy as np
print('Loading (3/15)'); import sys
print('Loading (4/15)'); from IPython.display import display, Javascript, clear_output, HTML
print('Loading (1/16)'); import pandas as pd
print('Loading (2/16)'); import numpy as np
print('Loading (3/16)'); import sys
print('Loading (4/16)'); from IPython.display import display, Javascript, clear_output, HTML
# Internal libraries
print('Loading (5/15)'); import lhcsmapi
print('Loading (6/15)'); from lhcsmapi.Time import Time
print('Loading (7/15)'); from lhcsmapi.Timer import Timer
print('Loading (8/15)'); from lhcsmapi.analysis.R600ACircuitQuery import R600ACircuitQuery
print('Loading (9/15)'); from lhcsmapi.analysis.R600ACircuitAnalysis import R600ACircuitAnalysis
print('Loading (10/15)'); from lhcsmapi.analysis.expert_input import get_expert_decision
print('Loading (11/15)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (12/15)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule
print('Loading (13/15)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator
print('Loading (14/15)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata
print('Loading (15/15)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType
print('Loading (5/16)'); import lhcsmapi
print('Loading (6/16)'); from lhcsmapi.Time import Time
print('Loading (7/16)'); from lhcsmapi.Timer import Timer
print('Loading (8/16)'); from lhcsmapi.analysis.R600ACircuitQuery import R600ACircuitQuery
print('Loading (9/16)'); from lhcsmapi.analysis.R600ACircuitAnalysis import R600ACircuitAnalysis
print('Loading (10/16)'); from lhcsmapi.analysis.expert_input import get_expert_decision
print('Loading (11/16)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (12/16)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule
print('Loading (13/16)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator
print('Loading (14/16)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata
print('Loading (15/16)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType
print('Loading (16/16)'); import lhcsmnb.utils
clear_output()
lhcsmapi.get_lhcsmapi_version()
lhcsmapi.get_lhcsmhwc_version('../__init__.py')
```
......@@ -104,22 +105,22 @@
# EE
if 'EE' in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_name):
query.max_executions += 2
source_timestamp_ee_df = query.find_source_timestamp_ee(timestamp_fgc)
timestamp_ee = source_timestamp_ee_df.loc[0, 'timestamp']
timestamp_ee = lhcsmnb.utils.get_at(source_timestamp_ee_df, 0, 'timestamp')
u_dump_res_df = query.query_ee_u_dump_res_pm(timestamp_ee, timestamp_fgc, system='EE', signal_names=['U_DUMP_RES'])[0]
else:
source_timestamp_ee_df = pd.DataFrame()
# QDS
# To check if there was any drift of QDS cards prior to the trigger
i_meas_nxcals_df = query.query_pc_nxcals(timestamp_fgc, signal_names=['I_MEAS'], spark=spark)[0]
u_res_nxcals_df = query.query_iqps_nxcals(timestamp_fgc, signal_names=['U_RES'], spark=spark)[0]
source_timestamp_qds_df = query.find_source_timestamp_qds_board_ab(timestamp_fgc, duration=[(2, 's'), (2, 's')])
timestamp_qds = np.nan if source_timestamp_qds_df.empty else source_timestamp_qds_df.loc[0, 'timestamp']
timestamp_qds = lhcsmnb.utils.get_at(source_timestamp_qds_df, 0, 'timestamp', default=np.nan)
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'])
# LEADS
leads_name = [x for x in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_name) if 'LEADS' in x][0]
source_timestamp_leads_df = query.find_timestamp_leads(timestamp_fgc, leads_name)
......@@ -128,14 +129,14 @@
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')])
analysis = R600ACircuitAnalysis(circuit_type, results_table, is_automatic=is_automatic)
timestamp_dct = {'FGC': timestamp_fgc, 'PIC': timestamp_pic,
'QDS_A': source_timestamp_qds_df.loc[0, 'timestamp'] if len(source_timestamp_qds_df) > 0 else np.nan,
'QDS_B': source_timestamp_qds_df.loc[1, 'timestamp'] if len(source_timestamp_qds_df) > 1 else np.nan}
'QDS_A': lhcsmnb.utils.get_at(source_timestamp_qds_df, 0, 'timestamp', default=np.nan),
'QDS_B': slhcsmnb.utils.get_at(source_timestamp_qds_df, 1, 'timestamp', default=np.nan)}
if 'EE' in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_name):
timestamp_dct['EE'] = source_timestamp_ee_df.loc[0, 'timestamp'] if len(source_timestamp_ee_df) > 0 else np.nan
timestamp_dct['EE'] = lhcsmnb.utils.get_at(source_timestamp_ee_df, 0, 'timestamp', default=np.nan)
```
%% Cell type:markdown id: tags:
# 3. Timestamps
......
......@@ -55,25 +55,26 @@
%% Cell type:code id: tags:
``` python
# External libraries
print('Loading (1/13)'); import pandas as pd
print('Loading (2/13)'); import sys
print('Loading (3/13)'); from IPython.display import display, Javascript, clear_output, HTML
print('Loading (1/14)'); import pandas as pd
print('Loading (2/14)'); import sys
print('Loading (3/14)'); from IPython.display import display, Javascript, clear_output, HTML
# Internal libraries
print('Loading (4/13)'); import lhcsmapi
print('Loading (5/13)'); from lhcsmapi.Time import Time
print('Loading (6/13)'); from lhcsmapi.Timer import Timer
print('Loading (7/13)'); from lhcsmapi.analysis.IpdCircuitQuery import IpdCircuitQuery
print('Loading (8/13)'); from lhcsmapi.analysis.IpdCircuitAnalysis import IpdCircuitAnalysis
print('Loading (9/13)'); from lhcsmapi.analysis.expert_input import get_expert_decision
print('Loading (10/13)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (11/13)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule
print('Loading (12/13)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator
print('Loading (13/13)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType
print('Loading (4/14)'); import lhcsmapi
print('Loading (5/14)'); from lhcsmapi.Time import Time
print('Loading (6/14)'); from lhcsmapi.Timer import Timer
print('Loading (7/14)'); from lhcsmapi.analysis.IpdCircuitQuery import IpdCircuitQuery
print('Loading (8/14)'); from lhcsmapi.analysis.IpdCircuitAnalysis import IpdCircuitAnalysis
print('Loading (9/14)'); from lhcsmapi.analysis.expert_input import get_expert_decision
print('Loading (10/14)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (11/14)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule
print('Loading (12/14)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator
print('Loading (13/14)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType
print('Loading (14/14)'); import lhcsmnb.utils
clear_output()
lhcsmapi.get_lhcsmapi_version()
lhcsmapi.get_lhcsmhwc_version('../__init__.py')
```
......@@ -123,11 +124,11 @@
# PIC
timestamp_pic = query.find_timestamp_pic(timestamp_fgc, spark=spark)
# QDS
source_timestamp_qds_df = query.find_source_timestamp_qds_board_ab(timestamp_fgc, duration=[(2, 's'), (2, 's')])
timestamp_qds = float('nan') if source_timestamp_qds_df.empty else source_timestamp_qds_df.loc[0, 'timestamp']
timestamp_qds = lhcsmnb.utils.get_at( source_timestamp_qds_df, 0, 'timestamp', float('nan'))
signal_names = ['U_1_B1', 'U_2_B1', 'U_RES_B1'] if query.circuit_type == 'IPD2_B1B2' else ['U_1', 'U_2', 'U_RES']
u_1_df, u_2_df, u_res_df = query.query_qds_pm(timestamp_qds, timestamp_fgc, signal_names=signal_names)
# QH
......@@ -145,12 +146,12 @@
# Results Table
results_table = query.create_report_analysis_template(timestamp_fgc=timestamp_fgc, init_file_path='../__init__.py', author=author)
analysis = IpdCircuitAnalysis(query.circuit_type, results_table)
timestamp_dct = {'FGC': timestamp_fgc, 'PIC': timestamp_pic,
'QDS_A':source_timestamp_qds_df.loc[0, 'timestamp'] if len(source_timestamp_qds_df) > 0 else float('nan'),
'QDS_B':source_timestamp_qds_df.loc[1, 'timestamp'] if len(source_timestamp_qds_df) > 1 else float('nan')}
'QDS_A':lhcsmnb.utils.get_at(source_timestamp_qds_df, 0, 'timestamp', default=float('nan')),
'QDS_B':lhcsmnb.utils.get_at(source_timestamp_qds_df, 1, 'timestamp', default=float('nan'))}
```
%% Cell type:markdown id: tags:
......
......@@ -65,24 +65,25 @@
%% Cell type:code id: tags:
``` python
# External libraries
print('Loading (1/12)'); import sys
print('Loading (2/12)'); import pandas as pd
print('Loading (3/12)'); from IPython.display import display, Javascript, clear_output
print('Loading (1/13)'); import sys
print('Loading (2/13)'); import pandas as pd
print('Loading (3/13)'); from IPython.display import display, Javascript, clear_output
# Internal libraries
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.IpdCircuitQuery import IpdCircuitQuery
print('Loading (8/12)'); from lhcsmapi.analysis.IpdCircuitAnalysis import IpdCircuitAnalysis
print('Loading (9/12)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (10/12)'); from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator
print('Loading (11/12)'); from lhcsmapi.pyedsl.PlotBuilder import create_hwc_plot_title_with_circuit_name
print('Loading (12/12)'); from lhcsmapi.analysis.expert_input import get_expert_decision
print('Loading (4/13)'); import lhcsmapi
print('Loading (5/13)'); from lhcsmapi.Time import Time
print('Loading (6/13)'); from lhcsmapi.Timer import Timer
print('Loading (7/13)'); from lhcsmapi.analysis.IpdCircuitQuery import IpdCircuitQuery
print('Loading (8/13)'); from lhcsmapi.analysis.IpdCircuitAnalysis import IpdCircuitAnalysis
print('Loading (9/13)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (10/13)'); from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator
print('Loading (11/13)'); from lhcsmapi.pyedsl.PlotBuilder import create_hwc_plot_title_with_circuit_name
print('Loading (12/13)'); from lhcsmapi.analysis.expert_input import get_expert_decision
print('Loading (13/13)'); import lhcsmnb.utils
clear_output()
lhcsmapi.get_lhcsmapi_version()
lhcsmapi.get_lhcsmhwc_version('../__init__.py')
print('Analysis performed by %s' % HwcSearchModuleMediator.get_user())
......@@ -153,11 +154,11 @@
# PIC
timestamp_pic = query.find_timestamp_pic(timestamp_fgc, spark=spark)
# QDS
source_timestamp_qds_df = query.find_source_timestamp_qds_board_ab(timestamp_fgc, duration=[(2, 's'), (2, 's')])
timestamp_qds = float('nan') if source_timestamp_qds_df.empty else source_timestamp_qds_df.loc[0, 'timestamp']
timestamp_qds = lhcsmnb.utils.get_at(source_timestamp_qds_df, 0, 'timestamp', default=float('nan'))
signal_names = 'U_RES_B1' if query.circuit_type == 'IPD2_B1B2' else 'U_RES'
u_res_df = query.query_signal_nxcals(t_start, t_end, t0=timestamp_fgc, system='QDS', signal_names=signal_names, spark=spark)[0]
# QH
......@@ -173,12 +174,12 @@
u_res_dfs = query.query_leads(timestamp_fgc, source_timestamp_qds_df.drop_duplicates('source') if not source_timestamp_qds_df.empty else pd.DataFrame(), system='LEADS', signal_names=['U_RES'], spark=spark, duration=[(t_end-t_start, 'ns')])
analysis = IpdCircuitAnalysis(query.circuit_type, pd.DataFrame())
timestamp_dct = {'FGC': timestamp_fgc, 'PIC': timestamp_pic,
'QDS_A':source_timestamp_qds_df.loc[0, 'timestamp'] if len(source_timestamp_qds_df) > 0 else float('nan'),
'QDS_B':source_timestamp_qds_df.loc[1, 'timestamp'] if len(source_timestamp_qds_df) > 1 else float('nan')}
'QDS_A':lhcsmnb.utils.get_at(source_timestamp_qds_df, 0, 'timestamp', default=float('nan')),
'QDS_B':lhcsmnb.utils.get_at(source_timestamp_qds_df, 1, 'timestamp', default=float('nan'))}
```
%% Cell type:markdown id: tags:
# 3. Timestamps
......
......@@ -72,24 +72,25 @@
%% Cell type:code id: tags:
``` python
# External libraries
print('Loading (1/12)'); import sys
print('Loading (2/12)'); import pandas as pd
print('Loading (3/12)'); from IPython.display import display, Javascript, clear_output
print('Loading (1/13)'); import sys
print('Loading (2/13)'); import pandas as pd
print('Loading (3/13)'); from IPython.display import display, Javascript, clear_output
# Internal libraries
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.IpdCircuitQuery import IpdCircuitQuery
print('Loading (8/12)'); from lhcsmapi.analysis.IpdCircuitAnalysis import IpdCircuitAnalysis
print('Loading (9/12)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (10/12)'); from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator
print('Loading (11/12)'); from lhcsmapi.pyedsl.PlotBuilder import create_hwc_plot_title_with_circuit_name
print('Loading (12/12)'); from lhcsmapi.analysis.expert_input import get_expert_decision
print('Loading (4/13)'); import lhcsmapi
print('Loading (5/13)'); from lhcsmapi.Time import Time
print('Loading (6/13)'); from lhcsmapi.Timer import Timer
print('Loading (7/13)'); from lhcsmapi.analysis.IpdCircuitQuery import IpdCircuitQuery
print('Loading (8/13)'); from lhcsmapi.analysis.IpdCircuitAnalysis import IpdCircuitAnalysis
print('Loading (9/13)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (10/13)'); from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator
print('Loading (11/13)'); from lhcsmapi.pyedsl.PlotBuilder import create_hwc_plot_title_with_circuit_name
print('Loading (12/13)'); from lhcsmapi.analysis.expert_input import get_expert_decision
print('Loading (13/13)'); import lhcsmnb.utils
clear_output()
lhcsmapi.get_lhcsmapi_version()
lhcsmapi.get_lhcsmhwc_version('../__init__.py')
print('Analysis performed by %s' % HwcSearchModuleMediator.get_user())
......@@ -160,11 +161,11 @@
# PIC
timestamp_pic = query.find_timestamp_pic(timestamp_fgc, spark=spark)
# QDS
source_timestamp_qds_df = query.find_source_timestamp_qds_board_ab(timestamp_fgc, duration=[(2, 's'), (2, 's')])
timestamp_qds = float('nan') if source_timestamp_qds_df.empty else source_timestamp_qds_df.loc[0, 'timestamp']
timestamp_qds = lhcsmnb.utils.get_at(source_timestamp_qds_df, 0, 'timestamp', default=float('nan'))
signal_names = 'U_RES_B1' if query.circuit_type == 'IPD2_B1B2' else 'U_RES'
u_res_df = query.query_signal_nxcals(t_start, t_end, t0=t_start, system='QDS', signal_names=signal_names, spark=spark)[0]
# LEADS
......@@ -172,12 +173,12 @@
u_res_dfs = query.query_leads(timestamp_fgc, source_timestamp_qds_df.drop_duplicates('source') if not source_timestamp_qds_df.empty else pd.DataFrame(), system='LEADS', signal_names=['U_RES'], spark=spark, duration=[(t_end-t_start, 'ns')])
analysis = IpdCircuitAnalysis(query.circuit_type, pd.DataFrame())
timestamp_dct = {'FGC': timestamp_fgc, 'PIC': timestamp_pic,
'QDS_A':source_timestamp_qds_df.loc[0, 'timestamp'] if len(source_timestamp_qds_df) > 0 else float('nan'),
'QDS_B':source_timestamp_qds_df.loc[1, 'timestamp'] if len(source_timestamp_qds_df) > 1 else float('nan')}
'QDS_A':lhcsmnb.utils.get_at(source_timestamp_qds_df, 0, 'timestamp', default=float('nan')),
'QDS_B':lhcsmnb.utils.get_at(source_timestamp_qds_df, 1, 'timestamp', default=float('nan'))}
```
%% Cell type:markdown id: tags:
# 3. Timestamps
......
......@@ -74,23 +74,24 @@
%% Cell type:code id: tags:
``` python
# External libraries
print('Loading (1/11)'); import pandas as pd
print('Loading (2/11)'); import sys
print('Loading (3/11)'); from IPython.display import display, Javascript, clear_output, HTML
print('Loading (1/12)'); import pandas as pd
print('Loading (2/12)'); import sys
print('Loading (3/12)'); from IPython.display import display, Javascript, clear_output, HTML
# 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.IpdCircuitQuery import IpdCircuitQuery
print('Loading (8/11)'); from lhcsmapi.analysis.IpdCircuitAnalysis import IpdCircuitAnalysis
print('Loading (9/11)'); from lhcsmapi.analysis.expert_input import get_expert_decision
print('Loading (10/11)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (11/11)'); from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator
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.IpdCircuitQuery import IpdCircuitQuery
print('Loading (8/12)'); from lhcsmapi.analysis.IpdCircuitAnalysis import IpdCircuitAnalysis
print('Loading (9/12)'); from lhcsmapi.analysis.expert_input import get_expert_decision
print('Loading (10/12)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (11/12)'); from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator
print('Loading (12/12)'); import lhcsmnb.utils
clear_output()
lhcsmapi.get_lhcsmapi_version()
lhcsmapi.get_lhcsmhwc_version('../__init__.py')
print('Analysis performed by %s' % HwcSearchModuleMediator.get_user())
......@@ -163,11 +164,11 @@
# PIC
timestamp_pic = query.find_timestamp_pic(timestamp_fgc, spark=spark)
# QDS
source_timestamp_qds_df = query.find_source_timestamp_qds_board_ab(timestamp_fgc, duration=[(2, 's'), (2, 's')])
timestamp_qds = float('nan') if source_timestamp_qds_df.empty else source_timestamp_qds_df.loc[0, 'timestamp']
timestamp_qds = lhcsmnb.utils.get_at(source_timestamp_qds_df, 0, 'timestamp', default=float('nan'))
signal_names = ['U_1_B1', 'U_2_B1', 'U_RES_B1'] if query.circuit_type == 'IPD2_B1B2' else ['U_1', 'U_2', 'U_RES']
u_1_df, u_2_df, u_res_df = query.query_qds_pm(timestamp_qds, timestamp_fgc, signal_names=signal_names)
u_res_nxcals_df = query.query_signal_nxcals(t_start, t_end, t0=timestamp_fgc, system='QDS', signal_names=signal_names[2], spark=spark)
......@@ -187,12 +188,12 @@
# Results Table
results_table = query.create_report_analysis_template(timestamp_fgc=timestamp_fgc, init_file_path='../__init__.py', author=HwcSearchModuleMediator.get_user())
analysis = IpdCircuitAnalysis(query.circuit_type, results_table)
timestamp_dct = {'FGC': timestamp_fgc, 'PIC': timestamp_pic,
'QDS_A':source_timestamp_qds_df.loc[0, 'timestamp'] if len(source_timestamp_qds_df) > 0 else float('nan'),
'QDS_B':source_timestamp_qds_df.loc[1, 'timestamp'] if len(source_timestamp_qds_df) > 1 else float('nan')}
'QDS_A':lhcsmnb.utils.get_at(source_timestamp_qds_df, 0, 'timestamp', default=float('nan')),
'QDS_B':lhcsmnb.utils.get_at(source_timestamp_qds_df, 1, 'timestamp', default=float('nan'))}
```
%% Cell type:markdown id: tags:
......
......@@ -74,24 +74,25 @@
%% Cell type:code id: tags:
``` python
# External libraries
print('Loading (1/12)'); import sys
print('Loading (2/12)'); import pandas as pd
print('Loading (3/12)'); from IPython.display import display, Javascript, clear_output
print('Loading (1/13)'); import sys
print('Loading (2/13)'); import pandas as pd
print('Loading (3/13)'); from IPython.display import display, Javascript, clear_output
# Internal libraries
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.IpdCircuitQuery import IpdCircuitQuery
print('Loading (8/12)'); from lhcsmapi.analysis.IpdCircuitAnalysis import IpdCircuitAnalysis
print('Loading (9/12)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (10/12)'); from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator
print('Loading (11/12)'); from lhcsmapi.pyedsl.PlotBuilder import create_hwc_plot_title_with_circuit_name
print('Loading (12/12)'); from lhcsmapi.analysis.expert_input import get_expert_decision
print('Loading (4/13)'); import lhcsmapi
print('Loading (5/13)'); from lhcsmapi.Time import Time
print('Loading (6/13)'); from lhcsmapi.Timer import Timer
print('Loading (7/13)'); from lhcsmapi.analysis.IpdCircuitQuery import IpdCircuitQuery
print('Loading (8/13)'); from lhcsmapi.analysis.IpdCircuitAnalysis import IpdCircuitAnalysis
print('Loading (9/13)'); from lhcsmapi.analysis.report_template import apply_report_template
print('Loading (10/13)'); from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator
print('Loading (11/13)'); from lhcsmapi.pyedsl.PlotBuilder import create_hwc_plot_title_with_circuit_name
print('Loading (12/13)'); from lhcsmapi.analysis.expert_input import get_expert_decision