Skip to content

Commit

Permalink
Enhance regression() to exclude infinite values too
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyPechnikov committed Jan 31, 2024
1 parent 4dafc67 commit 09a619c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pygmtsar/pygmtsar/Stack_detrend.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ def regression_block(data, weight, *args, **kwargs):
del variables_stack
#assert 0, f'TEST: {data_values.shape}, {variables_values.shape}'

nanmask_data = np.isnan(data_values)
nanmask_values = np.any(np.isnan(variables_values), axis=0)
nanmask_data = ~np.isfinite(data_values)
nanmask_values = np.any(~np.isfinite(variables_values), axis=0)
if weight.size > 1:
weight_values = weight.ravel().astype(np.float64)
nanmask_weight = np.isnan(weight_values)
nanmask_weight = ~np.isfinite(weight_values)
nanmask = nanmask_data | nanmask_values | nanmask_weight
#assert 0, f'TEST weight: {data_values.shape}, {variables_values.shape}, {weight_values.shape}'
else:
Expand Down

0 comments on commit 09a619c

Please sign in to comment.