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
Merge requests
!170
hRIXS functions
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
hRIXS functions
hrixs
into
master
Overview
14
Commits
7
Pipelines
0
Changes
1
4 unresolved threads
Hide all comments
Merged
Cammille Carinan
requested to merge
hrixs
into
master
3 years ago
Overview
14
Commits
7
Pipelines
0
Changes
1
4 unresolved threads
Hide all comments
Expand
0
0
Merge request reports
Viewing commit
e9b7b74b
Prev
Next
Show latest version
1 file
+
1
−
17
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
e9b7b74b
TIL casting list to numpy array returns the sliced view
· e9b7b74b
Cammille Carinan
authored
3 years ago
src/toolbox_scs/detectors/hrixs.py
+
1
−
17
Options
@@ -367,21 +367,5 @@ class hRIXS:
@@ -367,21 +367,5 @@ class hRIXS:
return
(
px
+
mx
)
/
2
,
py
-
my
return
(
px
+
mx
)
/
2
,
py
-
my
def
__add__
(
self
,
other
):
def
__add__
(
self
,
other
):
images
=
split_images
(
self
.
images
)
+
split_images
(
other
.
images
)
return
self
.
__class__
(
images
=
list
(
self
.
images
)
+
list
(
other
.
images
),
return
self
.
__class__
(
images
=
images
,
norm
=
self
.
norm
+
other
.
norm
)
norm
=
self
.
norm
+
other
.
norm
)
def
split_images
(
images
):
"""
Split the images by the number of trains
and return the list of their views.
"""
# Check if the images has already been splitted
if
isinstance
(
images
,
list
):
return
images
# Check if the images is a numpy of of 2d image that follows
# the shape (num, y_dim, x_dim)
assert
len
(
images
.
shape
)
==
3
return
[
np
.
squeeze
(
image
)
for
image
in
np
.
vsplit
(
images
,
images
.
shape
[
0
])]
Loading