Skip to content
Snippets Groups Projects
Commit 55df2201 authored by Peters, Wouter's avatar Peters, Wouter
Browse files

now also works when not-masked ts are read

parent c750890e
Branches
No related tags found
No related merge requests found
......@@ -164,9 +164,11 @@ def timehistograms_new(fig,infile):
f.close()
pydates = np.array([dt.datetime(1970,1,1)+dt.timedelta(seconds=int(d)) for d in date])
sampled = (simulated.mask == False)
if len(sampled.nonzero()[0]) < 2:
sampled = (np.ma.getmask(simulated) == False)
if len(sampled.nonzero()[0]) < 2:
logging.warning("Too few simulated values found, continuing...")
return fig
simulated = simulated.compress(sampled)
......@@ -349,7 +351,11 @@ def timevssite_new(fig,infile):
f.close()
pydates = np.array([dt.datetime(1970,1,1)+dt.timedelta(seconds=int(d)) for d in date])
sampled = (simulated.mask == False)
sampled = (np.ma.getmask(simulated) == False)
if len(sampled.nonzero()[0]) < 2:
logging.warning("Too few simulated values found, continuing...")
return fig
simulated = simulated.compress(sampled)
obs = obs.compress(sampled)
......@@ -549,9 +555,10 @@ def residuals_new(fig,infile):
f.close()
pydates = np.array([dt.datetime(1970,1,1)+dt.timedelta(seconds=int(d)) for d in date])
sampled = (simulated.mask == False)
sampled = (np.ma.getmask(simulated) == False)
if len(sampled.nonzero()[0]) < 2:
if len(sampled.nonzero()[0]) < 2:
logging.warning("Too few simulated values found, continuing...")
return fig
simulated = simulated.compress(sampled)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment