Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Vasudevan, Rama K
pycroscopy
Commits
5be080eb
Commit
5be080eb
authored
Dec 12, 2017
by
Unknown
Browse files
PycroData slicing bugfix
parent
9c449383
Changes
1
Hide whitespace changes
Inline
Side-by-side
pycroscopy/io/pycro_data.py
View file @
5be080eb
...
...
@@ -280,15 +280,17 @@ class PycroDataset(h5py.Dataset):
# Now that the slices are built, we just need to apply them to the data
# This method is slow and memory intensive but shouldn't fail if multiple lists are given.
if
len
(
np
.
argwhere
(
pos_slice
)
)
<=
len
(
np
.
argwhere
(
spec_slice
)
)
:
if
len
(
pos_slice
)
<=
len
(
spec_slice
):
# Fewer final positions that spectra (Most common case)
data_slice
=
np
.
atleast_2d
(
self
[
pos_slice
,
:])[:,
spec_slice
]
else
:
data_slice
=
np
.
atleast_2d
(
self
[:,
spec_slice
])[
pos_slice
,
:]
pos_inds
=
self
.
h5_pos_inds
[
pos_slice
,
:]
spec_inds
=
self
.
h5_spec_inds
[:,
spec_slice
].
reshape
([
self
.
h5_spec_inds
.
shape
[
0
],
-
1
])
data_slice
,
success
=
reshape_to_Ndims
(
data_slice
,
h5_pos
=
self
.
h5_pos_inds
[
pos_slice
,
:]
,
h5_spec
=
s
elf
.
h5_spec_inds
[:,
spec_slice
]
)
h5_pos
=
pos_inds
,
h5_spec
=
s
pec_inds
)
if
as_scalar
:
return
transformToReal
(
data_slice
),
success
...
...
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