Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
XRD
darfix
Commits
6332a4d8
Commit
6332a4d8
authored
Aug 16, 2021
by
Julia Garriga Ferrer
Committed by
Julia Garriga Ferrer
Aug 17, 2021
Browse files
[core][dataset]apply_shift_along_dimension] Consecutively apply shift on all values of given dim
parent
c3752212
Changes
1
Hide whitespace changes
Inline
Side-by-side
darfix/core/dataset.py
View file @
6332a4d8
...
...
@@ -758,18 +758,19 @@ class Dataset():
shift
=
[]
for
value
in
range
(
self
.
dims
.
get
(
dimension
[
0
]).
size
):
s
=
self
.
find_shift
([
dimension
[
0
],
value
],
steps
,
indices
)
print
(
s
)
shift
.
append
(
s
)
return
numpy
.
array
(
shift
)
def
apply_shift_along_dimension
(
self
,
dimension
,
shift_approach
=
"fft"
,
indices
=
None
,
callback
=
None
,
_dir
=
None
):
def
apply_shift_along_dimension
(
self
,
shift
,
dimension
,
shift_approach
=
"fft"
,
indices
=
None
,
callback
=
None
,
_dir
=
None
):
dataset
=
self
for
value
in
range
(
self
.
dims
.
get
(
dimension
[
0
]).
size
):
dataset
=
dataset
.
apply_shift
([
dimension
[
0
],
value
],
shift_approach
,
indices
,
callback
,
_dir
)
frames
=
numpy
.
arange
(
self
.
get_data
(
indices
=
indices
,
dimension
=
[
dimension
[
0
],
value
]).
shape
[
0
])
dataset
=
dataset
.
apply_shift
(
numpy
.
outer
(
shift
[
value
],
frames
),
[
dimension
[
0
],
value
],
shift_approach
,
indices
,
callback
,
_dir
)
return
dataset
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment