Commit 2357a2c3 authored by Michal Maciejewski's avatar Michal Maciejewski
Browse files

Corrected Splice calculation in RB and RQ

parent 4f34fa0c
Pipeline #2345697 passed with stage
in 13 seconds
__version__ = "1.5.24"
__version__ = "1.5.25"
......@@ -332,31 +332,27 @@
" - Buffer range 501 to 1500, event at point 1000\n",
" - Time range: -2 to 2 s\n",
" - Frequency: 250 Hz (dt = 4 ms)"
]
},
 
 
 
 
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from lhcsmapi.gui.pc.fgc_pm_event_select.IpdFgcPmEventSelectBaseModule import IpdFgcPmEventSelectBaseModule\n",
"IpdFgcPmEventSelectBaseModule('IPD').display_qps_circuit_schematic(circuit_name)"
]
},
{
"cell_type": "markdown",
"metadata": {
{
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
"*GRAPHS*: \n",
"\n",
"- t = 0 s corresponds to the start of the test"
"## 5.1. Resistive Voltage\n",
"\n",
"*GRAPHS*: \n",
"\n",
"- t = 0 s corresponds to the start of the test"
]
......
......@@ -90,17 +90,16 @@
"deleteable": false,
"tags": [
"skip_cell"
]
},
"source": [
 
"In order to perform the analysis of a FPA in an IPQ circuit please:\n",
"1. Select circuit name prefix (e.g., RQ5)\n",
"2. Choose start and end time\n",
"3. Choose analysis mode (Automatic by default)\n",
"\n",
"Once these inputs are provided, click 'Find FGC PM entries' button. This will trigger a search of the PM database in order to provide a list of timestamps of FGC events associated with the selected circuit name for the provided period of time. Select one timestamp from the 'FGC PM Entries' list to be processed by the following cells.\n",
"Once these inputs are provided, click 'Find FGC PM entries' button. This will trigger a search of the PM database in order to provide a list of timestamps of FGC events associated with the selected circuit name for the provided period of time. Select one timestamp from the 'FGC PM Entries' list to be processed by the following cells.\n",
"\n",
"**Note that 24 hours is the maximum duration of a single PM query for an event. To avoid delays in querying events, please restrict your query duration as much as possible.**"
]
},
......@@ -113,11 +112,11 @@
},
"outputs": [],
"source": [
"circuit_type = 'IPQ'\n",
"fgc_pm_search = FgcPmSearchModuleMediator(DateTimeBaseModule(start_date_time='2021-02-10 00:00:00+01:00',\n",
]
" end_date_time='2021-02-28 00:00:00+01:00'), circuit_type=circuit_type)"
]
},
{
"cell_type": "markdown",
"metadata": {
......@@ -183,10 +182,11 @@
" # # Reference\n",
" u_hds_ref_dfss = ipq_query.query_qh_pm(source_timestamp_qds_df, signal_names=['U_HDS'], is_ref=True)\n",
" u_hds_ref_dfs = u_hds_ref_dfss[0] if u_hds_ref_dfss else []\n",
"\n",
" # LEADS B1\n",
" u_hts_b1_dfs = ipq_query.query_leads(timestamp_fgc, source_timestamp_qds_df, system='LEADS_B1', signal_names=['U_HTS'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
" u_res_b1_dfs = ipq_query.query_leads(timestamp_fgc, source_timestamp_qds_df, system='LEADS_B1', signal_names=['U_RES'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
"\n",
" # LEADS B2\n",
" u_hts_b2_dfs = ipq_query.query_leads(timestamp_fgc, source_timestamp_qds_df, system='LEADS_B2', signal_names=['U_HTS'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
" u_res_b2_dfs = ipq_query.query_leads(timestamp_fgc, source_timestamp_qds_df, system='LEADS_B2', signal_names=['U_RES'], spark=spark, duration=[(300, 's'), (900, 's')])\n",
......
......@@ -100,11 +100,15 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
"source": [
"# 1. User Input\n",
"1. Copy code from AccTesting and paste into an empty cell below\n",
"<img src=\"https://gitlab.cern.ch/LHCData/lhc-sm-hwc/-/raw/master/figures/swan-manual-acctesting-integration.png\">\n",
"\n",
" - If you only want to test the notebook only for the copy&paste feature (without opening the AccTesting), please copy and execute the code below\n",
" ```\n",
" hwc_test = 'PNO.a7'\n",
" circuit_name = 'RQ10.R4'\n",
" campaign = 'HWC_2018_2'\n",
......@@ -131,11 +135,11 @@
},
"outputs": [],
"source": [
"hwc_test = 'PNO.a7' \n",
"circuit_name = 'RQ6.L8' \n",
"outputs": [],
 
"t_start = '2021-02-23 13:32:18.736000000'\n",
"t_end = '2021-02-23 14:01:02.269000000'"
]
},
{
......
......@@ -282,20 +282,20 @@
"\n",
"**Magnet:**\n",
"- See polarity convention here above\n",
"- U_RES_B1 = U_1_B1 + U_2_B1\n",
"- U_RES_B2 = U_1_B2 + U_2_B2\n",
 
 
"- Attention: B1 signals & B2 signals can be shifted by 4ms from each other\n",
"- If pure inductive signal:\n",
" - If dI/dt < 0:\n",
" - U_1_Qx = Ldi / dt < 0\n",
" - U_2_Qx = -Ldi / dt > 0\n",
"- PM file:\n",
" - Buffer range: 501 to 1500, event at point 1000\n",
" - Time range: -2 to 2s\n",
 
 
]
},
{
"cell_type": "code",
"execution_count": null,
......
......@@ -127,11 +127,15 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
"source": [
"# 1. User Input\n",
"1. Copy code from AccTesting and paste into an empty cell below\n",
"<img src=\"https://gitlab.cern.ch/LHCData/lhc-sm-hwc/-/raw/master/figures/swan-manual-acctesting-integration.png\">\n",
"\n",
" - If you only want to test the notebook only for the copy&paste feature (without opening the AccTesting), please copy and execute the code below\n",
" ```\n",
" hwc_test = 'PNO.a9'\n",
" circuit_name = 'RQX.L1'\n",
" campaign = 'HWC_2018_2'\n",
......@@ -181,11 +185,11 @@
"source": [
"# 2. Query All Signals Prior to Analysis"
]
},
{
"metadata": {
 
"execution_count": null,
"metadata": {
"deletable": false,
"scrolled": true,
"tags": [
......
......@@ -121,13 +121,15 @@
"metadata": {},
"source": [
"# 4. Signature Decision"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"signature = get_expert_decision('Expert Signature Decision: ', ['PASSED', 'FAILED'])"
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"signature = get_expert_decision('Expert Signature Decision: ', ['PASSED', 'FAILED'])"
]
},
{
......
......@@ -121,13 +121,17 @@
"source": [
"# 4. Signature Decision"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"signature = get_expert_decision('Expert Signature Decision: ', ['PASSED', 'FAILED'])"
]
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"signature = get_expert_decision('Expert Signature Decision: ', ['PASSED', 'FAILED'])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
......
......@@ -122,13 +122,16 @@
"metadata": {},
"source": [
"# 4. Signature Decision"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"signature = get_expert_decision('Expert Signature Decision: ', ['PASSED', 'FAILED'])"
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"signature = get_expert_decision('Expert Signature Decision: ', ['PASSED', 'FAILED'])"
]
},
{
"cell_type": "markdown",
......
......@@ -177,11 +177,12 @@
" 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_df = rb_analysis.convert_to_col(res_busbar_row_df, signal_name='U_RES')"
]
},
{
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
"# 3. Power Converter\n",
"## 3.1. Plot of the Power Converter Main Current\n",
......@@ -213,18 +214,19 @@
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
"# 4. Busbar\n",
"## 4.1. Busbar Resistance\n",
"\n",
"*ANALYSIS*:\n",
"\n",
"- Calculation of the busbar resistance as the slope of a linear fit of U,I curve obtained from the corresponding mean alues of the voltage and current\n",
"*ANALYSIS*:\n",
"\n",
"*CRITERIA*:\n",
"\n",
"- Check if the busbar resistance is below 3 nOhm\n",
"\n",
......
......@@ -191,11 +191,12 @@
" 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)\n",
"\n",
" tt891a_nxcals_dfs = rb_query.query_dfb_signal_nxcals(t_start, t_end, system=['LEADS_EVEN_WINCCOA', 'LEADS_ODD_WINCCOA'], signal_names='TT891A', spark=spark)\n",
" tt893_nxcals_dfs = rb_query.query_dfb_signal_nxcals(t_start, t_end, system=['LEADS_EVEN_WINCCOA', 'LEADS_ODD_WINCCOA'], signal_names='TT893', spark=spark)\n",
" cv891_nxcals_dfs = rb_query.query_dfb_signal_nxcals(t_start, t_end, system=['LEADS_EVEN_WINCCOA', 'LEADS_ODD_WINCCOA'], signal_names='CV891', spark=spark)\n"
]
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false
},
......@@ -228,11 +229,12 @@
"%matplotlib notebook\n",
"title = '%s, %s: %s-%s' % (circuit_name, hwc_test, Time.to_string(t_start).split('.')[0], Time.to_string(t_end).split('.')[0])\n",
"rb_analysis.plot_i_meas_with_current_plateau(i_meas_nxcals_df, t0=i_meas_raw_nxcals_df.index[0], plateau_start=plateau_start, plateau_end=plateau_end, title=title)"
]
},
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
"# 4. Busbar\n",
......@@ -368,10 +370,12 @@
"outputs": [],
"source": [
"RbCircuitAnalysis.assert_u_res_min_max_slope(u_res_nxcals_dfs, plateau_start, plateau_end, Time.to_unix_timestamp(t_start), slope_range=(-2, 2))"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
"## 5.2. DFB Voltage - U_HTS\n",
......@@ -380,11 +384,10 @@
"- Check if the voltage is below 50% of the threshold -> Abs(U_HTS) < 0.5 mV\n",
"\n",
"*GRAPHS*:\n",
"- t = 0 s corresponds to the start time of the test"
]
"- t = 0 s corresponds to the start time of the test"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
......
......@@ -200,12 +200,12 @@
" source_ee_odd = source_timestamp_ee_odd_df.loc[0, 'source']\n",
" u_dump_res_odd_df = rb_query.query_ee_u_dump_res_pm(timestamp_ee_odd, timestamp_fgc, system='EE_ODD', signal_names=['U_DUMP_RES'])[0]\n",
"\n",
" source_timestamp_ee_even_df = rb_query.find_source_timestamp_ee(timestamp_fgc, system='EE_EVEN')\n",
" timestamp_ee_even = source_timestamp_ee_even_df.loc[0, 'timestamp']\n",
" source_ee_even = source_timestamp_ee_even_df.loc[0, 'source']\n",
" u_dump_res_even_df = rb_query.query_ee_u_dump_res_pm(timestamp_ee_even, timestamp_fgc, system='EE_EVEN', signal_names=['U_DUMP_RES'])[0]\n",
" source_ee_even = source_timestamp_ee_even_df.loc[0, 'source']\n",
" u_dump_res_even_df = rb_query.query_ee_u_dump_res_pm(timestamp_ee_even, timestamp_fgc, system='EE_EVEN', signal_names=['U_DUMP_RES'])[0]\n",
" \n",
" # EE Temperature\n",
" t_res_odd_0_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_odd_df.loc[0, 'timestamp'], timestamp_fgc, signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_ODD')\n",
" if len(source_timestamp_ee_odd_df) > 1:\n",
" t_res_odd_1_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_odd_df.loc[1, 'timestamp'], timestamp_fgc, signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_ODD')\n",
......
......@@ -178,11 +178,12 @@
" 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",
" res_busbar_df = rb_analysis.convert_to_col(res_busbar_row_df, signal_name='U_RES')"
]
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false
},
......@@ -214,18 +215,19 @@
"mpl.rcParams['figure.dpi'] = 80\n",
"%matplotlib notebook\n",
"title = '%s, %s: %s-%s' % (circuit_name, hwc_test, Time.to_string(t_start).split('.')[0], Time.to_string(t_end).split('.')[0])\n",
"rb_analysis.plot_i_meas_with_current_plateau(i_meas_nxcals_df, t0=i_meas_raw_nxcals_df.index[0], plateau_start=plateau_start, plateau_end=plateau_end, title=title)"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
"# 4. Busbar\n",
"## 4.1. Busbar Resistance\n",
"source": [
"\n",
"*ANALYSIS*:\n",
"\n",
"- Calculation of the busbar resistance as the slope of a linear fit of U,I curve obtained from the corresponding mean alues of the voltage and current\n",
"\n",
......
......@@ -193,11 +193,12 @@
" 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)\n",
"\n",
" tt891a_nxcals_dfs = rb_query.query_dfb_signal_nxcals(t_start, t_end, system=['LEADS_EVEN_WINCCOA', 'LEADS_ODD_WINCCOA'], signal_names='TT891A', spark=spark)"
]
},
{
{
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
"# 3. Power Converter\n",
......@@ -229,11 +230,12 @@
"title = '%s, %s: %s-%s' % (circuit_name, hwc_test, Time.to_string(t_start).split('.')[0], Time.to_string(t_end).split('.')[0])\n",
"rb_analysis.plot_i_meas_with_current_plateau(i_meas_nxcals_df, t0=i_meas_raw_nxcals_df.index[0], plateau_start=plateau_start, plateau_end=plateau_end, title=title)"
]
},
{
{
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
"# 4. Busbar\n",
"## 4.1. Busbar Resistance\n",
......@@ -318,10 +320,12 @@
"deletable": false
},
"outputs": [],
"source": [
"title = '%s, %s: %s-%s' % (circuit_name, hwc_test, Time.to_string(t_start).split('.')[0], Time.to_string(t_end).split('.')[0])\n",
"res_magnet_outliers_df = rb_analysis.analyze_busbar_magnet_resistance(res_magnet_df, signal_name='R_MAG', value_max=50e-9, title=title)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
......@@ -330,11 +334,10 @@
"outputs": [],
"source": [
"RbCircuitQuery.query_and_plot_outlier_voltage(res_magnet_outliers_df.reset_index(), t_start, t_end, i_meas_raw_nxcals_df.index[0], plateau_start, plateau_end, spark=spark)"
]
},
]
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
......
......@@ -164,13 +164,13 @@
" t_start = Time.to_unix_timestamp(t_start)\n",
" t_end = Time.to_unix_timestamp(t_end)\n",
" is_automatic = False\n",
"\n",
"circuit_names = [circuit_name if 'RQD' in circuit_name else circuit_name.replace('F', 'D'), \n",
" circuit_name if 'RQF' in circuit_name else circuit_name.replace('D', 'F')]\n",
 
