Commit 25834776 authored by Thibaud Marie Eric Buffet's avatar Thibaud Marie Eric Buffet
Browse files

Merge branch 'dev' into 'master'

Dev

See merge request !18
parents 20f340b2 3e41eb19
Pipeline #2633024 passed with stage
in 14 seconds
__version__ = "1.5.62"
__version__ = "1.5.63"
......@@ -174,7 +174,8 @@
" plateau_start, plateau_end = rb_analysis.find_plateau_start_and_end(i_meas_raw_nxcals_df, i_meas_threshold=500, min_duration_in_sec=360, time_shift_in_sec=(240, 60))\n",
" \n",
" u_res_feature_df, i_meas_feature_df = rb_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_RES', spark=spark)\n",
" res_busbar_row_df = rb_analysis.calculate_resistance(i_meas_feature_df, u_res_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_name)\n",
" from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis\n",
" res_busbar_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rb_analysis, i_meas_feature_df, u_res_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_name)\n",
" res_busbar_df = rb_analysis.convert_to_col(res_busbar_row_df, signal_name='U_RES')"
]
},
......
......@@ -171,6 +171,7 @@
"rb_analysis = RbCircuitAnalysis(circuit_type, None, is_automatic=is_automatic)\n",
"\n",
"with Timer():\n",
" from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis\n",
" # PC\n",
" i_meas_nxcals_df = rb_query.query_signal_nxcals(t_start, t_end, t0=t_start, system='PC', signal_names='I_MEAS', spark=spark)[0]\n",
" i_meas_raw_nxcals_df = rb_query.query_raw_signal_nxcals(t_start, t_end, system='PC', signal_names='I_MEAS', spark=spark)[0]\n",
......@@ -178,12 +179,12 @@
"\n",
" # BUSBAR\n",
" u_res_feature_df, i_meas_feature_df = rb_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_RES', spark=spark)\n",
" res_busbar_row_df = rb_analysis.calculate_resistance(i_meas_feature_df, u_res_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_name)\n",
" res_busbar_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rb_analysis, i_meas_feature_df, u_res_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_name)\n",
" res_busbar_df = rb_analysis.convert_to_col(res_busbar_row_df, signal_name='U_RES')\n",
" \n",
" # MAGNET\n",
" u_mag_feature_df, i_meas_feature_df = rb_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_MAG', spark=spark)\n",
" res_magnet_row_df = rb_analysis.calculate_resistance(i_meas_feature_df, u_mag_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_name)\n",
" res_magnet_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rb_analysis, i_meas_feature_df, u_mag_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_name)\n",
" res_magnet_df = rb_analysis.convert_to_col(res_magnet_row_df, signal_name='U_MAG')\n",
" \n",
" # LEADS\n",
......@@ -342,8 +343,8 @@
},
"outputs": [],
"source": [
"magnet_metadata_resistance_df = rb_analysis.merge_busbar_metadata_with_resistance(res_busbar_df, circuit_type, circuit_name)\n",
"rb_analysis.display_busbar_metadata_resistance_with_threshold(magnet_metadata_resistance_df, threshold=50e-9)"
"magnet_metadata_resistance_df = rb_analysis.merge_busbar_metadata_with_resistance(res_magnet_df, circuit_type, circuit_name, res_col='R_MAG')\n",
"rb_analysis.display_busbar_metadata_resistance_with_threshold(magnet_metadata_resistance_df, threshold=50e-9, res_col='R_MAG')"
]
},
{
......
......@@ -178,7 +178,8 @@
" plateau_start, plateau_end = rb_analysis.find_plateau_start_and_end(i_meas_raw_nxcals_df, i_meas_threshold=500, min_duration_in_sec=360, time_shift_in_sec=(240, 60))\n",
" \n",
" u_res_feature_df, i_meas_feature_df = rb_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_RES', spark=spark)\n",
" res_busbar_row_df = rb_analysis.calculate_resistance(i_meas_feature_df, u_res_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_name)\n",
" from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis\n",
" res_busbar_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rb_analysis, i_meas_feature_df, u_res_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_name)\n",
" res_busbar_df = rb_analysis.convert_to_col(res_busbar_row_df, signal_name='U_RES')"
]
},
......
......@@ -260,13 +260,14 @@
" if len(plateau_start) > 1:\n",
" rb_query.max_executions += 2\n",
" # BUSBAR\n",
" from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis\n",
" u_res_feature_df, i_meas_feature_df = rb_query.get_busbar_resistances(t_start, t_end, plateau_start, plateau_end, signal_name='U_RES', spark=spark)\n",
" res_busbar_row_df = rb_analysis.calculate_resistance(i_meas_feature_df, u_res_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_name)\n",
" res_busbar_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rb_analysis, i_meas_feature_df, u_res_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_name)\n",
" res_busbar_df = convert_to_col(res_busbar_row_df, signal_name='U_RES')\n",
"\n",
" # MAGNET\n",
" u_mag_feature_df, i_meas_feature_df = rb_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_MAG', spark=spark)\n",
" res_magnet_row_df = rb_analysis.calculate_resistance(i_meas_feature_df, u_mag_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_name)\n",
" res_magnet_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rb_analysis, i_meas_feature_df, u_mag_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_name)\n",
" res_magnet_df = convert_to_col(res_magnet_row_df, signal_name='U_MAG')\n",
" else:\n",
" res_busbar_df = pd.DataFrame()\n",
......@@ -274,6 +275,7 @@
" \n",
" # nQPS\n",
" source_timestamp_nqps_df = rb_query.find_source_timestamp_nqps(timestamp_fgc)\n",
" source_timestamp_nqps_df = source_timestamp_nqps_df.drop(labels=53, axis=0)\n",
" u_nqps_dfs = rb_query.query_voltage_nqps_pm(source_timestamp_nqps_df)\n",
" \n",
" timestamp_dct = {'FGC': timestamp_fgc, 'PIC': min(timestamp_pic), 'EE_EVEN': timestamp_ee_even, 'EE_ODD': timestamp_ee_odd}"
......
......@@ -180,7 +180,8 @@
"\n",
" # BUSBAR\n",
" u_res_feature_df, i_meas_feature_df = rq_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_RES', spark=spark)\n",
" res_busbar_row_df = rq_analysis.calculate_resistance(i_meas_feature_df, u_res_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names)\n",
" from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis\n",
" res_busbar_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rq_analysis, i_meas_feature_df, u_res_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names)\n",
" res_busbar_df = rq_analysis.convert_to_col(res_busbar_row_df, signal_name='U_RES')"
]
},
......
......@@ -185,23 +185,24 @@
" plateau_start, plateau_end = RqCircuitQuery(circuit_type, circuit_names).calculate_current_plateau_start_end(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), i_meas_threshold=500, min_duration_in_sec=360, time_shift_in_sec=(240, 60), spark=spark)\n",
"\n",
" # BUSBAR\n",
" from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis\n",
" # # RQD\n",
" u_res_rqd_feature_df, i_meas_rqd_feature_df = rqd_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_RES', spark=spark)\n",
" res_busbar_rqd_row_df = rq_analysis.calculate_resistance(i_meas_rqd_feature_df, u_res_rqd_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names[0])\n",
" res_busbar_rqd_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rq_analysis, i_meas_rqd_feature_df, u_res_rqd_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names[0])\n",
" res_busbar_rqd_df = rq_analysis.convert_to_col(res_busbar_rqd_row_df, signal_name='U_RES')\n",
" # # RQF\n",
" u_res_rqf_feature_df, i_meas_rqf_feature_df = rqf_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_RES', spark=spark)\n",
" res_busbar_rqf_row_df = rq_analysis.calculate_resistance(i_meas_rqf_feature_df, u_res_rqf_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names[1])\n",
" res_busbar_rqf_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rq_analysis, i_meas_rqf_feature_df, u_res_rqf_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names[1])\n",
" res_busbar_rqf_df = rq_analysis.convert_to_col(res_busbar_rqf_row_df, signal_name='U_RES')\n",
" \n",
" # MAGNET\n",
" # # RQD\n",
" u_mag_rqd_feature_df, i_meas_rqd_feature_df = rqd_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_MAG', spark=spark)\n",
" res_magnet_rqd_row_df = rq_analysis.calculate_resistance(i_meas_rqd_feature_df, u_mag_rqd_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_names[0])\n",
" res_magnet_rqd_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rq_analysis, i_meas_rqd_feature_df, u_mag_rqd_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_names[0])\n",
" res_magnet_rqd_df = rq_analysis.convert_to_col(res_magnet_rqd_row_df, signal_name='U_MAG')\n",
" # # RQF\n",
" u_mag_rqf_feature_df, i_meas_rqf_feature_df = rqf_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_MAG', spark=spark)\n",
" res_magnet_rqf_row_df = rq_analysis.calculate_resistance(i_meas_rqf_feature_df, u_mag_rqf_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_names[1])\n",
" res_magnet_rqf_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rq_analysis, i_meas_rqf_feature_df, u_mag_rqf_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_names[1])\n",
" res_magnet_rqf_df = rq_analysis.convert_to_col(res_magnet_rqf_row_df, signal_name='U_MAG')\n",
"\n",
" # DFB\n",
......@@ -565,7 +566,7 @@
},
"outputs": [],
"source": [
"RqCircuitAnalysis.assert_u_res_min_max_value(u_res_rqd_nxcals_dfs+u_res_rqf_nxcals_dfs, value_range=(-40e-3, 40e-3));"
"RqCircuitAnalysis.assert_u_res_min_max_value(u_res_rqd_nxcals_dfs+u_res_rqf_nxcals_dfs, value_range=(-60e-3, 60e-3));"
]
},
{
......
......@@ -179,7 +179,9 @@
" # BUSBAR\n",
" u_res_feature_df, i_meas_feature_df = rq_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, \n",
" signal_name='U_RES', spark=spark)\n",
" res_busbar_row_df = rq_analysis.calculate_resistance(i_meas_feature_df, u_res_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names)\n",
" \n",
" from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis\n",
" res_busbar_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rq_analysis, i_meas_feature_df, u_res_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names)\n",
" res_busbar_df = rq_analysis.convert_to_col(res_busbar_row_df, signal_name='U_RES')"
]
},
......
......@@ -187,23 +187,24 @@
" plateau_start, plateau_end = RqCircuitQuery(circuit_type, circuit_names).calculate_current_plateau_start_end(t_start, t_end, i_meas_threshold=500, min_duration_in_sec=600, time_shift_in_sec=(240, 60), spark=spark)\n",
"\n",
" # BUSBAR\n",
" from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis\n",
" # # RQD\n",
" u_res_rqd_feature_df, i_meas_rqd_feature_df = rqd_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_RES', spark=spark)\n",
" res_busbar_rqd_row_df = rq_analysis.calculate_resistance(i_meas_rqd_feature_df, u_res_rqd_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names[0])\n",
" res_busbar_rqd_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rq_analysis, i_meas_rqd_feature_df, u_res_rqd_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names[0])\n",
" res_busbar_rqd_df = rq_analysis.convert_to_col(res_busbar_rqd_row_df, signal_name='U_RES')\n",
" # # RQF\n",
" u_res_rqf_feature_df, i_meas_rqf_feature_df = rqf_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_RES', spark=spark)\n",
" res_busbar_rqf_row_df = rq_analysis.calculate_resistance(i_meas_rqf_feature_df, u_res_rqf_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names[1])\n",
" res_busbar_rqf_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rq_analysis, i_meas_rqf_feature_df, u_res_rqf_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names[1])\n",
" res_busbar_rqf_df = rq_analysis.convert_to_col(res_busbar_rqf_row_df, signal_name='U_RES')\n",
" \n",
" # MAGNET\n",
" # # RQD\n",
" u_mag_rqd_feature_df, i_meas_rqd_feature_df = rqd_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_MAG', spark=spark)\n",
" res_magnet_rqd_row_df = rq_analysis.calculate_resistance(i_meas_rqd_feature_df, u_mag_rqd_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_names[0])\n",
" res_magnet_rqd_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rq_analysis, i_meas_rqd_feature_df, u_mag_rqd_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_names[0])\n",
" res_magnet_rqd_df = rq_analysis.convert_to_col(res_magnet_rqd_row_df, signal_name='U_MAG')\n",
" # # RQF\n",
" u_mag_rqf_feature_df, i_meas_rqf_feature_df = rqf_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_MAG', spark=spark)\n",
" res_magnet_rqf_row_df = rq_analysis.calculate_resistance(i_meas_rqf_feature_df, u_mag_rqf_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_names[1])\n",
" res_magnet_rqf_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rq_analysis, i_meas_rqf_feature_df, u_mag_rqf_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_names[1])\n",
" res_magnet_rqf_df = rq_analysis.convert_to_col(res_magnet_rqf_row_df, signal_name='U_MAG')\n",
"\n",
" # DFB\n",
......@@ -520,7 +521,7 @@
},
"outputs": [],
"source": [
"RqCircuitAnalysis.assert_u_res_min_max_value(u_res_rqd_nxcals_dfs+u_res_rqf_nxcals_dfs, value_range=(-40e-3, 40e-3));"
"RqCircuitAnalysis.assert_u_res_min_max_value(u_res_rqd_nxcals_dfs+u_res_rqf_nxcals_dfs, value_range=(-60e-3, 60e-3));"
]
},
{
......
......@@ -266,24 +266,26 @@
" if t_pnob3 > 1800 and len(plateau_start) > 1:\n",
" rqd_query.max_executions += 2\n",
" rqf_query.max_executions += 2\n",
" \n",
" # BUSBAR\n",
" from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis\n",
" # # RQD\n",
" u_res_rqd_feature_df, i_meas_rqd_feature_df = rqd_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_RES', spark=spark)\n",
" res_busbar_rqd_row_df = rq_analysis.calculate_resistance(i_meas_rqd_feature_df, u_res_rqd_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names[0])\n",
" res_busbar_rqd_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rq_analysis, i_meas_rqd_feature_df, u_res_rqd_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names[0])\n",
" res_busbar_rqd_df = convert_to_col(res_busbar_rqd_row_df, signal_name='U_RES')\n",
" # # RQF\n",
" u_res_rqf_feature_df, i_meas_rqf_feature_df = rqf_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_RES', spark=spark)\n",
" res_busbar_rqf_row_df = rq_analysis.calculate_resistance(i_meas_rqf_feature_df, u_res_rqf_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names[1])\n",
" res_busbar_rqf_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rq_analysis, i_meas_rqf_feature_df, u_res_rqf_feature_df, 'U_RES', Time.to_unix_timestamp(t_start), circuit_names[1])\n",
" res_busbar_rqf_df = convert_to_col(res_busbar_rqf_row_df, signal_name='U_RES')\n",
"\n",
" # MAGNET\n",
" # # RQD\n",
" u_mag_rqd_feature_df, i_meas_rqd_feature_df = rqd_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_MAG', spark=spark)\n",
" res_magnet_rqd_row_df = rq_analysis.calculate_resistance(i_meas_rqd_feature_df, u_mag_rqd_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_names[0])\n",
" res_magnet_rqd_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rq_analysis, i_meas_rqd_feature_df, u_mag_rqd_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_names[0])\n",
" res_magnet_rqd_df = convert_to_col(res_magnet_rqd_row_df, signal_name='U_MAG')\n",
" # # RQF\n",
" u_mag_rqf_feature_df, i_meas_rqf_feature_df = rqf_query.get_busbar_resistances(Time.to_unix_timestamp(t_start), Time.to_unix_timestamp(t_end), plateau_start, plateau_end, signal_name='U_MAG', spark=spark)\n",
" res_magnet_rqf_row_df = rq_analysis.calculate_resistance(i_meas_rqf_feature_df, u_mag_rqf_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_names[1])\n",
" res_magnet_rqf_row_df = MultipleBusbarResistanceAnalysis.calculate_resistance(rq_analysis, i_meas_rqf_feature_df, u_mag_rqf_feature_df, 'U_MAG', Time.to_unix_timestamp(t_start), circuit_names[1])\n",
" res_magnet_rqf_df = convert_to_col(res_magnet_rqf_row_df, signal_name='U_MAG')\n",
" else:\n",
" res_busbar_rqd_df, res_busbar_rqf_df, res_magnet_rqd_df, res_magnet_rqf_df = 4*[pd.DataFrame()]\n",
......@@ -878,7 +880,7 @@
"outputs": [],
"source": [
"if t_pnob3 > 1800:\n",
" RqCircuitAnalysis.assert_u_res_min_max_value(u_res_rqd_nxcals_dfs+u_res_rqf_nxcals_dfs, value_range=(-40e-3, 40e-3))"
" RqCircuitAnalysis.assert_u_res_min_max_value(u_res_rqd_nxcals_dfs+u_res_rqf_nxcals_dfs, value_range=(-60e-3, 60e-3))"
]
},
{
......
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