Commit 1a964f71 authored by sloosvel's avatar sloosvel
Browse files

Do not save basin if all values are 0

parent 564d660d
......@@ -210,7 +210,8 @@ class Siasiesiv(Diagnostic):
else:
var_res.units = 'm^2'
for i, basin in enumerate(self.masks):
var_region[i, ...] = netCDF4.stringtoarr(str(basin), 50)
var_res[..., i] = res[i, ...]
if not np.all(res[i, ...]==0):
var_region[i, ...] = netCDF4.stringtoarr(str(basin), 50)
var_res[..., i] = res[i, ...]
handler_temp.close()
self.generated[var].set_local_file(temp, diagnostic=self)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment