Commit 6058bbfc authored by Michal Maciejewski's avatar Michal Maciejewski
Browse files

Update RB HWC with the new GUI

parent 5814b0df
......@@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.7 (lhc-sm-hwc)" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.7 (venv)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -704,6 +704,19 @@
"SparkMetrics"
],
"list_of_options": []
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": false,
"sideBar": false,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
}
},
"nbformat": 4,
......
This diff is collapsed.
......@@ -80,30 +80,23 @@
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"source": [
"# 0. Initialise Working Environment"
]
},
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
"editable": false
},
"outputs": [],
"source": [
"from datetime import datetime\n",
"import time\n",
"import io\n",
"import re\n",
"import sys\n",
"import pandas as pd\n",
"from datetime import datetime\n",
......@@ -318,14 +311,12 @@
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4.1. Resistive Voltage\n",
"\n",
"*QUERY*:\n",
"\n",
"## 4.1. Resistive Voltage\n",
"\n",
"*QUERY*:\n",
"\n",
"|Variable Name\t|Variable Type\t|Variable Unit\t|Comment\n",
"|---------------|---------------|---------------|------|\n",
"|u_res_df\t|DataFrame\t|V\t|Resistive voltage of magnets measured with QPS, U_RES|\n",
......@@ -350,49 +341,36 @@
" .for_time_greater_than(t_greater=(timestamp_fgc-Time.to_unix_timestamp(t_start))/1e9) \\\n",
" .has_min_max_value(value_min=-30e-3, value_max=30e-3) \\\n",
" .show_plot(ylabel='U_RES, [V]')"
]
},
"metadata": {},
"source": [
"## 4.2. Splice Resistance\n",
"*QUERY*:\n",
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4.2. Splice Resistance\n",
"*QUERY*:\n",
"\n",
"*ANALYSIS*:\n",
"- Calculate splice resistance values based on power converter currents and QDS voltages\n",
"\n",
"|Variable Name\t|Variable Type\t|Variable Unit\t|Databse|Comment\n",
"|---------------|---------------|---------------|-------|------|\n",
"|i_meas_features_df |DataFrame| A |NXCALS| Power converter current mean values|\n",
"|u_res_features_df |DataFrame| V |NXCALS| U_RES voltage mean values|\n",
"\n",
"- t = 0 s corresponds to the start of the test"
]
},
{
"*ANALYSIS*:\n",
"- Calculate splice resistance values based on power converter currents and QDS voltages\n",
"\n",
"*CRITERIA*\n",
"- Check if R_max < 5 nOhm\n",
"\n",
"*GRAPHS*: \n",
},
"outputs": [],
"source": [
"for i_q_df, u_res_df in zip([i_meas_q1_nxcals_df, i_meas_q2_nxcals_df, i_meas_q3_nxcals_df], u_res_dfs):\n",
"- t = 0 s corresponds to the start of the test"
]
},
{
"cell_type": "code",
"execution_count": null,
" for ps, pe in zip(plateau_start, plateau_end):\n",
" ax.axvspan(xmin=(ps-Time.to_unix_timestamp(t_start))/1e9, xmax=(pe-Time.to_unix_timestamp(t_start))/1e9, facecolor='xkcd:orange')"
]
},
"metadata": {
"deletable": false,
"editable": false
},
"outputs": [],
"source": [
......
......@@ -72,30 +72,23 @@
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"source": [
"# 0. Initialise Working Environment"
]
},
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
"editable": false
},
"outputs": [],
"source": [
"from datetime import datetime\n",
"import time\n",
"import io\n",
"import re\n",
"import sys\n",
"import pandas as pd\n",
"from datetime import datetime\n",
......@@ -342,49 +335,35 @@
" .show_plot(ylabel='U_RES, [V]')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4.2. Splice Resistance\n",
"*QUERY*:\n",
"metadata": {},
"source": [
"## 4.2. Splice Resistance\n",
"*QUERY*:\n",
"\n",
"|Variable Name\t|Variable Type\t|Variable Unit\t|Databse|Comment\n",
"\n",
"*ANALYSIS*:\n",
"- Calculate splice resistance values based on power converter currents and QDS voltages\n",
"|---------------|---------------|---------------|-------|------|\n",
"|i_meas_features_df |DataFrame| A |NXCALS| Power converter current mean values|\n",
"|u_res_features_df |DataFrame| V |NXCALS| U_RES voltage mean values|\n",
"\n",
"*ANALYSIS*:\n",
"- Calculate splice resistance values based on power converter currents and QDS voltages\n",
"- t = 0 s corresponds to the start of the test"
]
},
{
"\n",
"*CRITERIA*\n",
"- Check if R_max < 5 nOhm\n",
"\n",
"*GRAPHS*: \n",
"- t = 0 s corresponds to the start of the test"
},
"outputs": [],
"source": [
"for i_q_df, u_res_df in zip([i_meas_q1_nxcals_df, i_meas_q2_nxcals_df, i_meas_q3_nxcals_df], u_res_dfs):\n",
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
" for ps, pe in zip(plateau_start, plateau_end):\n",
" ax.axvspan(xmin=(ps-Time.to_unix_timestamp(t_start))/1e9, xmax=(pe-Time.to_unix_timestamp(t_start))/1e9, facecolor='xkcd:orange')"
]
},
"deletable": false,
"editable": false
},
"outputs": [],
"source": [
"for i_q_df, u_res_df in zip([i_meas_q1_nxcals_df, i_meas_q2_nxcals_df, i_meas_q3_nxcals_df], u_res_dfs):\n",
......
......@@ -72,30 +72,23 @@
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"source": [
"# 0. Initialise Working Environment"
]
},
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
"editable": false
},
"outputs": [],
"source": [
"from datetime import datetime\n",
"import time\n",
"import io\n",
"import re\n",
"import sys\n",
"import pandas as pd\n",
"from datetime import datetime\n",
......@@ -342,49 +335,36 @@
" .show_plot(ylabel='U_RES, [V]')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4.2. Splice Resistance\n",
"*QUERY*:\n",
"metadata": {},
"source": [
"## 4.2. Splice Resistance\n",
"*QUERY*:\n",
"\n",
"|Variable Name\t|Variable Type\t|Variable Unit\t|Databse|Comment\n",
"\n",
"*ANALYSIS*:\n",
"- Calculate splice resistance values based on power converter currents and QDS voltages\n",
"|---------------|---------------|---------------|-------|------|\n",
"|i_meas_features_df |DataFrame| A |NXCALS| Power converter current mean values|\n",
"|u_res_features_df |DataFrame| V |NXCALS| U_RES voltage mean values|\n",
"\n",
"*ANALYSIS*:\n",
"- Calculate splice resistance values based on power converter currents and QDS voltages\n",
"- t = 0 s corresponds to the start of the test"
]
},
{
"\n",
"*CRITERIA*\n",
"- Check if R_max < 5 nOhm\n",
"\n",
"*GRAPHS*: \n",
"- t = 0 s corresponds to the start of the test"
},
"outputs": [],
"source": [
"for i_q_df, u_res_df in zip([i_meas_q1_nxcals_df, i_meas_q2_nxcals_df, i_meas_q3_nxcals_df], u_res_dfs):\n",
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
" for ps, pe in zip(plateau_start, plateau_end):\n",
" ax.axvspan(xmin=(ps-Time.to_unix_timestamp(t_start))/1e9, xmax=(pe-Time.to_unix_timestamp(t_start))/1e9, facecolor='xkcd:orange')"
]
},
"deletable": false,
"editable": false
},
"outputs": [],
"source": [
"for i_q_df, u_res_df in zip([i_meas_q1_nxcals_df, i_meas_q2_nxcals_df, i_meas_q3_nxcals_df], u_res_dfs):\n",
" ax = PlotBuilder().with_signal(i_q_df, title=title, grid=True) \\\n",
......
......@@ -142,11 +142,11 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": null,
 
"editable": false,
"scrolled": true,
"tags": [
"skip_output"
]
......@@ -164,14 +164,14 @@
" timestamp_pic = rb_query.find_timestamp_pic(timestamp_fgc, spark=spark)\n",
"\n",
" # PC Current\n",
" i_meas_df, i_a_df, i_earth_df, i_earth_pcnt_df, i_ref_df = rb_query.query_pc_pm(timestamp_fgc, timestamp_fgc, \n",
" signal_names=['I_MEAS', 'I_A', 'I_EARTH', 'I_EARTH_PCNT', 'I_REF'])\n",
" i_meas_df, i_a_df, i_earth_df, i_earth_pcnt_df, i_ref_df = rb_query.query_pc_pm(timestamp_fgc, timestamp_fgc, \n",
 
" timestamp_fgc_ref = rb_query.get_timestamp_ref(col='fgcPm')\n",
" i_meas_ref_df, i_earth_ref_df, i_earth_pcnt_ref_df = rb_query.query_pc_pm(timestamp_fgc_ref, timestamp_fgc_ref,\n",
" timestamp_fgc_ref = rb_query.get_timestamp_ref(col='fgcPm')\n",
" signal_names=['I_MEAS', 'I_EARTH', 'I_EARTH_PCNT'])\n",
"\n",
" # EE Voltage\n",
" source_timestamp_ee_odd_df = rb_query.find_source_timestamp_ee(timestamp_fgc, system='EE_ODD')\n",
" timestamp_ee_odd = source_timestamp_ee_odd_df.loc[0, 'timestamp']\n",
" source_ee_odd = source_timestamp_ee_odd_df.loc[0, 'source']\n",
......@@ -321,11 +321,11 @@
"source": [
"# 4. Schematic\n",
"The interactive schematic represents the analyzed circuit and contains:\n",
"- All magnets (the quenched ones are in red and the order of quenching is displayed)\n",
"- All nQPS crates in blue (the ones with the quenched magnets in red) \n",
"- All magnets (the quenched ones are in red and the order of quenching is displayed)\n",
"- Power converter with FGC timestamp\n",
"- Energy extraction systems (even and odd) with corresponding timestamps\n",
"- Current leads with PM timestamps (if applicable)\n",
"\n",
"Note that the drawing may take about 1 minute. The most of the time is spent on initializing the plotting library."
]
......@@ -338,17 +338,17 @@
"editable": false
},
"outputs": [],
"source": [
"if len(results_table) > 1:\n",
"source": [
" show_schematic(circuit_type, circuit_name, results_table, source_timestamp_nqps_df, source_timestamp_leads_odd_df, source_timestamp_leads_even_df,\n",
" timestamp_fgc, source_ee_odd, timestamp_ee_odd, source_ee_even, timestamp_ee_even, show_magnet_name=False)"
]
},
{
"cell_type": "markdown",
{
 
"deletable": false
},
"source": [
"# 5. PIC\n",
"## 5.1. Analysis of the PIC Timestamp\n",
......@@ -491,18 +491,25 @@
"*QUERY*:\n",
"\n",
"|Variable Name\t|Variable Type\t|Variable Unit\t|Database|Comment\n",
"|---------------|---------------|---------------|--------|------|\n",
"|i_a_df\t|DataFrame\t|A\t|PM|I_A is the raw power converter current logged around the FPA with high sampling frequench|\n",
"|Variable Name\t|Variable Type\t|Variable Unit\t|Database|Comment\n",
"|i_meas_df\t|DataFrame\t|A\t|PM|I_MEAS is filtered I_A with lower sampling frequency and longer duration|\n",
"|i_ref_df | DataFrame | A |PM| Reference power converter current, STATUS.I_REF|\n",
"|u_dump_res_odd_df | DataFrame | V |PM| First energy extraction voltage, U_DUMP_RES|\n",
"|u_dump_res_even_df | DataFrame | V |PM| Second energy extraction voltage, U_DUMP_RES|\n",
"\n",
"*ANALYSIS*:\n",
"\n",
"- Calculate U_dump_res (t=0)\n",
"- Calculate the characteristic time of pseudo-exponential current decay with the charge approach\n",
"\n",
"*CRITERIA*:\n",
"\n",
"- Check if U_dump_res (t=0) = 0.075*I V (±10%).\n",
"\n",
"- Check if the characteristic time of pseudo-exponential decay of I_MEAS from t=1 to 120 s is 110 s<-Tau <130 s\n",
"- Check if the timestamp difference between FGC and EE an odd point is 300±50 ms\n",
"After YETS 2017/8 the EE timestamp odd(RR or UJ) has been reduced and should now be 100+-50 ms after the FGC time stamp\n",
"- Check if the time stamp difference between FGC and EE an even point: 600±50 ms\n",
"\n",
"*GRAPHS*:\n",
"\n",
......
......@@ -51,11 +51,11 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
 
 
"scrolled": true
},
"outputs": [],
"source": [
"import io\n",
......@@ -143,13 +143,11 @@
"\n",
" if \"SPARK_PORTS\" in os.environ:\n",
" ports = os.getenv(\"SPARK_PORTS\").split(\",\")\n",
" else:\n",
" ports = [random.randrange(5001,5300),random.randrange(5001,5300),random.randrange(5001,5300)]\n",
" ports = [random.randrange(5001,5300),random.randrange(5001,5300),random.randrange(5001,5300)]\n",
"\n",
" # change to SPARK_MASTER_IP\n",
"\n",
" # change to SPARK_MASTER_IP\n",
" nxcals_jars=os.environ.get('NXCALS_JARS')\n",
" conf = SparkConf()\n",
" conf.set('spark.master', 'yarn')\n",
" conf.set('spark.authenticate', True)\n",
......@@ -325,11 +323,11 @@
"source": [
"# 5. Energy Extraction System\n",
"## 5.1. Analysis of the Energy Extraction Voltage\n",
"\n",
"*QUERY*:\n",
"## 5.1. Analysis of the Energy Extraction Voltage\n",
 
"|Variable Name\t|Variable Type\t|Variable Unit\t|Database|Comment\n",
"|---------------|---------------|---------------|--------|------|\n",
"|i_a_df\t|DataFrame\t|A\t|PM|I_A is the raw power converter current logged around the FPA with high sampling frequench|\n",
"|i_meas_df\t|DataFrame\t|A|PM\t|I_MEAS is filtered I_A with lower sampling frequency and longer duration|\n",
"|i_ref_df | DataFrame | A |PM| Reference power converter current, STATUS.I_REF|\n",
......
......@@ -53,11 +53,11 @@
"execution_count": null,
"metadata": {
"editable": false,
"scrolled": false
},
 
 
"source": [
"# External libraries\n",
"import io\n",
"import re\n",
"import sys\n",
......@@ -73,13 +73,11 @@
"from lhcsmapi.pyedsl.AssertionBuilder import AssertionBuilder\n",
"\n",
"from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator\n",
"\n",
"import lhcsmapi\n",
"print('Analysis executed with lhcsmapi version: {}'.format(lhcsmapi.__version__))\n",
"\n",
"with io.open(\"../__init__.py\", \"rt\", encoding=\"utf8\") as f:\n",
"print('Analysis executed with lhcsmapi version: {}'.format(lhcsmapi.__version__))\n",
"\n",
"with io.open(\"../__init__.py\", \"rt\", encoding=\"utf8\") as f:\n",
" version = re.search(r'__version__ = \"(.*?)\"', f.read()).group(1)\n",
" print('Analysis executed with lhc-sm-hwc notebooks version: {}'.format(version))"
]
......@@ -164,11 +162,11 @@
"ax.set_xlabel(\"time, [s]\", fontsize=15)\n",
"ax.set_ylabel(\"I_MEAS, [A]\", fontsize=15)\n",
"ax.tick_params(labelsize=15)"
]
},
]
 
"cell_type": "markdown",
"metadata": {},
"source": [
"# 4. Busbar\n",
"## 4.1. Busbar Voltage\n",
......
......@@ -54,11 +54,11 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
 
 
"scrolled": true
},
"outputs": [],
"source": [
"import io\n",
......@@ -83,20 +83,18 @@
"from lhcsmapi.analysis.report_template import apply_report_template\n",
"from lhcsmapi.analysis.RbCircuitAnalysis import RbCircuitAnalysis\n",
"\n",
"import lhcsmapi\n",
"print('Analysis executed with lhcsmapi version: {}'.format(lhcsmapi.__version__))\n",
"with io.open(\"../__init__.py\", \"rt\", encoding=\"utf8\") as f:\n",
" version = re.search(r'__version__ = \"(.*?)\"', f.read()).group(1)\n",
" print('Analysis executed with lhc-sm-hwc notebooks version: {}'.format(version))"
"\n",
"with io.open(\"../__init__.py\", \"rt\", encoding=\"utf8\") as f:\n",
" version = re.search(r'__version__ = \"(.*?)\"', f.read()).group(1)\n",
" print('Analysis executed with lhc-sm-hwc notebooks version: {}'.format(version))"
]
},
{
"# 1. Select PLI1.b2 HWC Test\n",
"cell_type": "markdown",
"metadata": {},
"source": [
"# 1. Select PLI1.b2 HWC Test\n",
"- Choose a circuit name in order to display HWC test with, campaign name as well as start and end time\n"
]
......@@ -280,11 +278,11 @@
"outputs": [],
"source": [
"rb_analysis.analyze_char_time_u_dump_res_ee(circuit_name, timestamp_fgc, [u_dump_res_odd_df, u_dump_res_even_df], i_meas_df)"
]
},
{
 
"cell_type": "code",
"execution_count": null,
"metadata": {
"editable": false,
"scrolled": false
......
......@@ -53,11 +53,11 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
 
 
"scrolled": true
},
"outputs": [],
"source": [
"import io\n",
......@@ -82,28 +82,26 @@
"from lhcsmapi.analysis.report_template import apply_report_template\n",
"from lhcsmapi.analysis.RbCircuitAnalysis import RbCircuitAnalysis\n",
"\n",
"import lhcsmapi\n",
"print('Analysis executed with lhcsmapi version: {}'.format(lhcsmapi.__version__))\n",
"with io.open(\"../__init__.py\", \"rt\", encoding=\"utf8\") as f:\n",
" version = re.search(r'__version__ = \"(.*?)\"', f.read()).group(1)\n",
" print('Analysis executed with lhc-sm-hwc notebooks version: {}'.format(version))"
"\n",
"with io.open(\"../__init__.py\", \"rt\", encoding=\"utf8\") as f:\n",
" version = re.search(r'__version__ = \"(.*?)\"', f.read()).group(1)\n",
" print('Analysis executed with lhc-sm-hwc notebooks version: {}'.format(version))"
]
},
{
"# 1. Select PLI1.d2 HWC Test\n",
"cell_type": "markdown",
"metadata": {},
"source": [
"# 1. Select PLI1.d2 HWC Test\n",
"- Choose a circuit name in order to display HWC test with, campaign name as well as start and end time\n"
]
},
{
"scrolled": false
 
"execution_count": null,
"metadata": {
"editable": false,
"scrolled": true
},
......@@ -249,11 +247,17 @@
"\n",
"- Check if U_dump_res (t=0) = 0.075*I V (±10%).\n",
"- Check if the characteristic time of pseudo-exponential decay of I_MEAS from t=1 to 120 s is 110 s<-Tau <130 s\n",
"- Check if the timestamp difference between FGC and EE an odd point is 300±50 ms\n",
"After YETS 2017/8 the EE timestamp odd(RR or UJ) has been reduced and should now be 100+-50 ms after the FGC time stamp\n",
"outputs": [],
"- Check if the time stamp difference between FGC and EE an even point: 600±50 ms\n",
"\n",
"*GRAPHS*:\n",
"\n",
"- t = 0 s corresponds to the PM timestamp of the FGC\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"editable": false
......
......@@ -53,11 +53,11 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
 
 
"scrolled": true
},
"outputs": [],
"source": [
"import io\n",
......@@ -82,13 +82,11 @@
"from lhcsmapi.analysis.report_template import apply_report_template\n",
"from lhcsmapi.analysis.RbCircuitAnalysis import RbCircuitAnalysis\n",
"\n",
"import lhcsmapi\n",
"print('Analysis executed with lhcsmapi version: {}'.format(lhcsmapi.__version__))\n",
"print('Analysis executed with lhcsmapi version: {}'.format(lhcsmapi.__version__))\n",
"\n",
"with io.open(\"../__init__.py\", \"rt\", encoding=\"utf8\") as f:\n",
"\n",
"with io.open(\"../__init__.py\", \"rt\", encoding=\"utf8\") as f:\n",
" version = re.search(r'__version__ = \"(.*?)\"', f.read()).group(1)\n",
" print('Analysis executed with lhc-sm-hwc notebooks version: {}'.format(version))"
]
},
......@@ -269,11 +267,11 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
"editable": false
"metadata": {
 
"outputs": [],
"source": [
"rb_analysis.analyze_char_time_u_dump_res_ee(circuit_name, timestamp_fgc, [u_dump_res_odd_df, u_dump_res_even_df], i_meas_df)"
]
},
......
......@@ -52,11 +52,11 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
 
 
},
"outputs": [],
"source": [
"import io\n",
"import re\n",
......@@ -80,13 +80,11 @@
"from lhcsmapi.analysis.report_template import apply_report_template\n",