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
23e8332f
Commit
23e8332f
authored
Aug 16, 2021
by
Julia Garriga Ferrer
Committed by
Julia Garriga Ferrer
Aug 17, 2021
Browse files
[core][dataset] Add find and correct along dimension methods
parent
d5dd3a11
Changes
1
Hide whitespace changes
Inline
Side-by-side
darfix/core/dataset.py
View file @
23e8332f
...
...
@@ -754,6 +754,25 @@ class Dataset():
"""
return
shift_detection
(
self
.
get_data
(
indices
,
dimension
),
steps
)
def
find_shift_along_dimension
(
self
,
dimension
,
steps
=
50
,
indices
=
None
):
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
):
dataset
=
self
for
value
in
range
(
self
.
dims
.
get
(
dimension
[
0
]).
size
):
dataset
=
dataset
.
apply_shift
([
dimension
[
0
],
value
],
shift_approach
,
indices
,
callback
,
_dir
)
return
dataset
def
apply_shift
(
self
,
shift
,
dimension
=
None
,
shift_approach
=
"fft"
,
indices
=
None
,
callback
=
None
,
_dir
=
None
):
"""
...
...
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