Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
alibylite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Swain Lab
aliby
alibylite
Commits
c79c476d
Commit
c79c476d
authored
2 years ago
by
Alán Muñoz
Browse files
Options
Downloads
Patches
Plain Diff
post(multisignal): optimise align using bottleneck
parent
496c2d40
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/postprocessor/core/multisignal/align.py
+4
-3
4 additions, 3 deletions
src/postprocessor/core/multisignal/align.py
with
4 additions
and
3 deletions
src/postprocessor/core/multisignal/align.py
+
4
−
3
View file @
c79c476d
#!/usr/bin/env python3
import
bottleneck
as
bn
import
numpy
as
np
import
pandas
as
pd
from
agora.abc
import
ParametersABC
from
agora.abc
import
ParametersABC
from
postprocessor.core.abc
import
PostProcessABC
...
...
@@ -97,7 +98,7 @@ class align(PostProcessABC):
# i.e. if events_at_least = 1, then cells that have no birth events are
# deleted.
event_mask
=
mask_df
.
apply
(
lambda
x
:
np
.
sum
(
x
)
>=
self
.
events_at_least
,
axis
=
1
lambda
x
:
bn
.
nan
sum
(
x
)
>=
self
.
events_at_least
,
axis
=
1
)
mask_df
=
mask_df
.
iloc
[
event_mask
.
to_list
()]
...
...
@@ -132,7 +133,7 @@ class align(PostProcessABC):
# Do not remove bits of traces before first event
else
:
# Add columns to left, filled with NaNs
max_shift
=
np
.
max
(
shift_list
)
max_shift
=
bn
.
nan
max
(
shift_list
)
mask_aligned
=
df_extend_nan
(
mask_aligned
,
max_shift
)
trace_aligned
=
df_extend_nan
(
trace_aligned
,
max_shift
)
# shift each
...
...
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