"rq_query = RqCircuitQuery(circuit_type, circuit_names, max_executions=4)\n",
" circuit_name if 'RQF' in circuit_name else circuit_name.replace('D', 'F')]\n",
 
"rq_query = RqCircuitQuery(circuit_type, circuit_names, max_executions=4)\n",
"rq_analysis = RqCircuitAnalysis(circuit_type, None, is_automatic=is_automatic)\n",
"\n",
"with Timer():\n",
" # PC\n",
" i_meas_nxcals_dfs = rq_query.query_signal_nxcals(t_start, t_end, t0=t_start, system='PC', signal_names='I_MEAS', spark=spark)\n",
......@@ -191,11 +191,12 @@
},
"source": [
"# 3. Circuit Parameters Table"
]
},
{
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
},
"outputs": [],
......@@ -228,18 +229,19 @@
"source": [
"import matplotlib as mpl\n",
"mpl.rcParams['savefig.dpi'] = 80\n",
"mpl.rcParams['figure.dpi'] = 80\n",
"%matplotlib notebook\n",
"title = '%s-%s, %s: %s-%s' % (circuit_names[0], circuit_names[1], hwc_test, Time.to_string(t_start).split('.')[0], Time.to_string(t_end).split('.')[0])\n",
"i_meas_nxcals_dfs[0].rename(columns={'I_MEAS': '%s:I_MEAS' % circuit_names[0]}, inplace=True)\n",
"i_meas_nxcals_dfs[1].rename(columns={'I_MEAS': '%s:I_MEAS' % circuit_names[1]}, inplace=True)\n",
"rq_analysis.plot_i_meas_with_current_plateau(i_meas_nxcals_dfs, t0=i_meas_raw_nxcals_dfs[0].index[0], plateau_start=plateau_start, plateau_end=plateau_end, title=title)"
]
},
{
"cell_type": "markdown",
"metadata": {
{
"deletable": false
},
"source": [
"# 5. Busbar\n",
"## 5.1. RQ Busbar Resistance\n",
......
......@@ -199,11 +199,13 @@
" 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_df = rq_analysis.convert_to_col(res_busbar_rqf_row_df, signal_name='U_RES')\n",
" \n",
" # MAGNET\n",
" # # RQD\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_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_df = rq_analysis.convert_to_col(res_magnet_rqf_row_df, signal_name='U_MAG')\n",
......@@ -221,14 +223,19 @@
" tt891a_rqf_nxcals_dfs = rqf_query.query_dfb_signal_nxcals(t_start, t_end, system='LEADS_WINCCOA', signal_names='TT891A', spark=spark)"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false
},
"source": [
"# 3. Circuit Parameters Table"
]
},
"deletable": false
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
},
"outputs": [],
......@@ -247,14 +254,19 @@
"\n",
"*GRAPHS*:\n",
"\n",
"- t = 0 s corresponds to the start of the test\n",
"- Orange box(es) represent period(s) of time with constant current used for calculation of busbar resistance and DFB thresholds"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
"*GRAPHS*:\n",
},
"outputs": [],
"source": [
"import matplotlib as mpl\n",
"mpl.rcParams['savefig.dpi'] = 80\n",
"mpl.rcParams['figure.dpi'] = 80\n",
"%matplotlib notebook\n",
......@@ -290,14 +302,19 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"- RQD"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
]
},
"outputs": [],
"source": [
"title = '%s, %s: %s-%s' % (circuit_names[0], hwc_test, Time.to_string(t_start).split('.')[0], Time.to_string(t_end).split('.')[0])\n",
"res_busbar_rqd_outliers_df = rq_analysis.analyze_busbar_magnet_resistance(res_busbar_rqd_df, signal_name='R_RES', value_max=10e-9, title=title)"
]
},
......@@ -316,14 +333,19 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
"scrolled": true
},
"outputs": [],
"source": [
"RqCircuitQuery.query_and_plot_outlier_voltage(res_busbar_rqd_outliers_df.reset_index(), t_start, t_end, i_meas_raw_nxcals_dfs[0].index[0], plateau_start, plateau_end, spark=spark)"
]
},
"cell_type": "code",
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"rqd_busbar_metadata_resistance_df = rq_analysis.merge_busbar_metadata_with_resistance(res_busbar_rqd_df, circuit_type, circuit_names)\n",
......@@ -332,18 +354,18 @@
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
 
 
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
 
 
},
"outputs": [],
"source": [
"title = '%s, %s: %s-%s' % (circuit_names[1], hwc_test, Time.to_string(t_start).split('.')[0], Time.to_string(t_end).split('.')[0])\n",
"res_busbar_rqf_outliers_df = rq_analysis.analyze_busbar_magnet_resistance(res_busbar_rqf_df, signal_name='R_RES', value_max=10e-9, title=title)"
......@@ -427,10 +449,12 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false
},
"outputs": [],
"source": [
"print('List of not working busbar measurements:')\n",
"res_magnet_rqd_df[res_magnet_rqd_df['R_MAG'] == 0]"
]
},
......@@ -449,11 +473,10 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
]
"rqd_magnet_metadata_resistance_df = rq_analysis.merge_busbar_metadata_with_resistance(res_magnet_rqd_df, circuit_type, circuit_names, res_col='R_MAG')\n",
"rq_analysis.display_busbar_metadata_resistance_with_threshold(rqd_magnet_metadata_resistance_df, threshold=50e-9, res_col='R_MAG')"
]
},
{
......
......@@ -246,10 +246,12 @@
" t_res_1_rqf_ref_df = pd.DataFrame(columns=['T_RES'])\n",
"\n",
" # DFB\n",
" source_timestamp_leads_rqd_df = rqd_query.find_timestamp_leads(timestamp_fgc_rqd)\n",
" u_hts_rqd_dfs = rqd_query.query_leads(timestamp_fgc_rqd, source_timestamp_leads_rqd_df, signal_names=['U_HTS'], spark=spark)\n",
" u_res_rqd_dfs = rqd_query.query_leads(timestamp_fgc_rqd, source_timestamp_leads_rqd_df, signal_names=['U_RES'], spark=spark)\n",
" \n",
" source_timestamp_leads_rqf_df = rqf_query.find_timestamp_leads(timestamp_fgc_rqf)\n",
" u_hts_rqf_dfs = rqf_query.query_leads(timestamp_fgc_rqf, source_timestamp_leads_rqf_df, signal_names=['U_HTS'], spark=spark)\n",
" u_res_rqf_dfs = rqf_query.query_leads(timestamp_fgc_rqf, source_timestamp_leads_rqf_df, signal_names=['U_RES'], spark=spark)\n",
" \n",
" timestamp_dct = {'FGC_RQD': timestamp_fgc_rqd, 'FGC_RQF': timestamp_fgc_rqf, 'PIC_RQD': timestamp_pic_rqd, 'PIC_RQF': timestamp_pic_rqf, 'EE_RQD': timestamp_ee_rqd, 'EE_RQF': timestamp_ee_rqf, 'LEADS_RQD': source_timestamp_leads_rqd_df, 'LEADS_RQF': source_timestamp_leads_rqf_df}\n",
......
......@@ -169,11 +169,13 @@
" t_end = Time.to_unix_timestamp(t_end)\n",
" is_automatic = False\n",
"\n",
"circuit_names = [circuit_name if 'RQD' in circuit_name else circuit_name.replace('F', 'D'), \n",
" circuit_name if 'RQF' in circuit_name else circuit_name.replace('D', 'F')]\n",
"\n",
"\n",
"rq_query = RqCircuitQuery(circuit_type, circuit_names, max_executions=4)\n",
"rq_analysis = RqCircuitAnalysis(circuit_type, None, is_automatic=is_automatic)\n",
"\n",
"with Timer():\n",