Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xsocs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Edoardo Zatterin
xsocs
Commits
c31b593d
Commit
c31b593d
authored
9 months ago
by
Edoardo Zatterin
Browse files
Options
Downloads
Patches
Plain Diff
handle ROIs in qconv correctly
parent
ac640acd
No related branches found
No related tags found
No related merge requests found
Pipeline
#168438
failed
9 months ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/xsocs/process/qspace/QSpaceConverter.py
+11
-1
11 additions, 1 deletion
src/xsocs/process/qspace/QSpaceConverter.py
src/xsocs/process/qspace/__init__.py
+1
-1
1 addition, 1 deletion
src/xsocs/process/qspace/__init__.py
with
12 additions
and
2 deletions
src/xsocs/process/qspace/QSpaceConverter.py
+
11
−
1
View file @
c31b593d
...
...
@@ -47,6 +47,7 @@ def qspace_conversion(
det_ip
=
"
y+
"
,
det_oop
=
"
z-
"
,
sampleor
=
'
det
'
,
det_roi
=
None
,
):
"""
Returns array of Q vectors corresponding to each pixel
...
...
@@ -100,7 +101,8 @@ def qspace_conversion(
for
a
in
angles
:
off
=
offsets
.
get
(
a
,
0
)
angles
[
a
]
=
angles
[
a
]
-
off
print
(
f
"
Subtracting
{
off
:
<
5.3
f
}
from
{
a
}
"
)
if
off
!=
0
:
print
(
f
"
Subtracting
{
off
:
<
5.3
f
}
from
{
a
}
"
)
print
(
"
\n
"
)
eta
,
phi
,
rx
,
ry
,
nu
,
delta
=
angles
.
values
()
...
...
@@ -123,6 +125,9 @@ def qspace_conversion(
# y to the "outside"
# (righthanded)
hxrd
=
xu
.
HXRD
(
sample_ip
,
sample_oop
,
qconv
=
qconv
,
sampleor
=
sampleor
)
if
det_roi
is
None
:
# TODO
det_roi
=
[
0
,
img_size
[
0
],
0
,
img_size
[
1
]]
# Maxipix detector reference frame
hxrd
.
Ang2Q
.
init_area
(
...
...
@@ -134,6 +139,8 @@ def qspace_conversion(
Nch2
=
img_size
[
1
],
chpdeg1
=
chan_per_deg
[
0
],
chpdeg2
=
chan_per_deg
[
1
],
roi
=
det_roi
# TODO IMPLEMENT needs to cut det frames too, not just qvals
# see image_roi_offset
)
# shape of the array that will store the q vectors for all
...
...
@@ -252,6 +259,7 @@ class QSpaceConverter(object):
det_ip
=
"
y+
"
,
det_oop
=
"
z-
"
,
sampleor
=
'
det
'
,
det_roi
=
None
,
):
"""
Merger for the Kmap SPEC and EDF files.
...
...
@@ -294,6 +302,7 @@ class QSpaceConverter(object):
self
.
__det_ip
=
det_ip
self
.
__det_oop
=
det_oop
self
.
__sampleor
=
sampleor
self
.
__det_roi
=
det_roi
xsocsH5
=
XsocsH5
.
XsocsH5
(
xsocsH5_f
)
...
...
@@ -912,6 +921,7 @@ class QSpaceConverter(object):
det_ip
=
self
.
__det_ip
,
det_oop
=
self
.
__det_oop
,
sampleor
=
self
.
__sampleor
,
det_roi
=
self
.
__det_roi
,
)
# Reshape array to flatten image
...
...
This diff is collapsed.
Click to expand it.
src/xsocs/process/qspace/__init__.py
+
1
−
1
View file @
c31b593d
...
...
@@ -5,4 +5,4 @@ It provides a helper function :func:`kmap_2_qspace` to run the conversion
from
.QSpaceConverter
import
QSpaceConverter
,
qspace_conversion
# noqa
from
.QSpaceConverter
import
QSpaceCoordinates
# noqa
from
.helpers
import
kmap_2_qspace
# noqa
#
from .helpers import kmap_2_qspace # noqa
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