Skip to content

Commit

Permalink
Disable seasonable variance normalization when variance is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
tnipen committed Apr 25, 2017
1 parent 28caa1d commit bfde0da
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions wxgen/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,12 @@ def compute_sim_variance(self, array, scales):
The timeseries is scaled up again to match the average anomaly variance in the timeseries.
"""
std = np.nanstd(array, axis=1)
meanstd = np.nanmean(std)
for i in range(0, N):
values[:, i] = values[:, i] / std * meanstd
if np.min(std) == 0:
wxgen.util.warning("Standard deviation of 0 at one or more days. Not normalizing variance")
else:
meanstd = np.nanmean(std)
for i in range(0, N):
values[:, i] = values[:, i] / std * meanstd

"""
Compute the variance at different time scales. This is done using a convolution with
Expand Down

0 comments on commit bfde0da

Please sign in to comment.