Commit aec36e3b authored by Per Hagen's avatar Per Hagen 🐵 Committed by Thibaud Marie Eric Buffet
Browse files

Contributor

parent 13baa4c9
__version__ = "1.5.57"
__version__ = "1.5.58"
......@@ -51,7 +51,7 @@
"outputs": [],
"source": [
"# External libraries\n",
"print('Loading (1/12)'); import sys; import pandas as pd\n",
"print('Loading (1/12)'); import sys, warnings\n",
"print('Loading (2/12)'); from IPython.display import display, Javascript, HTML, clear_output\n",
"print('Loading (3/12)'); import pandas as pd\n",
"\n",
......@@ -62,9 +62,9 @@
"print('Loading (7/12)'); from lhcsmapi.analysis.RbCircuitQuery import RbCircuitQuery\n",
"print('Loading (8/12)'); from lhcsmapi.analysis.RbCircuitAnalysis import RbCircuitAnalysis\n",
"print('Loading (9/12)'); from lhcsmapi.analysis.report_template import apply_report_template\n",
"print('Loading (10/12)'); from lhcsmapi.gui.qh.DateTimeBaseModule import DateTimeBaseModule\n",
"print('Loading (11/12)'); from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator\n",
"print('Loading (12/12)'); from lhcsmapi.analysis.expert_input import get_expert_decision\n",
"print('Loading (10/12)'); from lhcsmapi.analysis.expert_input import get_expert_decision\n",
"print('Loading (11/12)'); from lhcsmapi.gui.qh.DateTimeBaseModule import DateTimeBaseModule\n",
"print('Loading (12/12)'); from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator\n",
"\n",
"clear_output()\n",
"lhcsmapi.get_lhcsmapi_version()\n",
......@@ -156,7 +156,7 @@
" t_start_ref, t_end_ref = Time.to_unix_timestamp(t_start_ref), Time.to_unix_timestamp(t_end_ref)\n",
" is_automatic = False\n",
" \n",
"rb_query = RbCircuitQuery(circuit_type, circuit_name, max_executions=35)\n",
"rb_query = RbCircuitQuery(circuit_type, circuit_name, max_executions=40)\n",
"\n",
"with Timer():\n",
" source_timestamp_pc = rb_query.find_source_timestamp_pc(t_start, t_end)\n",
......@@ -195,6 +195,7 @@
" 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')\n",
" else:\n",
" 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'])]\n",
" \n",
" # EE TEMPERATURE REF\n",
" source_timestamp_ee_odd_ref_df = rb_query.find_source_timestamp_ee(timestamp_fgc_ref, system='EE_ODD')\n",
" source_timestamp_ee_even_ref_df = rb_query.find_source_timestamp_ee(timestamp_fgc_ref, system='EE_EVEN')\n",
......@@ -209,6 +210,7 @@
" 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')\n",
" else:\n",
" 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'])]\n",
" \n",
" # U_DIODE - CALS\n",
" u_diode_rb_dfs = rb_query.query_voltage_nxcals('DIODE_RB', 'U_DIODE_RB', timestamp_fgc, spark=spark, duration=[(50, 's'), (350, 's')])\n",
"\n",
......@@ -238,7 +240,7 @@
" i_meas_u_diode_nxcals_dfs = rb_query.query_current_voltage_diode_leads_nxcals(source_timestamp_qds_df, spark=spark, duration=[(50, 's'), (350, 's')])\n",
"\n",
" # U_EARTH\n",
" u_earth_rb_dfs = rb_query.query_voltage_nxcals('VF', 'U_EARTH_RB', timestamp_fgc, ldb=ldb, duration=[(50, 's'), (350, 's')])\n",
" u_earth_rb_dfs = rb_query.query_voltage_nxcals('VF', 'U_EARTH_RB', timestamp_fgc, spark=spark, duration=[(50, 's'), (350, 's')])\n",
"\n",
" # DFB\n",
" source_timestamp_leads_odd_df = rb_query.find_timestamp_leads(timestamp_fgc, 'LEADS_ODD')\n",
......@@ -663,7 +665,7 @@
},
"outputs": [],
"source": [
"u_diode_with_quench_rb_dfs = rb_analysis.filter_quenched_magnets(u_diode_rb_dfs)\n",
"u_diode_with_quench_rb_dfs = rb_analysis.filter_quenched_magnets(u_diode_rb_dfs, results_table['Position'])\n",
"rb_analysis.analyze_u_diode_nqps(circuit_name, timestamp_fgc, i_meas_df, u_diode_with_quench_rb_dfs, 'U_DIODE_RB', 'DIODE_RB', legend=True, xlim=(-5, 350))\n",
"rb_analysis.analyze_u_diode_nqps(circuit_name, timestamp_fgc, i_meas_df, u_diode_with_quench_rb_dfs, 'U_DIODE_RB', 'DIODE_RB', legend=True, xlim=(-2, 3))"
]
......@@ -757,6 +759,16 @@
"- the diode voltages used by the nQPS crate for quench detection on the left axis, U_DIODE_RB and U_REF_N1 \n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# iQPS Threshold\n",
"threshold_iqps = 0.1"
]
},
{
"cell_type": "code",
"execution_count": null,
......@@ -767,7 +779,7 @@
"source": [
"%matplotlib inline\n",
"if u_nqps_dfs:\n",
" rb_analysis.analyze_qds(timestamp_fgc, min(timestamp_pic), u_qds_dfs, u_nqps_dfs, i_meas_df)\n",
" rb_analysis.analyze_qds(timestamp_fgc, min(timestamp_pic), u_qds_dfs, u_nqps_dfs, i_meas_df, threshold=threshold_iqps)\n",
" rb_analysis.results_table[['Circuit Name', 'Position', 'nQPS crate name', 'Delta_t(iQPS-PIC)','I_Q_circ', 'I_Q_M', 'Delta_t(nQPS-PIC)', 'QDS trigger origin', 'dU_iQPS/dt', 'Type of Quench']]"
]
},
......@@ -909,7 +921,7 @@
"metadata": {},
"outputs": [],
"source": [
"if not fgc_pm_search.is_automatic_mode():\n",
"if not is_automatic:\n",
" rb_analysis.results_table['V feeler analysis'] = get_expert_decision('Voltage feeler analysis: ', ['PASS', 'FAIL'])"
]
},
......@@ -951,7 +963,7 @@
},
"outputs": [],
"source": [
"rb_analysis.analyze_leads_voltage(u_hts_odd_dfs+u_hts_even_dfs, circuit_name, timestamp_fgc, timestamp_qps=source_timestamp_qds_df.loc[0, 'timestamp'], signal='U_HTS', value_min=-0.001, value_max=0.001)"
"rb_analysis.analyze_leads_voltage(u_hts_odd_dfs+u_hts_even_dfs, circuit_name, timestamp_fgc, timestamp_qps=source_timestamp_qds_df.loc[0, 'timestamp'], signal='U_HTS', value_min=-0.003, value_max=0.003)"
]
},
{
......@@ -984,8 +996,9 @@
},
"outputs": [],
"source": [
"rb_analysis.results_table['FPA Reason'] = get_expert_decision('Reason for FPA: ', ['Heater-provoked', '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",
"rb_analysis.results_table['QDS trigger origin'] = get_expert_decision('QDS trigger origin: ', ['QPS', 'HTS current lead', 'RES current lead','Busbar', 'No quench'])"
"if not is_automatic:\n",
" rb_analysis.results_table['FPA Reason'] = get_expert_decision('Reason for FPA: ', ['Heater-provoked', '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",
" rb_analysis.results_table['QDS trigger origin'] = get_expert_decision('QDS trigger origin: ', ['QPS', 'HTS current lead', 'RES current lead','Busbar', 'No quench'])"
]
},
{
......@@ -1048,7 +1061,8 @@
},
"outputs": [],
"source": [
"signature = get_expert_decision('Expert Signature Decision: ', ['PASSED', 'FAILED'])"
"if not is_automatic:\n",
" signature = get_expert_decision('Expert Signature Decision: ', ['PASSED', 'FAILED'])"
]
},
{
......
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