Commit 7a88b937 authored by Aleksandra Mnich's avatar Aleksandra Mnich
Browse files

Merge branch 'dev' into 'master'

Release 1.5.66

See merge request !58
parents 52a93d2c c142ba6c
Pipeline #3177295 failed with stages
in 147 minutes and 56 seconds
......@@ -3,3 +3,4 @@
**.sys.v#.*
.idea/
venv
\ No newline at end of file
......@@ -90,7 +90,7 @@ notebooks_exec:
image: gitlab-registry.cern.ch/db/swan-spark-notebooks:latest
stage: test
artifacts:
when: on_failure
when: always
paths:
- report.xml
- results
......
......@@ -55,22 +55,24 @@
"outputs": [],
"source": [
"# External libraries\n",
"print('Loading (1/14)'); import pandas as pd\n",
"print('Loading (2/14)'); import numpy as np\n",
"print('Loading (3/14)'); import sys\n",
"print('Loading (4/14)'); from IPython.display import display, Javascript, clear_output, HTML\n",
"print('Loading (1/16)'); import pandas as pd\n",
"print('Loading (2/16)'); import numpy as np\n",
"print('Loading (3/16)'); import sys\n",
"print('Loading (4/16)'); from IPython.display import display, Javascript, clear_output, HTML\n",
"\n",
"# Internal libraries\n",
"print('Loading (5/14)'); import lhcsmapi\n",
"print('Loading (6/14)'); from lhcsmapi.Time import Time\n",
"print('Loading (7/14)'); from lhcsmapi.Timer import Timer\n",
"print('Loading (8/14)'); from lhcsmapi.analysis.R600ACircuitQuery import R600ACircuitQuery\n",
"print('Loading (9/14)'); from lhcsmapi.analysis.R600ACircuitAnalysis import R600ACircuitAnalysis\n",
"print('Loading (10/14)'); from lhcsmapi.analysis.expert_input import get_expert_decision\n",
"print('Loading (11/14)'); from lhcsmapi.analysis.report_template import apply_report_template\n",
"print('Loading (12/14)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule\n",
"print('Loading (13/14)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator\n",
"print('Loading (14/14)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (5/16)'); import lhcsmapi\n",
"print('Loading (6/16)'); from lhcsmapi.Time import Time\n",
"print('Loading (7/16)'); from lhcsmapi.Timer import Timer\n",
"print('Loading (8/16)'); from lhcsmapi.analysis.R600ACircuitQuery import R600ACircuitQuery\n",
"print('Loading (9/16)'); from lhcsmapi.analysis.R600ACircuitAnalysis import R600ACircuitAnalysis\n",
"print('Loading (10/16)'); from lhcsmapi.analysis.expert_input import get_expert_decision\n",
"print('Loading (11/16)'); from lhcsmapi.analysis.report_template import apply_report_template\n",
"print('Loading (12/16)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule\n",
"print('Loading (13/16)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator\n",
"print('Loading (14/16)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (15/16)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType\n",
"print('Loading (16/16)'); import lhcsmnb.utils\n",
"\n",
"clear_output()\n",
"lhcsmapi.get_lhcsmapi_version()\n",
......@@ -109,7 +111,9 @@
"execution_count": null,
"metadata": {
"deletable": false,
"scrolled": false
"tags": [
"parameters"
]
},
"outputs": [],
"source": [
......@@ -136,11 +140,14 @@
"outputs": [],
"source": [
"with Timer():\n",
" author = fgc_pm_search.get_author()\n",
" is_automatic = fgc_pm_search.is_automatic_mode()\n",
" circuit_type = '600A'\n",
" circuit_names = fgc_pm_search.get_fgc_circuit()\n",
" timestamp_fgc_rcbxh, timestamp_fgc_rcbxv = fgc_pm_search.get_fgc_timestamp()\n",
" if not are_all_parameters_injected(NbType.FGC2, locals()):\n",
" author = fgc_pm_search.get_author()\n",
" is_automatic = fgc_pm_search.is_automatic_mode()\n",
" circuit_type = '600A'\n",
" circuit_names = fgc_pm_search.get_fgc_circuit()\n",
" timestamps_fgc = fgc_pm_search.get_fgc_timestamp()\n",
" \n",
" timestamp_fgc_rcbxh, timestamp_fgc_rcbxv = timestamps_fgc\n",
" \n",
" query_rcbxh = R600ACircuitQuery(circuit_type, circuit_names[0], max_executions=9)\n",
" query_rcbxv = R600ACircuitQuery(circuit_type, circuit_names[1], max_executions=9)\n",
......@@ -169,11 +176,11 @@
" # QDS PM\n",
" # # RCBXH\n",
" source_timestamp_qds_rcbxh_df = query_rcbxh.find_source_timestamp_qds_board_ab(timestamp_fgc_rcbxh, duration=[(2, 's'), (2, 's')])\n",
" timestamp_qds_rcbxh = np.nan if source_timestamp_qds_rcbxh_df.empty else source_timestamp_qds_rcbxh_df.loc[0, 'timestamp']\n",
" timestamp_qds_rcbxh = lhcsmnb.utils.get_at(source_timestamp_qds_rcbxh_df, 0, 'timestamp', default=np.nan)\n",
" 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'])\n",
" # # RCBXV\n",
" source_timestamp_qds_rcbxv_df = query_rcbxv.find_source_timestamp_qds_board_ab(timestamp_fgc_rcbxv, duration=[(2, 's'), (2, 's')])\n",
" timestamp_qds_rcbxv = np.nan if source_timestamp_qds_rcbxv_df.empty else source_timestamp_qds_rcbxv_df.loc[0, 'timestamp']\n",
" timestamp_qds_rcbxv = lhcsmnb.utils.get_at(source_timestamp_qds_rcbxv_df, 0, 'timestamp', default=np.nan)\n",
" 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'])\n",
" # LEADS\n",
" # # RCBXH\n",
......@@ -224,10 +231,10 @@
"source": [
"timestamp_dct = {'FGC_RCBXH': timestamp_fgc_rcbxh, 'FGC_RCBXV': timestamp_fgc_rcbxv, \n",
" 'PIC_RCBXH': timestamp_pic_rcbxh, 'PIC_RCBXV': timestamp_pic_rcbxv, \n",
" 'QDS_A_RCBXH':source_timestamp_qds_rcbxh_df.loc[0, 'timestamp'] if len(source_timestamp_qds_rcbxh_df) > 0 else np.nan, \n",
" 'QDS_B_RCBXH':source_timestamp_qds_rcbxh_df.loc[1, 'timestamp'] if len(source_timestamp_qds_rcbxh_df) > 1 else np.nan,\n",
" 'QDS_A_RCBXV':source_timestamp_qds_rcbxv_df.loc[0, 'timestamp'] if len(source_timestamp_qds_rcbxv_df) > 0 else np.nan, \n",
" 'QDS_B_RCBXV':source_timestamp_qds_rcbxv_df.loc[1, 'timestamp'] if len(source_timestamp_qds_rcbxv_df) > 1 else np.nan}\n",
" 'QDS_A_RCBXH':lhcsmnb.utils.get_at(source_timestamp_qds_rcbxh_df, 0, 'timestamp', default=np.nan), \n",
" 'QDS_B_RCBXH':lhcsmnb.utils.get_at(source_timestamp_qds_rcbxh_df, 1, 'timestamp', default=np.nan),\n",
" 'QDS_A_RCBXV':lhcsmnb.utils.get_at(source_timestamp_qds_rcbxv_df, 0, 'timestamp', default=np.nan), \n",
" 'QDS_B_RCBXV':lhcsmnb.utils.get_at(source_timestamp_qds_rcbxv_df, 1, 'timestamp', default=np.nan)}\n",
"\n",
"analysis_rcbxh.create_timestamp_table(timestamp_dct, circuit_name=circuit_names[0])"
]
......@@ -617,7 +624,7 @@
},
"outputs": [],
"source": [
"if not fgc_pm_search.is_automatic_mode():\n",
"if not is_automatic:\n",
" analysis_rcbxh.results_table['FPA Reason'] = get_expert_decision('Reason for FPA: ', ['QPS trip', 'Converter trip', 'EE spurious opening', 'Spurious heater firing', 'Busbar quench', 'Magnet quench', 'HTS current lead quench' ,'RES current lead overvoltage', 'No quench', 'Unknown'])\n",
" analysis_rcbxh.results_table['Type of Quench'] = get_expert_decision('Type of Quench: ', ['Training', 'Heater-provoked', 'Beam-induced', 'GHe propagation', 'QPS crate reset', 'Single Event Upset' ,'Short-to-ground', 'EM disturbance', 'No quench', 'Unknown'])\n",
" analysis_rcbxh.results_table['QDS trigger origin'] = get_expert_decision('QDS trigger origin: ', ['QPS', 'HTS current lead', 'RES current lead', 'Busbar', 'No quench'])\n",
......@@ -641,13 +648,17 @@
},
"outputs": [],
"source": [
"analysis_rcbxh.results_table['Comment'] = input('Comment: ')"
"if not is_automatic:\n",
" analysis_rcbxh.results_table['Comment'] = input('Comment: ')"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false
"deletable": false,
"tags": [
"ignore"
]
},
"source": [
"# 7. Final Report"
......@@ -658,7 +669,10 @@
"execution_count": null,
"metadata": {
"deletable": false,
"scrolled": false
"scrolled": false,
"tags": [
"ignore"
]
},
"outputs": [],
"source": [
......@@ -716,7 +730,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.8.10"
},
"sparkconnect": {
"bundled_options": [
......
......@@ -53,22 +53,24 @@
"outputs": [],
"source": [
"# External libraries\n",
"print('Loading (1/14)'); import pandas as pd\n",
"print('Loading (2/14)'); import numpy as np\n",
"print('Loading (3/14)'); import sys\n",
"print('Loading (4/14)'); from IPython.display import display, Javascript, clear_output, HTML\n",
"print('Loading (1/16)'); import pandas as pd\n",
"print('Loading (2/16)'); import numpy as np\n",
"print('Loading (3/16)'); import sys\n",
"print('Loading (4/16)'); from IPython.display import display, Javascript, clear_output, HTML\n",
"\n",
"# Internal libraries\n",
"print('Loading (5/14)'); import lhcsmapi\n",
"print('Loading (6/14)'); from lhcsmapi.Time import Time\n",
"print('Loading (7/14)'); from lhcsmapi.Timer import Timer\n",
"print('Loading (8/14)'); from lhcsmapi.analysis.R600ACircuitQuery import R600ACircuitQuery\n",
"print('Loading (9/14)'); from lhcsmapi.analysis.R600ACircuitAnalysis import R600ACircuitAnalysis\n",
"print('Loading (10/14)'); from lhcsmapi.analysis.expert_input import get_expert_decision\n",
"print('Loading (11/14)'); from lhcsmapi.analysis.report_template import apply_report_template\n",
"print('Loading (12/14)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule\n",
"print('Loading (13/14)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator\n",
"print('Loading (14/14)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (5/16)'); import lhcsmapi\n",
"print('Loading (6/16)'); from lhcsmapi.Time import Time\n",
"print('Loading (7/16)'); from lhcsmapi.Timer import Timer\n",
"print('Loading (8/16)'); from lhcsmapi.analysis.R600ACircuitQuery import R600ACircuitQuery\n",
"print('Loading (9/16)'); from lhcsmapi.analysis.R600ACircuitAnalysis import R600ACircuitAnalysis\n",
"print('Loading (10/16)'); from lhcsmapi.analysis.expert_input import get_expert_decision\n",
"print('Loading (11/16)'); from lhcsmapi.analysis.report_template import apply_report_template\n",
"print('Loading (12/16)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule\n",
"print('Loading (13/16)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator\n",
"print('Loading (14/16)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (15/16)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType\n",
"print('Loading (16/16)'); import lhcsmnb.utils\n",
"\n",
"clear_output()\n",
"lhcsmapi.get_lhcsmapi_version()\n",
......@@ -108,7 +110,10 @@
"execution_count": null,
"metadata": {
"deletable": false,
"scrolled": false
"scrolled": false,
"tags": [
"parameters"
]
},
"outputs": [],
"source": [
......@@ -137,11 +142,14 @@
"outputs": [],
"source": [
"with Timer():\n",
" author = fgc_pm_search.get_author()\n",
" is_automatic = fgc_pm_search.is_automatic_mode()\n",
" circuit_type = '600A'\n",
" circuit_names = fgc_pm_search.get_fgc_circuit()\n",
" timestamp_fgc_rcd, timestamp_fgc_rco = fgc_pm_search.get_fgc_timestamp()\n",
" if not are_all_parameters_injected(NbType.FGC2, locals()):\n",
" author = fgc_pm_search.get_author()\n",
" is_automatic = fgc_pm_search.is_automatic_mode()\n",
" circuit_type = '600A'\n",
" circuit_names = fgc_pm_search.get_fgc_circuit()\n",
" timestamps_fgc = fgc_pm_search.get_fgc_timestamp()\n",
" \n",
" timestamp_fgc_rcd, timestamp_fgc_rco = timestamps_fgc\n",
" \n",
" query_rcd = R600ACircuitQuery(circuit_type, circuit_names[0], max_executions=10)\n",
" query_rco = R600ACircuitQuery(circuit_type, circuit_names[1], max_executions=10)\n",
......@@ -171,7 +179,7 @@
" # # RCD\n",
" source_timestamp_ee_rcd_df = query_rcd.find_source_timestamp_ee(timestamp_fgc_rcd)\n",
" if not source_timestamp_ee_rcd_df.empty:\n",
" timestamp_ee_rcd = source_timestamp_ee_rcd_df.loc[0, 'timestamp']\n",
" timestamp_ee_rcd = lhcsmnb.utils.get_at(source_timestamp_ee_rcd_df, 0, 'timestamp')\n",
" 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]\n",
" else:\n",
" timestamp_ee_rcd = float('nan')\n",
......@@ -179,11 +187,11 @@
" # QDS PM\n",
" # # RCD\n",
" source_timestamp_qds_rcd_df = query_rcd.find_source_timestamp_qds_board_ab(timestamp_fgc_rcd, duration=[(2, 's'), (2, 's')])\n",
" timestamp_qds_rcd = np.nan if source_timestamp_qds_rcd_df.empty else source_timestamp_qds_rcd_df.loc[0, 'timestamp']\n",
" timestamp_qds_rcd = lhcsmnb.utils.get_at(source_timestamp_qds_rcd_df, 0, 'timestamp', np.nan)\n",
" i_dcct_rcd_df, i_didt_rcd_df, u_res_rcd_df, u_diff_rcd_df = query_rcd.query_qds_pm(timestamp_qds_rcd, timestamp_qds_rcd, signal_names=['I_DCCT', 'I_DIDT', 'U_RES', 'U_DIFF'])\n",
" # # RCO\n",
" source_timestamp_qds_rco_df = query_rco.find_source_timestamp_qds_board_ab(timestamp_fgc_rco, duration=[(2, 's'), (2, 's')])\n",
" timestamp_qds_rco = np.nan if source_timestamp_qds_rco_df.empty else source_timestamp_qds_rco_df.loc[0, 'timestamp']\n",
" timestamp_qds_rco = lhcsmnb.utils.get_at(source_timestamp_qds_rco_df, 0, 'timestamp', np.nan)\n",
" i_dcct_rco_df, i_didt_rco_df, u_res_rco_df, u_diff_rco_df = query_rco.query_qds_pm(timestamp_qds_rco, timestamp_qds_rco, signal_names=['I_DCCT', 'I_DIDT', 'U_RES', 'U_DIFF'])\n",
" \n",
" # LEADS\n",
......@@ -209,10 +217,10 @@
" timestamp_dct = {'FGC_RCD': timestamp_fgc_rcd, 'FGC_RCO': timestamp_fgc_rco, \n",
" 'PIC_RCD': timestamp_pic_rcd, 'PIC_RCO': timestamp_pic_rco, \n",
" 'EE_RCD': timestamp_ee_rcd,\n",
" 'QDS_A_RCD':source_timestamp_qds_rcd_df.loc[0, 'timestamp'] if len(source_timestamp_qds_rcd_df) > 0 else np.nan, \n",
" 'QDS_B_RCD':source_timestamp_qds_rcd_df.loc[1, 'timestamp'] if len(source_timestamp_qds_rcd_df) > 1 else np.nan,\n",
" 'QDS_A_RCO':source_timestamp_qds_rco_df.loc[0, 'timestamp'] if len(source_timestamp_qds_rco_df) > 0 else np.nan, \n",
" 'QDS_B_RCO':source_timestamp_qds_rco_df.loc[1, 'timestamp'] if len(source_timestamp_qds_rco_df) > 1 else np.nan}"
" 'QDS_A_RCD':lhcsmnb.utils.get_at(source_timestamp_qds_rcd_df, 0, 'timestamp', default=np.nan), \n",
" 'QDS_B_RCD':lhcsmnb.utils.get_at(source_timestamp_qds_rcd_df, 1, 'timestamp', default=np.nan),\n",
" 'QDS_A_RCO':lhcsmnb.utils.get_at(source_timestamp_qds_rco_df, 0, 'timestamp', default=np.nan), \n",
" 'QDS_B_RCO':lhcsmnb.utils.get_at(source_timestamp_qds_rco_df, 1, 'timestamp', default=np.nan)}"
]
},
{
......@@ -436,7 +444,8 @@
},
"outputs": [],
"source": [
"analysis_rcd.analyze_u_dump_res_ee(circuit_names[0], timestamp_fgc_rcd, i_meas_rcd_df, u_dump_res_rcd_df, col_name='U_EE_RCD_max')"
"if not source_timestamp_ee_rcd_df.empty:\n",
" analysis_rcd.analyze_u_dump_res_ee(circuit_names[0], timestamp_fgc_rcd, i_meas_rcd_df, u_dump_res_rcd_df, col_name='U_EE_RCD_max')"
]
},
{
......@@ -447,7 +456,7 @@
},
"outputs": [],
"source": [
"if not fgc_pm_search.is_automatic_mode():\n",
"if not is_automatic:\n",
" analysis_rcd.results_table['EE_RCD analysis'] = get_expert_decision('EE_RCD analysis: ', ['PASS', 'FAIL'])"
]
},
......@@ -642,7 +651,7 @@
},
"outputs": [],
"source": [
"if not fgc_pm_search.is_automatic_mode():\n",
"if not is_automatic:\n",
" analysis_rco.results_table['FPA Reason'] = get_expert_decision('Reason for FPA: ', ['QPS trip', 'Converter trip', 'EE spurious opening', 'Spurious heater firing', 'Busbar quench', 'Magnet quench', 'HTS current lead quench' ,'RES current lead overvoltage', 'No quench', 'Unknown'])\n",
" analysis_rco.results_table['Type of Quench'] = get_expert_decision('Type of Quench: ', ['Training', 'Heater-provoked', 'Beam-induced', 'GHe propagation', 'QPS crate reset', 'Single Event Upset' ,'Short-to-ground', 'EM disturbance', 'No quench', 'Unknown'])\n",
" analysis_rco.results_table['QDS trigger origin'] = get_expert_decision('QDS trigger origin: ', ['QPS', 'HTS current lead', 'RES current lead','Busbar', 'No quench'])\n",
......@@ -666,13 +675,17 @@
},
"outputs": [],
"source": [
"analysis_rco.results_table['Comment'] = input('Comment: ')"
"if not is_automatic:\n",
" analysis_rco.results_table['Comment'] = input('Comment: ')"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false
"deletable": false,
"tags": [
"ignore"
]
},
"source": [
"# 7. Final Report"
......@@ -682,7 +695,10 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
"deletable": false,
"tags": [
"ignore"
]
},
"outputs": [],
"source": [
......@@ -740,7 +756,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.8.10"
},
"sparkconnect": {
"bundled_options": [
......
......@@ -53,22 +53,24 @@
"outputs": [],
"source": [
"# External libraries\n",
"print('Loading (1/14)'); import pandas as pd\n",
"print('Loading (2/14)'); import numpy as np\n",
"print('Loading (3/14)'); import sys\n",
"print('Loading (4/14)'); from IPython.display import display, Javascript, clear_output, HTML\n",
"print('Loading (1/16)'); import pandas as pd\n",
"print('Loading (2/16)'); import numpy as np\n",
"print('Loading (3/16)'); import sys\n",
"print('Loading (4/16)'); from IPython.display import display, Javascript, clear_output, HTML\n",
"\n",
"# Internal libraries\n",
"print('Loading (5/14)'); import lhcsmapi\n",
"print('Loading (6/14)'); from lhcsmapi.Time import Time\n",
"print('Loading (7/14)'); from lhcsmapi.Timer import Timer\n",
"print('Loading (8/14)'); from lhcsmapi.analysis.R600ACircuitQuery import R600ACircuitQuery\n",
"print('Loading (9/14)'); from lhcsmapi.analysis.R600ACircuitAnalysis import R600ACircuitAnalysis\n",
"print('Loading (10/14)'); from lhcsmapi.analysis.expert_input import get_expert_decision\n",
"print('Loading (11/14)'); from lhcsmapi.analysis.report_template import apply_report_template\n",
"print('Loading (12/14)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule\n",
"print('Loading (13/14)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator\n",
"print('Loading (14/14)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (5/16)'); import lhcsmapi\n",
"print('Loading (6/16)'); from lhcsmapi.Time import Time\n",
"print('Loading (7/16)'); from lhcsmapi.Timer import Timer\n",
"print('Loading (8/16)'); from lhcsmapi.analysis.R600ACircuitQuery import R600ACircuitQuery\n",
"print('Loading (9/16)'); from lhcsmapi.analysis.R600ACircuitAnalysis import R600ACircuitAnalysis\n",
"print('Loading (10/16)'); from lhcsmapi.analysis.expert_input import get_expert_decision\n",
"print('Loading (11/16)'); from lhcsmapi.analysis.report_template import apply_report_template\n",
"print('Loading (12/16)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule\n",
"print('Loading (13/16)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator\n",
"print('Loading (14/16)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (15/16)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType\n",
"print('Loading (16/16)'); import lhcsmnb.utils\n",
"\n",
"clear_output()\n",
"lhcsmapi.get_lhcsmapi_version()\n",
......@@ -108,7 +110,10 @@
"execution_count": null,
"metadata": {
"deletable": false,
"scrolled": false
"scrolled": false,
"tags": [
"parameters"
]
},
"outputs": [],
"source": [
......@@ -139,10 +144,12 @@
"outputs": [],
"source": [
"with Timer():\n",
" author = fgc_pm_search.get_author()\n",
" is_automatic = fgc_pm_search.is_automatic_mode()\n",
" timestamp_fgc = fgc_pm_search.get_fgc_timestamp()\n",
" circuit_name = fgc_pm_search.get_fgc_circuit()\n",
" if not are_all_parameters_injected(NbType.FGC, locals()):\n",
" author = fgc_pm_search.get_author()\n",
" is_automatic = fgc_pm_search.is_automatic_mode()\n",
" timestamp_fgc = fgc_pm_search.get_fgc_timestamp()\n",
" circuit_name = fgc_pm_search.get_fgc_circuit()\n",
" \n",
" query = R600ACircuitQuery(circuit_type, circuit_name, max_executions=10)\n",
"\n",
" i_meas_df, i_a_df, i_ref_df, i_earth_df = query.query_pc_pm(timestamp_fgc, timestamp_fgc, signal_names=['I_MEAS', 'I_A', 'I_REF', 'I_EARTH'])\n",
......@@ -158,7 +165,7 @@
" if 'EE' in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_name):\n",
" query.max_executions += 2\n",
" source_timestamp_ee_df = query.find_source_timestamp_ee(timestamp_fgc)\n",
" timestamp_ee = source_timestamp_ee_df.loc[0, 'timestamp']\n",
" timestamp_ee = lhcsmnb.utils.get_at(source_timestamp_ee_df, 0, 'timestamp')\n",
" u_dump_res_df = query.query_ee_u_dump_res_pm(timestamp_ee, timestamp_fgc, system='EE', signal_names=['U_DUMP_RES'])[0]\n",
" else:\n",
" source_timestamp_ee_df = pd.DataFrame()\n",
......@@ -169,7 +176,7 @@
" u_res_nxcals_df = query.query_iqps_nxcals(timestamp_fgc, signal_names=['U_RES'], spark=spark)[0]\n",
"\n",
" source_timestamp_qds_df = query.find_source_timestamp_qds_board_ab(timestamp_fgc, duration=[(2, 's'), (2, 's')])\n",
" timestamp_qds = np.nan if source_timestamp_qds_df.empty else source_timestamp_qds_df.loc[0, 'timestamp']\n",
" timestamp_qds = lhcsmnb.utils.get_at(source_timestamp_qds_df, 0, 'timestamp', default=np.nan)\n",
" i_dcct_df, i_didt_df, u_res_df, u_diff_df = query.query_qds_pm(timestamp_qds, timestamp_qds, signal_names=['I_DCCT', 'I_DIDT', 'U_RES', 'U_DIFF'])\n",
"\n",
" # LEADS\n",
......@@ -182,10 +189,10 @@
" analysis = R600ACircuitAnalysis(circuit_type, results_table, is_automatic=is_automatic)\n",
" \n",
" timestamp_dct = {'FGC': timestamp_fgc, 'PIC': timestamp_pic, \n",
" 'QDS_A': source_timestamp_qds_df.loc[0, 'timestamp'] if len(source_timestamp_qds_df) > 0 else np.nan,\n",
" 'QDS_B': source_timestamp_qds_df.loc[1, 'timestamp'] if len(source_timestamp_qds_df) > 1 else np.nan}\n",
" 'QDS_A': lhcsmnb.utils.get_at(source_timestamp_qds_df, 0, 'timestamp', default=np.nan),\n",
" 'QDS_B': lhcsmnb.utils.get_at(source_timestamp_qds_df, 1, 'timestamp', default=np.nan)}\n",
" if 'EE' in SignalMetadata.get_system_types_per_circuit_name(circuit_type, circuit_name):\n",
" 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)"
]
},
{
......@@ -500,7 +507,7 @@
},
"outputs": [],
"source": [
"if not fgc_pm_search.is_automatic_mode():\n",
"if not is_automatic:\n",
" analysis.results_table['FPA Reason'] = get_expert_decision('Reason for FPA: ', ['QPS trip', 'Converter trip', 'EE spurious opening', 'Spurious heater firing', 'Busbar quench', 'Magnet quench', 'HTS current lead quench' ,'RES current lead overvoltage', 'No quench', 'Unknown'])\n",
" analysis.results_table['Type of Quench'] = get_expert_decision('Type of Quench: ', ['Training', 'Heater-provoked', 'Beam-induced', 'GHe propagation', 'QPS crate reset', 'Single Event Upset' ,'Short-to-ground', 'EM disturbance', 'No quench', 'Unknown'])\n",
" analysis.results_table['QDS trigger origin'] = get_expert_decision('QDS trigger origin: ', ['QPS', 'HTS current lead', 'RES current lead', 'Busbar', 'No quench'])"
......@@ -523,13 +530,17 @@
},
"outputs": [],
"source": [
"analysis.results_table['Comment'] = input('Comment: ')"
"if not is_automatic:\n",
" analysis.results_table['Comment'] = input('Comment: ')"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false
"deletable": false,
"tags": [
"ignore"
]
},
"source": [
"# 8. Final Report"
......@@ -540,7 +551,10 @@
"execution_count": null,
"metadata": {
"deletable": false,
"scrolled": false
"scrolled": false,
"tags": [
"ignore"
]
},
"outputs": [],
"source": [
......@@ -595,7 +609,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.8.10"
},
"sparkconnect": {
"bundled_options": [
......
......@@ -44,22 +44,23 @@
"outputs": [],
"source": [
"# External libraries\n",
"print('Loading (1/14)'); import pandas as pd\n",
"print('Loading (2/14)'); import numpy as np\n",
"print('Loading (3/14)'); import sys\n",
"print('Loading (4/14)'); from IPython.display import display, Javascript, clear_output, HTML\n",
"print('Loading (1/15)'); import pandas as pd\n",
"print('Loading (2/15)'); import numpy as np\n",
"print('Loading (3/15)'); import sys\n",
"print('Loading (4/15)'); from IPython.display import display, Javascript, clear_output, HTML\n",
"\n",
"# Internal libraries\n",
"print('Loading (5/14)'); import lhcsmapi\n",
"print('Loading (6/14)'); from lhcsmapi.Time import Time\n",
"print('Loading (7/14)'); from lhcsmapi.Timer import Timer\n",
"print('Loading (8/14)'); from lhcsmapi.analysis.R60_80_120ACircuitQuery import R60_80_120ACircuitQuery\n",
"print('Loading (9/14)'); from lhcsmapi.analysis.R60_80_120ACircuitAnalysis import R60_80_120ACircuitAnalysis\n",
"print('Loading (10/14)'); from lhcsmapi.analysis.expert_input import get_expert_decision\n",
"print('Loading (11/14)'); from lhcsmapi.analysis.report_template import apply_report_template\n",
"print('Loading (12/14)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule\n",
"print('Loading (13/14)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator\n",
"print('Loading (14/14)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (5/15)'); import lhcsmapi\n",
"print('Loading (6/15)'); from lhcsmapi.Time import Time\n",
"print('Loading (7/15)'); from lhcsmapi.Timer import Timer\n",
"print('Loading (8/15)'); from lhcsmapi.analysis.R60_80_120ACircuitQuery import R60_80_120ACircuitQuery\n",
"print('Loading (9/15)'); from lhcsmapi.analysis.R60_80_120ACircuitAnalysis import R60_80_120ACircuitAnalysis\n",
"print('Loading (10/15)'); from lhcsmapi.analysis.expert_input import get_expert_decision\n",
"print('Loading (11/15)'); from lhcsmapi.analysis.report_template import apply_report_template\n",
"print('Loading (12/15)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule\n",
"print('Loading (13/15)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator\n",
"print('Loading (14/15)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (15/15)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType\n",
"\n",
"clear_output()\n",
"lhcsmapi.get_lhcsmapi_version()\n",
......@@ -99,7 +100,10 @@
"execution_count": null,
"metadata": {
"deletable": false,
"scrolled": false
"scrolled": false,
"tags": [
"parameters"
]
},
"outputs": [],
"source": [
......@@ -126,10 +130,11 @@
"outputs": [],
"source": [
"with Timer():\n",
" timestamp_fgc = fgc_pm_search.get_fgc_timestamp()\n",
" circuit_name = fgc_pm_search.get_fgc_circuit()\n",
" author = fgc_pm_search.get_author()\n",
" is_automatic = fgc_pm_search.is_automatic_mode()\n",
" if not are_all_parameters_injected(NbType.FGC, locals()):\n",
" timestamp_fgc = fgc_pm_search.get_fgc_timestamp()\n",
" circuit_name = fgc_pm_search.get_fgc_circuit()\n",
" author = fgc_pm_search.get_author()\n",
" is_automatic = fgc_pm_search.is_automatic_mode()\n",
" query = R60_80_120ACircuitQuery(circuit_type, circuit_name, max_executions=1)\n",
" \n",
" # PC\n",
......@@ -268,7 +273,7 @@
},
"outputs": [],
"source": [
"if not fgc_pm_search.is_automatic_mode():\n",
"if not is_automatic:\n",
" analysis.results_table['FPA Reason'] = get_expert_decision('Reason for FPA: ', ['QPS trip', 'Converter trip', 'EE spurious opening', 'Spurious heater firing', 'Busbar quench', 'Magnet quench', 'HTS current lead quench' ,'RES current lead overvoltage', 'No quench', 'Unknown'])\n",
" analysis.results_table['Type of Quench'] = get_expert_decision('Type of Quench: ', ['Training', 'Heater-provoked', 'Beam-induced', 'GHe propagation', 'QPS crate reset', 'Single Event Upset' ,'Short-to-ground', 'EM disturbance' ,'Unknown', 'No quench'])"
]
......@@ -290,13 +295,17 @@
},
"outputs": [],
"source": [
"analysis.results_table['Comment'] = input('Comment: ')"
"if not is_automatic:\n",
" analysis.results_table['Comment'] = input('Comment: ')"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false
"deletable": false,
"tags": [
"ignore"
]
},
"source": [
"# 7. Final Report"
......@@ -306,7 +315,10 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
"deletable": false,
"tags": [
"ignore"
]
},
"outputs": [],
"source": [
......@@ -361,7 +373,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.8.10"
},
"sparkconnect": {
"bundled_options": [
......
......@@ -45,22 +45,23 @@
"outputs": [],
"source": [
"# External libraries\n",
"print('Loading (1/14)'); import pandas as pd\n",
"print('Loading (2/14)'); import numpy as np\n",
"print('Loading (3/14)'); import sys\n",
"print('Loading (4/14)'); from IPython.display import display, Javascript, clear_output, HTML\n",
"print('Loading (1/15)'); import pandas as pd\n",
"print('Loading (2/15)'); import numpy as np\n",
"print('Loading (3/15)'); import sys\n",
"print('Loading (4/15)'); from IPython.display import display, Javascript, clear_output, HTML\n",
"\n",
"# Internal libraries\n",
"print('Loading (5/14)'); import lhcsmapi\n",
"print('Loading (6/14)'); from lhcsmapi.Time import Time\n",
"print('Loading (7/14)'); from lhcsmapi.Timer import Timer\n",
"print('Loading (8/14)'); from lhcsmapi.analysis.R60_80_120ACircuitQuery import R60_80_120ACircuitQuery\n",
"print('Loading (9/14)'); from lhcsmapi.analysis.R60_80_120ACircuitAnalysis import R60_80_120ACircuitAnalysis\n",
"print('Loading (10/14)'); from lhcsmapi.analysis.expert_input import get_expert_decision\n",
"print('Loading (11/14)'); from lhcsmapi.analysis.report_template import apply_report_template\n",
"print('Loading (12/14)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule\n",
"print('Loading (13/14)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator\n",
"print('Loading (14/14)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (5/15)'); import lhcsmapi\n",
"print('Loading (6/15)'); from lhcsmapi.Time import Time\n",
"print('Loading (7/15)'); from lhcsmapi.Timer import Timer\n",
"print('Loading (8/15)'); from lhcsmapi.analysis.R60_80_120ACircuitQuery import R60_80_120ACircuitQuery\n",
"print('Loading (9/15)'); from lhcsmapi.analysis.R60_80_120ACircuitAnalysis import R60_80_120ACircuitAnalysis\n",
"print('Loading (10/15)'); from lhcsmapi.analysis.expert_input import get_expert_decision\n",
"print('Loading (11/15)'); from lhcsmapi.analysis.report_template import apply_report_template\n",
"print('Loading (12/15)'); from lhcsmapi.gui.DateTimeBaseModule import DateTimeBaseModule\n",
"print('Loading (13/15)'); from lhcsmapi.gui.pc.FgcPmSearchModuleMediator import FgcPmSearchModuleMediator\n",
"print('Loading (14/15)'); from lhcsmapi.metadata.SignalMetadata import SignalMetadata\n",
"print('Loading (15/15)'); from lhcsmnb.parameters import are_all_parameters_injected, NbType\n",
"\n",
"clear_output()\n",
"lhcsmapi.get_lhcsmapi_version()\n",
......@@ -100,7 +101,10 @@
"execution_count": null,
"metadata": {
"deletable": false,
"scrolled": false
"scrolled": false,
"tags": [
"parameters"
]
},
"outputs": [],
"source": [
......@@ -109,6 +113,19 @@
" end_date_time='2021-01-31 00:00:00+01:00'), circuit_type=circuit_type)"
]