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
SCS
ToolBox
Commits
c386fc88
Commit
c386fc88
authored
4 years ago
by
rafael-desktop
Browse files
Options
Downloads
Patches
Plain Diff
Added wrappers for external bunch pattern decoding
parent
1e1aec1d
No related branches found
No related tags found
1 merge request
!83
Added wrappers for external bunch pattern decoding
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bunch_pattern_external.py
+115
-0
115 additions, 0 deletions
bunch_pattern_external.py
with
115 additions
and
0 deletions
bunch_pattern_external.py
0 → 100644
+
115
−
0
View file @
c386fc88
"""
A collection of wrappers around the the euxfel_bunch_pattern pkg
----------------------------------------------------------------
The euxfel_bunch_pattern package provides generic methods to extract
information from the bunch pattern tables. To ease its use from within
the toolbox some of its methods are wrapped. Like this they show up in
the users namespace in a self-explanatory way.
"""
import
euxfel_bunch_pattern
as
ebp
PPL_SCS
=
ebp
.
LASER_SEED6
def
is_sase_3
(
data
):
"""
Check for prescence of a SASE3 pulse.
Parameters
----------
data : numpy array, xarray DataArray
The bunch pattern data.
Returns
-------
boolean : numpy array, xarray DataArray
true if SASE3 pulse is present.
"""
return
ebp
.
is_sase
(
data
,
3
)
def
is_sase_1
(
data
):
"""
Check for prescence of a SASE1 pulse.
Parameters
----------
data : numpy array, xarray DataArray
The bunch pattern data.
Returns
-------
boolean : numpy array, xarray DataArray
true if SASE1 pulse is present.
"""
return
ebp
.
is_sase
(
data
,
1
)
def
is_ppl
(
data
):
"""
Check for prescence of pp-laser pulse.
Parameters
----------
data : numpy array, xarray DataArray
The bunch pattern data.
Returns
-------
boolean : numpy array, xarray DataArray
true if pp-laser pulse is present.
"""
return
ebp
.
is_laser
(
data
,
laser
=
PPL_SCS
)
def
get_index_ppl
(
data
):
"""
Check array index where pp-laser pulse is present.
Parameters
----------
data : numpy array
The bunch pattern data.
Returns
-------
boolean : numpy array
The indices of the pp-laser pulses in the given array.
"""
return
ebp
.
indices_at_laser
(
data
,
laser
=
PPL_SCS
)
def
get_index_sase1
(
data
):
"""
Search for array index where SASE1 pulse is present.
Parameters
----------
data : numpy array
The bunch pattern data.
Returns
-------
boolean : numpy array
The indices of the SASE1 pulses in the given array.
"""
return
ebp
.
indices_at_sase
(
data
,
1
)
def
get_index_sase3
(
data
):
"""
Search for array index where SASE3 pulse is present.
Parameters
----------
data : numpy array
The bunch pattern data.
Returns
-------
boolean : numpy array
The indices of the SASE3 pulses in the given array.
"""
return
ebp
.
indices_at_sase
(
data
,
3
)
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