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
253d56d8
Commit
253d56d8
authored
5 years ago
by
Laurent Mercadier
Browse files
Options
Downloads
Patches
Plain Diff
Rename BAM array dimnension to match XGM, TIM...
parent
91499d8d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bunch_pattern.py
+9
-5
9 additions, 5 deletions
bunch_pattern.py
with
9 additions
and
5 deletions
bunch_pattern.py
+
9
−
5
View file @
253d56d8
...
...
@@ -187,7 +187,8 @@ def sortBAMdata(data, key='sase3'):
corresponds to FLASH busrt length of 800 us @ 9 MHz. The bunchPatternTable
only has 2700 values, corresponding to XFEL 600 us burst length @ 4.5 MHz.
Hence, we truncate the BAM arrays to 5400 with a stride of 2 and match them
to the bunchPatternTable.
to the bunchPatternTable. If key is one of the sase, the given dimension name
of the bam arrays is
'
sa[sase number]_pId
'
, to match other data (XGM, TIM...).
Inputs:
data: xarray Dataset containing BAM arrays
key: str, [
'
sase1
'
,
'
sase2
'
,
'
sase3
'
,
'
scs_ppl
'
]
...
...
@@ -200,11 +201,14 @@ def sortBAMdata(data, key='sase3'):
ndata
=
data
dropList
=
[]
mergeList
=
[]
for
k
ey
in
data
:
if
'
BAM
'
in
k
ey
:
dropList
.
append
(
k
ey
)
bam
=
data
[
k
ey
].
isel
(
BAMbunchId
=
slice
(
0
,
5400
,
2
))
for
k
in
data
:
if
'
BAM
'
in
k
:
dropList
.
append
(
k
)
bam
=
data
[
k
].
isel
(
BAMbunchId
=
slice
(
0
,
5400
,
2
))
bam
=
bam
.
where
(
mask
,
drop
=
True
)
if
'
sase
'
in
key
:
name
=
f
'
sa
{
key
[
4
]
}
_pId
'
bam
=
bam
.
rename
({
'
BAMbunchId
'
:
name
})
mergeList
.
append
(
bam
)
mergeList
.
append
(
data
.
drop
(
dropList
))
ndata
=
xr
.
merge
(
mergeList
,
join
=
'
inner
'
)
...
...
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