Skip to content

Commit

Permalink
cloud exception
Browse files Browse the repository at this point in the history
  • Loading branch information
kapoorlab committed Dec 5, 2023
1 parent 5a1d093 commit f8e98a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/napatrackmater/Trackvector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,14 +1335,15 @@ def compute_covariance_matrix(track_arrays, shape_features=5, mask_features=None

if mask_features is not None:
negative_column_indices = np.where(
(track_arrays[:, :shape_features] < 0).any(axis=0)
(track_arrays[:, :shape_features] == -1).any(axis=0)
)[0]
if len(negative_column_indices) > 0:
track_arrays[:, negative_column_indices] = np.nan

track_arrays[:, mask_features:] = np.nan

covariance_matrix = np.cov(track_arrays, rowvar=False)
covariance_matrix = np.nan_to_num(covariance_matrix, nan=0.0)
eigenvalues, eigenvectors = np.linalg.eig(covariance_matrix)
eigenvalue_order = np.argsort(eigenvalues)[::-1]
eigenvalues = eigenvalues[eigenvalue_order]
Expand Down
4 changes: 2 additions & 2 deletions src/napatrackmater/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = version = "4.5.4"
__version_tuple__ = version_tuple = (4, 5, 4)
__version__ = version = "4.5.5"
__version_tuple__ = version_tuple = (4, 5, 5)

0 comments on commit f8e98a1

Please sign in to comment.