Commit 76a681b8 authored by Somnath, Suhas's avatar Somnath, Suhas
Browse files

Updated to MPI-ized Process class in pyUSID

parent 438bfb62
......@@ -264,7 +264,6 @@ class Cluster(Process):
h5_cluster_group = create_results_group(self.h5_main, self.process_name)
write_simple_attrs(h5_cluster_group, self.parms_dict)
h5_cluster_group.attrs['last_pixel'] = self.h5_main.shape[0]
h5_labels = write_main_dataset(h5_cluster_group, np.uint32(self.__labels.reshape([-1, 1])), 'Labels',
'Cluster ID', 'a. u.', None, Dimension('Cluster', 'ID', 1),
......@@ -305,6 +304,13 @@ class Cluster(Process):
h5_spec_inds=h5_inds, aux_pos_prefix='Mean_Resp_Pos_',
h5_spec_vals=h5_vals)
# Marking completion:
self._status_dset_name = 'completed_positions'
self._h5_status_dset = h5_cluster_group.create_dataset(self._status_dset_name,
data=np.ones(self.h5_main.shape[0], dtype=np.uint8))
# keeping legacy option:
h5_cluster_group.attrs['last_pixel'] = self.h5_main.shape[0]
return h5_cluster_group
......
......@@ -208,7 +208,7 @@ class Decomposition(Process):
h5_decomp_group = create_results_group(self.h5_main, self.process_name)
write_simple_attrs(h5_decomp_group, self.parms_dict)
write_simple_attrs(h5_decomp_group, {'n_components': self.__components.shape[0],
'n_samples': self.h5_main.shape[0], 'last_pixel': self.h5_main.shape[0]})
'n_samples': self.h5_main.shape[0]})
decomp_desc = Dimension('Endmember', 'a. u.', self.__components.shape[0])
......@@ -226,4 +226,12 @@ class Decomposition(Process):
# return the h5 group object
self.h5_results_grp = h5_decomp_group
# Marking completion:
self._status_dset_name = 'completed_positions'
self._h5_status_dset = h5_decomp_group.create_dataset(self._status_dset_name,
data=np.ones(self.h5_main.shape[0], dtype=np.uint8))
# keeping legacy option:
h5_decomp_group.attrs['last_pixel'] = self.h5_main.shape[0]
return self.h5_results_grp
......@@ -176,7 +176,7 @@ class SVD(Process):
self.h5_results_grp = h5_svd_group
write_simple_attrs(h5_svd_group, self.parms_dict)
write_simple_attrs(h5_svd_group, {'svd_method': 'sklearn-randomized', 'last_pixel': self.h5_main.shape[0]})
write_simple_attrs(h5_svd_group, {'svd_method': 'sklearn-randomized'})
h5_u = write_main_dataset(h5_svd_group, np.float32(self.__u), 'U', 'Abundance', 'a.u.', None, comp_dim,
h5_pos_inds=self.h5_main.h5_pos_inds, h5_pos_vals=self.h5_main.h5_pos_vals,
......@@ -206,6 +206,13 @@ class SVD(Process):
h5_v.attrs[key] = svd_ref
# Marking completion:
self._status_dset_name = 'completed_positions'
self._h5_status_dset = h5_svd_group.create_dataset(self._status_dset_name,
data=np.ones(self.h5_main.shape[0], dtype=np.uint8))
# keeping legacy option:
h5_svd_group.attrs['last_pixel'] = self.h5_main.shape[0]
def _check_available_mem(self):
"""
Check that there is enough memory to perform the SVD decomposition.
......
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