Skip to content

Commit 63cf198

Browse files
authored
allow weights to become negative (#289)
1 parent 90e42cf commit 63cf198

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pysteps/blending/steps.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,10 +1467,8 @@ def calculate_weights_spn(correlations, cov):
14671467
# Calculate the noise weight
14681468
else:
14691469
noise_weight = np.asarray(np.sqrt(1.0 - weights.dot(correlations)))[0]
1470-
# Make sure the weights are positive, otherwise weight = 0.0
1471-
weights = np.where(weights < 0.0, 0.0, weights)[0]
14721470
# Finally, add the noise_weights to the weights variable.
1473-
weights = np.concatenate((weights, noise_weight), axis=0)
1471+
weights = np.concatenate((np.array(weights)[0], noise_weight), axis=0)
14741472

14751473
# Otherwise, the weight equals the correlation on that scale level and
14761474
# the noise component weight equals 1 - this weight. This only occurs for

0 commit comments

Comments
 (0)