Unverified Commit c5e8fae4 authored by Suhas Somnath's avatar Suhas Somnath Committed by GitHub

Merge pull request #241 from pycroscopy/svd_fix

Added fix for singular spec dim
parents 02743372 129f6aea
......@@ -139,6 +139,12 @@ class SVD(Process):
if not success:
raise ValueError('Could not reshape U to N-Dimensional dataset! Error:' + success)
# When the source dataset has a singular valued spectroscopic dimension
# stack_real_to_target causes V to lose all its dimensions
if self.__v.ndim == 0:
# However, we want V to be 2D:
self.__v = np.atleast_2d(self.__v)
v_mat, success = reshape_to_n_dims(self.__v, h5_pos=np.expand_dims(np.arange(self.__u.shape[1]), axis=1),
h5_spec=self.h5_main.h5_spec_inds)
if not success:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment