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
......@@ -126,11 +126,12 @@
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]
i_meas_raw_nxcals_df = rb_query.query_raw_signal_nxcals(t_start, t_end, system='PC', signal_names='I_MEAS', spark=spark)[0]
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))
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)
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)
from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis
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)
res_busbar_df = rb_analysis.convert_to_col(res_busbar_row_df, signal_name='U_RES')
```
%% Cell type:markdown id: tags:
......
......@@ -120,23 +120,24 @@
rb_query = RbCircuitQuery(circuit_type, circuit_name, max_executions=6)
rb_analysis = RbCircuitAnalysis(circuit_type, None, is_automatic=is_automatic)
with Timer():
from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis
# PC
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]
i_meas_raw_nxcals_df = rb_query.query_raw_signal_nxcals(t_start, t_end, system='PC', signal_names='I_MEAS', spark=spark)[0]
plateau_start, plateau_end = rb_analysis.find_plateau_start_and_end(i_meas_raw_nxcals_df, i_meas_threshold=0, min_duration_in_sec=360, time_shift_in_sec=(240, 60))
# BUSBAR
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)
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)
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)
res_busbar_df = rb_analysis.convert_to_col(res_busbar_row_df, signal_name='U_RES')
# MAGNET
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)
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)
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)
res_magnet_df = rb_analysis.convert_to_col(res_magnet_row_df, signal_name='U_MAG')
# LEADS
u_res_nxcals_dfs = rb_query.query_signal_nxcals(t_start, t_end, t0=t_start, system=['LEADS_EVEN', 'LEADS_ODD'], signal_names='U_RES', spark=spark)
u_hts_nxcals_dfs = rb_query.query_signal_nxcals(t_start, t_end, t0=t_start, system=['LEADS_EVEN', 'LEADS_ODD'], signal_names='U_HTS', spark=spark)
......
......@@ -207,17 +207,18 @@
# BUSBAR
if len(plateau_start) > 1:
rb_query.max_executions += 2
# BUSBAR
from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis
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)
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)
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)
res_busbar_df = convert_to_col(res_busbar_row_df, signal_name='U_RES')
# MAGNET
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)
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)
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)
res_magnet_df = convert_to_col(res_magnet_row_df, signal_name='U_MAG')
else:
res_busbar_df = pd.DataFrame()
res_magnet_df = pd.DataFrame()
......
......@@ -136,27 +136,28 @@
i_meas_nxcals_dfs = RqCircuitQuery(circuit_type, circuit_names).query_signal_nxcals(t_start, t_end, t0=t_start, system='PC', signal_names='I_MEAS', spark=spark)
i_meas_raw_nxcals_dfs = RqCircuitQuery(circuit_type, circuit_names).query_raw_signal_nxcals(t_start, t_end, system='PC', signal_names='I_MEAS', spark=spark)
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)
# BUSBAR
from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis
# # RQD
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)
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])
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])
res_busbar_rqd_df = rq_analysis.convert_to_col(res_busbar_rqd_row_df, signal_name='U_RES')
# # RQF
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)
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])
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])
res_busbar_rqf_df = rq_analysis.convert_to_col(res_busbar_rqf_row_df, signal_name='U_RES')
# MAGNET
# # RQD
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)
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])
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])
res_magnet_rqd_df = rq_analysis.convert_to_col(res_magnet_rqd_row_df, signal_name='U_MAG')
# # RQF
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)
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])
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])
res_magnet_rqf_df = rq_analysis.convert_to_col(res_magnet_rqf_row_df, signal_name='U_MAG')
# DFB
# # RQD
u_res_rqd_nxcals_dfs = rqd_query.query_signal_nxcals(t_start, t_end, t0=t_start, system='LEADS', signal_names='U_RES', spark=spark)
......
......@@ -134,11 +134,13 @@
i_meas_threshold=500, min_duration_in_sec=360, time_shift_in_sec=(240, 60), spark=spark)
# BUSBAR
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)
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)
from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis
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)
res_busbar_df = rq_analysis.convert_to_col(res_busbar_row_df, signal_name='U_RES')
```
%% Cell type:markdown id: tags:
......
......@@ -137,27 +137,28 @@
i_meas_nxcals_dfs = RqCircuitQuery(circuit_type, circuit_names).query_signal_nxcals(t_start, t_end, t0=t_start, system='PC', signal_names='I_MEAS', spark=spark)
i_meas_raw_nxcals_dfs = RqCircuitQuery(circuit_type, circuit_names).query_raw_signal_nxcals(t_start, t_end, system='PC', signal_names='I_MEAS', spark=spark)
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)
# BUSBAR
from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis
# # RQD
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)
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])
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])
res_busbar_rqd_df = rq_analysis.convert_to_col(res_busbar_rqd_row_df, signal_name='U_RES')
# # RQF
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)
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])
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])
res_busbar_rqf_df = rq_analysis.convert_to_col(res_busbar_rqf_row_df, signal_name='U_RES')
# MAGNET
# # RQD
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)
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])
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])
res_magnet_rqd_df = rq_analysis.convert_to_col(res_magnet_rqd_row_df, signal_name='U_MAG')
# # RQF
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)
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])
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])
res_magnet_rqf_df = rq_analysis.convert_to_col(res_magnet_rqf_row_df, signal_name='U_MAG')
# DFB
# # RQD
u_res_rqd_nxcals_dfs = rqd_query.query_signal_nxcals(t_start, t_end, t0=t_start, system='LEADS', signal_names='U_RES', spark=spark)
......
......@@ -217,28 +217,30 @@
t_pnob3 = (plateau_end[-1]-plateau_start[-1])/1e9
if t_pnob3 > 1800 and len(plateau_start) > 1:
rqd_query.max_executions += 2
rqf_query.max_executions += 2
# BUSBAR
from lhcsmapi.analysis.busbar.BusbarResistanceAnalysis import MultipleBusbarResistanceAnalysis
# # RQD
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)
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])
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])
res_busbar_rqd_df = convert_to_col(res_busbar_rqd_row_df, signal_name='U_RES')
# # RQF
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)
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])
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])
res_busbar_rqf_df = convert_to_col(res_busbar_rqf_row_df, signal_name='U_RES')
# MAGNET
# # RQD
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)
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])
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])
res_magnet_rqd_df = convert_to_col(res_magnet_rqd_row_df, signal_name='U_MAG')
# # RQF
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)
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])
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])
res_magnet_rqf_df = convert_to_col(res_magnet_rqf_row_df, signal_name='U_MAG')
else:
res_busbar_rqd_df, res_busbar_rqf_df, res_magnet_rqd_df, res_magnet_rqf_df = 4*[pd.DataFrame()]
if t_pnob3 > 1800:
......
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