Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
ArchiveExtractor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DG
ArchiveExtractor
Commits
e15172f7
Commit
e15172f7
authored
2 years ago
by
BRONES Romain
Browse files
Options
Downloads
Patches
Plain Diff
Add Readme, mode core to root, change module name
parent
2acca3a2
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
ArchiveExtractor.py
+0
-0
0 additions, 0 deletions
ArchiveExtractor.py
README.md
+117
-0
117 additions, 0 deletions
README.md
__init__.py
+0
-1
0 additions, 1 deletion
__init__.py
core/__init__.py
+0
-1
0 additions, 1 deletion
core/__init__.py
with
117 additions
and
2 deletions
core/
ArchiveExtractor.py
→
ArchiveExtractor.py
+
0
−
0
View file @
e15172f7
File moved
This diff is collapsed.
Click to expand it.
README.md
0 → 100644
+
117
−
0
View file @
e15172f7
# pySoleilControl
Useful python tools for SOLEIL control system.
The ultimate aim is to provide tools that can be used in a shell prompt, ipython prompt or in python applications (such as GUI).
Under construction, the first brick is a module to retrieve data from the Tango Archiver.
## ArchiveExtractor
This module brings some functions to extract data from HDB/TDB.
Usage example, with an ipython prompt
```
python
In
[
1
]:
import
pySoleilControl.ArchiveExtractor
as
AE
In
[
2
]:
# For now, we need manual initialization of the module
...:
AE
.
init
()
In
[
3
]:
# Looking for an attribute in HDB
...:
AE
.
findattr
(
"
ans/dg/*dcct*
"
)
Out
[
3
]:
[
'
ANS/DG/DCCT-CTRL/State
'
,
'
ANS/DG/DCCT-CTRL/Status
'
,
'
ANS/DG/DCCT-CTRL/current
'
,
'
ANS/DG/DCCT-CTRL/dose
'
,
'
ANS/DG/DCCT-CTRL/lifeTime
'
,
'
ANS/DG/DCCT-CTRL/lifeTimeErr
'
]
In
[
4
]:
# Get data between two dates, this return a pandas.Dataframe object
...:
AE
.
ExtrBetweenDates
(
'
ANS/DG/DCCT-CTRL/current
'
,
'
2021-12-13
'
,
'
2021-12-13-12:00
'
)
INFO
:
Perform
ExtractBetweenDates
(
ans
/
dg
/
dcct
-
ctrl
/
current
,
2021
-
12
-
13
00
:
00
:
00
,
2021
-
12
-
13
12
:
00
:
00
)
Out
[
4
]:
2021
-
12
-
13
00
:
00
:
00
450.993568
2021
-
12
-
13
00
:
00
:
01
450.981979
2021
-
12
-
13
00
:
00
:
02
450.971455
2021
-
12
-
13
00
:
00
:
03
450.950542
2021
-
12
-
13
00
:
00
:
04
450.939951
...
2021
-
12
-
13
11
:
59
:
56
15.004553
2021
-
12
-
13
11
:
59
:
57
15.004243
2021
-
12
-
13
11
:
59
:
58
15.004942
2021
-
12
-
13
11
:
59
:
59
15.004878
2021
-
12
-
13
12
:
00
:
00
15.005410
Length
:
42725
,
dtype
:
float64
In
[
5
]:
# Get min, max and mean with a 10 minute window
...:
d
=
AE
.
ExtrBetweenDates_MinMaxMean
(
'
ANS/DG/DCCT-CTRL/current
'
,
'
2021-12-13
'
,
'
2021-12-13-12:00
'
,
timeInterval
=
'
10m
'
)
In
[
6
]:
d
Out
[
6
]:
Min
Mean
Max
2021
-
12
-
13
00
:
05
:
00
449.762286
450.619654
451.617095
2021
-
12
-
13
00
:
15
:
00
449.761171
450.676306
451.595391
2021
-
12
-
13
00
:
25
:
00
449.764910
450.684333
451.606520
2021
-
12
-
13
00
:
35
:
00
449.766284
450.688881
451.655843
2021
-
12
-
13
00
:
45
:
00
449.766808
450.716444
451.678886
...
...
...
...
2021
-
12
-
13
11
:
15
:
00
15.435944
15.495834
15.552427
2021
-
12
-
13
11
:
25
:
00
15.325022
15.383286
15.437459
2021
-
12
-
13
11
:
35
:
00
15.214556
15.270340
15.326395
2021
-
12
-
13
11
:
45
:
00
15.106309
15.163566
15.219333
2021
-
12
-
13
11
:
55
:
00
15.003812
15.056515
15.110022
[
72
rows
x
3
columns
]
In
[
7
]:
# Activate inline matplotlib
...:
%
matplotlib
Using
matplotlib
backend
:
TkAgg
In
[
7
]:
# Simply plot
...:
d
.
plot
()
In
[
8
]:
# ipython prompt supports autocompletion. The doc of function can be quickly read by adding a '?'
...:
AE
.
ExtrBetweenDates
?
Signature
:
AE
.
ExtrBetweenDates
(
attribute
,
dateStart
,
dateStop
=
None
,
db
=
'
H
'
)
Docstring
:
Query
attribute
data
from
an
archiver
database
,
get
all
points
between
dates
.
Use
ExtractBetweenDates
.
Parameters
----------
attribute
:
String
Name
of
the
attribute
.
Full
Tango
name
i
.
e
.
"
test/dg/panda/current
"
.
dateStart
:
datetime
.
datetime
,
string
Start
date
for
extraction
.
If
string
,
it
will
be
parsed
.
Example
of
string
format
%
Y
-%
m
-%
d
-%
H
:
%
M
:
%
S
or
less
precise
.
dateStop
:
datetime
.
datetime
,
string
,
None
Stop
date
for
extraction
.
If
string
,
it
will
be
parsed
.
Example
of
string
format
%
Y
-%
m
-%
d
-%
H
:
%
M
:
%
S
or
less
precise
.
If
None
,
it
takes
the
current
date
and
time
.
Default
is
None
(
now
).
db
:
str
Which
database
to
look
in
,
'
H
'
or
'
T
'
.
Exceptions
----------
ValueError
The
attribute
is
not
found
in
the
database
.
Returns
-------
[
date
,
value
]
:
array
date
:
numpy
.
ndarray
of
datetime
.
datime
objects
Dates
of
the
values
value
:
numpy
.
ndarray
Archived
values
File
:
~/
GrpDiagnostics
/
RBT
/
pySoleilControl
/
ArchiveExtractor
.
py
Type
:
function
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
__init__.py
+
0
−
1
View file @
e15172f7
from
pythontools.core
import
*
This diff is collapsed.
Click to expand it.
core/__init__.py
deleted
100644 → 0
+
0
−
1
View file @
2acca3a2
from
pythontools.core
import
ArchiveExtractor
as
ArchiveExtractor
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment