Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bluesky_blissdata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
fs-ec
bluesky_blissdata
Commits
dc80bbcd
Commit
dc80bbcd
authored
10 months ago
by
Udai Singh
Browse files
Options
Downloads
Patches
Plain Diff
fixed some issue with daiquiri
parent
4b2b2d67
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#115552
passed
10 months ago
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bluesky_blissdata/dispacher.py
+11
-4
11 additions, 4 deletions
src/bluesky_blissdata/dispacher.py
with
11 additions
and
4 deletions
src/bluesky_blissdata/dispacher.py
+
11
−
4
View file @
dc80bbcd
...
...
@@ -8,6 +8,7 @@ from blissdata.redis_engine.encoding.numeric import NumericStreamEncoder
from
blissdata.redis_engine.encoding.json
import
JsonStreamEncoder
from
blissdata.schemas.scan_info
import
ScanInfoDict
,
DeviceDict
,
ChainDict
,
ChannelDict
import
logging
import
datetime
_logger
=
logging
.
getLogger
(
__name__
)
# Configure blissdata for a Redis database
...
...
@@ -64,7 +65,8 @@ class blissdata_dispacher:
self
.
scan_id
,
info
=
{
"
name
"
:
doc
[
'
plan_name
'
],
"
uid
"
:
self
.
uid
})
self
.
dets
=
doc
.
get
(
'
detectors
'
)
self
.
motors
=
doc
.
get
(
'
motors
'
)
self
.
start_time
=
doc
[
'
time
'
]
dt
=
datetime
.
datetime
.
fromtimestamp
(
doc
[
'
time
'
])
self
.
start_time
=
dt
.
isoformat
()
self
.
npoints
=
doc
[
'
num_points
'
]
self
.
count_time
=
1
self
.
start
=
[]
...
...
@@ -141,10 +143,12 @@ class blissdata_dispacher:
self
.
acq_chain
[
"
axis
"
]
=
ChainDict
(
top_master
=
"
timer
"
,
devices
=
list
(
self
.
devices
.
keys
()),
scalars
=
[
f
"
{
device
}
:
{
channel
}
"
for
device
,
details
in
devices
.
items
()
if
device
!=
'
timer
'
for
channel
in
details
[
'
channels
'
]],
scalars
=
[
f
"
{
device
}
:
{
channel
}
"
for
device
,
details
in
self
.
devices
.
items
()
if
device
!=
'
timer
'
for
channel
in
details
[
'
channels
'
]],
spectra
=
[],
images
=
[],
master
=
{})
master
=
{
"
scalars
"
:
[
f
"
{
device
}
:
{
channel
}
"
for
device
,
details
in
self
.
devices
.
items
()
if
device
==
'
timer
'
for
channel
in
details
[
'
channels
'
]],
"
spectra
"
:
[],
"
images
"
:
[],})
# gather some metadata before running the scan
scan_info
=
self
.
scan_info
(
ddesc_dict
)
self
.
scan
.
info
.
update
(
scan_info
)
...
...
@@ -173,6 +177,7 @@ class blissdata_dispacher:
ch_stream
=
self
.
stream_list
[
'
time
'
]
except
KeyError
:
self
.
warning
(
"
Stream for {} not found
"
.
format
(
k
))
# dt = datetime.datetime.fromtimestamp(doc['time'])
ch_stream
.
send
(
doc
[
'
time
'
])
# close streams
...
...
@@ -181,6 +186,7 @@ class blissdata_dispacher:
# array_stream.seal()
# json_stream.seal()
def
stop_datastream
(
self
,
doc
):
_logger
.
debug
(
f
"
stopping doc data
{
doc
}
"
)
for
stream
in
self
.
stream_list
.
values
():
try
:
stream
.
seal
()
...
...
@@ -191,7 +197,8 @@ class blissdata_dispacher:
continue
self
.
scan
.
stop
()
self
.
scan
.
info
[
'
end_time
'
]
=
doc
[
'
time
'
]
dt
=
datetime
.
datetime
.
fromtimestamp
(
doc
[
'
time
'
])
self
.
scan
.
info
[
'
end_time
'
]
=
dt
.
isoformat
()
self
.
scan
.
info
[
'
exit_status
'
]
=
doc
[
'
exit_status
'
]
self
.
scan
.
info
[
'
reason
'
]
=
doc
[
'
reason
'
]
self
.
scan
.
info
[
'
num_events
'
]
=
doc
[
'
num_events
'
]
...
...
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