Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LHCData
lhc-sm-hwc
Commits
7a0df538
Commit
7a0df538
authored
Apr 12, 2021
by
Thibaud Marie Eric Buffet
Browse files
remove useless nAPS in rb
parent
bf9e787c
Pipeline
#2483518
passed with stage
in 36 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
7a0df538
**/.sys.v#.*.ipynb/
**.sys.v#.*
.idea/
rb/nQPS_Viewer.ipynb
deleted
100644 → 0
View file @
bf9e787c
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "driven-console",
"metadata": {},
"outputs": [],
"source": [
"from lhcsmapi.Time import Time\n",
"from lhcsmapi.pyedsl.QueryBuilder import QueryBuilder\n",
"\n",
"circuit_type = 'RB'\n",
"circuit_name = 'RB.A78'\n",
"t_start = '2021-03-15 06:46:32.124000000'\n",
"t_end = '2021-03-15 07:16:05.697000000'\n",
"\n",
"u_res_dfs = QueryBuilder().with_nxcals(spark) \\\n",
" .with_duration(t_start=t_start, t_end=t_end) \\\n",
" .with_circuit_type(circuit_type) \\\n",
" .with_metadata(circuit_name=circuit_name, system='BUSBAR', signal='U_RES', wildcard={'BUSBAR': '*'}) \\\n",
" .multi_signal_query() \\\n",
" .synchronize_time(Time.to_unix_timestamp(t_start)) \\\n",
" .convert_index_to_sec().dfs"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fifty-direction",
"metadata": {},
"outputs": [],
"source": [
"i_meas_df = QueryBuilder().with_nxcals(spark) \\\n",
" .with_duration(t_start=t_start, t_end=t_end) \\\n",
" .with_circuit_type(circuit_type) \\\n",
" .with_metadata(circuit_name=circuit_name, system='PC', signal='I_MEAS') \\\n",
" .signal_query() \\\n",
" .synchronize_time(Time.to_unix_timestamp(t_start)) \\\n",
" .convert_index_to_sec().dfs[0]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "authentic-advertising",
"metadata": {},
"outputs": [],
"source": [
"% matplotlib notebook\n",
"ax = i_meas_df.plot(figsize=(13, 6.5), grid=True)\n",
"ax2 = ax.twinx()\n",
"for u_res_df in u_res_dfs:\n",
" u_res_df.plot(ax=ax2)\n",
" \n",
"ax.set_xlabel('t, [s]')\n",
"ax.set_ylabel('I, [A]')\n",
"ax2.set_ylabel('U_RES, [V]')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "continued-problem",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
},
"sparkconnect": {
"bundled_options": [
"NXCALS",
"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,
"nbformat_minor": 5
}
%% Cell type:code id:driven-console tags:
```
python
from
lhcsmapi.Time
import
Time
from
lhcsmapi.pyedsl.QueryBuilder
import
QueryBuilder
circuit_type
=
'RB'
circuit_name
=
'RB.A78'
t_start
=
'2021-03-15 06:46:32.124000000'
t_end
=
'2021-03-15 07:16:05.697000000'
u_res_dfs
=
QueryBuilder
().
with_nxcals
(
spark
)
\
.
with_duration
(
t_start
=
t_start
,
t_end
=
t_end
)
\
.
with_circuit_type
(
circuit_type
)
\
.
with_metadata
(
circuit_name
=
circuit_name
,
system
=
'BUSBAR'
,
signal
=
'U_RES'
,
wildcard
=
{
'BUSBAR'
:
'*'
})
\
.
multi_signal_query
()
\
.
synchronize_time
(
Time
.
to_unix_timestamp
(
t_start
))
\
.
convert_index_to_sec
().
dfs
```
%% Cell type:code id:fifty-direction tags:
```
python
i_meas_df
=
QueryBuilder
().
with_nxcals
(
spark
)
\
.
with_duration
(
t_start
=
t_start
,
t_end
=
t_end
)
\
.
with_circuit_type
(
circuit_type
)
\
.
with_metadata
(
circuit_name
=
circuit_name
,
system
=
'PC'
,
signal
=
'I_MEAS'
)
\
.
signal_query
()
\
.
synchronize_time
(
Time
.
to_unix_timestamp
(
t_start
))
\
.
convert_index_to_sec
().
dfs
[
0
]
```
%% Cell type:code id:authentic-advertising tags:
```
python
%
matplotlib
notebook
ax
=
i_meas_df
.
plot
(
figsize
=
(
13
,
6.5
),
grid
=
True
)
ax2
=
ax
.
twinx
()
for
u_res_df
in
u_res_dfs
:
u_res_df
.
plot
(
ax
=
ax2
)
ax
.
set_xlabel
(
't, [s]'
)
ax
.
set_ylabel
(
'I, [A]'
)
ax2
.
set_ylabel
(
'U_RES, [V]'
)
```
%% Cell type:code id:continued-problem tags:
```
python
```
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment