From 2a2fa5bb822961e7be25c78568a5b0eecdf0f6c0 Mon Sep 17 00:00:00 2001 From: "Scott Havens (ubuntu)" Date: Tue, 28 Mar 2017 11:22:19 -0600 Subject: [PATCH] vic2netcdf.py in standard mode not assigning to array with chunking. fixes issue #62 --- .gitignore | 3 +++ tonic/models/vic/vic2netcdf.py | 9 ++++++--- tonic/version.py | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c1a94b9..2f0f8ff 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,6 @@ Thumbs.db *.sublime-* tonic.egg-info + +.pydevproject +.project diff --git a/tonic/models/vic/vic2netcdf.py b/tonic/models/vic/vic2netcdf.py index c6b218e..ca888f3 100644 --- a/tonic/models/vic/vic2netcdf.py +++ b/tonic/models/vic/vic2netcdf.py @@ -456,10 +456,13 @@ def nc_add_data_to_array(self, point): def nc_add_data_standard(self, points): ys = points.get_ys() xs = points.get_xs() + + for name in self.three_dim_vars: + data = points.get_data(name, self.slice) + for i in range(len(ys)): + self.f.variables[name][:, ys[i], xs[i]] = data[i,:] + for p in points: - for name in self.three_dim_vars: - data = points.get_data(name, self.slice) - self.f.variables[name][:, ys, xs] = data for name in self.four_dim_vars: varshape = self.f.variables[name].shape[1] for i in pyrange(varshape): diff --git a/tonic/version.py b/tonic/version.py index a68e94b..012f2a3 100644 --- a/tonic/version.py +++ b/tonic/version.py @@ -1,2 +1,2 @@ -version = '0.0.0.dev-7b09158' +version = '0.0.0.dev-190aca2' short_version = '0.0.0'