Commit b03325f9 authored by thbuffet's avatar thbuffet
Browse files

add missing resistance calculation update on the multi inheritance

parent de60b051
Pipeline #2584088 passed with stage
in 15 seconds
......@@ -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",
......
......@@ -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",
......
......@@ -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",
......
......@@ -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",
......
......@@ -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",
......
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