Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
ToolBox
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
Model registry
Operate
Environments
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
Thomas Kluyver
ToolBox
Commits
692fb9cd
Commit
692fb9cd
authored
5 years ago
by
Laurent Mercadier
Browse files
Options
Downloads
Patches
Plain Diff
Adds runFolder as attribute
parent
57925d4a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Load.py
+5
-2
5 additions, 2 deletions
Load.py
xgm.py
+4
-2
4 additions, 2 deletions
xgm.py
with
9 additions
and
4 deletions
Load.py
+
5
−
2
View file @
692fb9cd
...
...
@@ -328,8 +328,8 @@ def load(fields, runNB, proposalNB, semesterNB, topic='SCS', display=False,
or dictionnaries defining a custom mnemonic such as
{
"
extra
"
: {
'
SCS_CDIFFT_MAG/SUPPLY/CURRENT
'
,
'
actual_current.value
'
, None}}
runNB: run number as integer
proposalNB: string of the proposal number
semesterNB: string of the semester number where the proposal data are saved
proposalNB: string
or int
of the proposal number
e.g.
'
p002252
'
or 2252
semesterNB: string
or int
of the semester number where the proposal data are saved
topic: string of the topic
display: boolean, whether to show the run.info or not
validate: boolean, whether to run karabo-data-validate or not
...
...
@@ -346,6 +346,8 @@ def load(fields, runNB, proposalNB, semesterNB, topic='SCS', display=False,
res: an xarray DataSet with aligned trainIds
"""
if
type
(
proposalNB
)
==
int
:
proposalNB
=
'
p{:06d}
'
.
format
(
proposalNB
)
runFolder
=
runpath
.
format
(
topic
,
semesterNB
,
proposalNB
,
runNB
)
run
=
RunDirectory
(
runFolder
).
select_trains
(
subset
)
...
...
@@ -401,4 +403,5 @@ def load(fields, runNB, proposalNB, semesterNB, topic='SCS', display=False,
result
=
dict
(
zip
(
keys
,
aligned_vals
))
result
=
xr
.
Dataset
(
result
)
result
.
attrs
[
'
run
'
]
=
run
result
.
attrs
[
'
runFolder
'
]
=
runFolder
return
result
This diff is collapsed.
Click to expand it.
xgm.py
+
4
−
2
View file @
692fb9cd
...
...
@@ -177,7 +177,8 @@ def cleanXGMdata(data, npulses=None, sase3First=True):
mergeList
.
append
(
res
)
mergeList
.
append
(
data
.
drop
(
dropList
))
subset
=
xr
.
merge
(
mergeList
,
join
=
'
inner
'
)
subset
.
attrs
[
'
run
'
]
=
data
.
attrs
[
'
run
'
]
for
k
in
data
.
attrs
.
keys
():
subset
.
attrs
[
k
]
=
data
.
attrs
[
k
]
return
subset
...
...
@@ -937,7 +938,8 @@ def matchXgmTimPulseId(data, use_apd=True, intstart=None, intstop=None,
dropList
.
append
(
'
MCP{}apd
'
.
format
(
mcp
))
mergeList
.
append
(
ndata
.
drop
(
dropList
))
subset
=
xr
.
merge
(
mergeList
,
join
=
'
inner
'
)
subset
.
attrs
[
'
run
'
]
=
ndata
.
attrs
[
'
run
'
]
for
k
in
ndata
.
attrs
.
keys
():
subset
.
attrs
[
k
]
=
ndata
.
attrs
[
k
]
return
subset
...
...
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