Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xsocs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
22
Issues
22
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kmap
xsocs
Commits
c1f85119
Commit
c1f85119
authored
Apr 04, 2018
by
Thomas Vincent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add read/write normalization to qspace hdf5 file
parent
fdac2eaf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
xsocs/io/QSpaceH5.py
xsocs/io/QSpaceH5.py
+25
-0
No files found.
xsocs/io/QSpaceH5.py
View file @
c1f85119
...
...
@@ -29,6 +29,8 @@ __authors__ = ["D. Naudet"]
__license__
=
"MIT"
__date__
=
"15/09/2016"
import
sys
import
weakref
from
collections
import
OrderedDict
from
contextlib
import
contextmanager
...
...
@@ -37,6 +39,12 @@ import numpy as _np
from
.XsocsH5Base
import
XsocsH5Base
# Python 2/3 compatibility
if
sys
.
version_info
[
0
]
>=
3
:
text_type
=
str
else
:
text_type
=
unicode
class
QSpaceH5
(
XsocsH5Base
):
qspace_path
=
'Data/qspace'
...
...
@@ -167,6 +175,14 @@ class QSpaceH5(XsocsH5Base):
return
[
entry
.
decode
()
for
entry
in
entries
]
return
[]
@
property
def
image_normalizer
(
self
):
"""Returns the image normalizer used when converting to q space.
:rtype: Union[str, None]
"""
return
self
.
_get_array_data
(
self
.
params_path
+
'/image_normalizer'
)
@
property
def
image_binning
(
self
):
"""
...
...
@@ -385,6 +401,15 @@ class QSpaceH5Writer(QSpaceH5):
path
=
self
.
entries_path
+
'/has_shift'
self
.
_set_scalar_data
(
path
,
has_shift
)
def
set_image_normalizer
(
self
,
normalizer
):
"""Stores the image normalizer used when converting to q space
:param str normalizer:
Name of measurement group dataset to use
"""
path
=
self
.
params_path
+
'/image_normalizer'
self
.
_create_dataset
(
path
,
data
=
text_type
(
normalizer
))
def
set_image_binning
(
self
,
image_binning
):
"""
Stores the image binning used when converting to q space
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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