Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 73BEA200B11 for ; Mon, 13 Jun 2016 21:10:03 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 70A3C160A3C; Mon, 13 Jun 2016 19:10:03 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BCA19160A1A for ; Mon, 13 Jun 2016 21:10:02 +0200 (CEST) Received: (qmail 31602 invoked by uid 500); 13 Jun 2016 19:10:02 -0000 Mailing-List: contact commits-help@climate.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@climate.apache.org Delivered-To: mailing list commits@climate.apache.org Received: (qmail 31592 invoked by uid 99); 13 Jun 2016 19:10:01 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jun 2016 19:10:01 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DA241DFC74; Mon, 13 Jun 2016 19:10:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jarifibrahim@apache.org To: commits@climate.apache.org Message-Id: <90b6237b0f4941478c8cc19eec6b5d98@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: climate git commit: CLIMATE-799 - TypeError in subset function Date: Mon, 13 Jun 2016 19:10:01 +0000 (UTC) archived-at: Mon, 13 Jun 2016 19:10:03 -0000 Repository: climate Updated Branches: refs/heads/master cd3eea5dc -> 89acf56a8 CLIMATE-799 - TypeError in subset function - Fix TypeError in dataset processor module Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/89acf56a Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/89acf56a Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/89acf56a Branch: refs/heads/master Commit: 89acf56a82cccb27f5fedf0527391184bcad421f Parents: cd3eea5 Author: Ibrahim Authored: Fri Jun 3 00:23:49 2016 +0530 Committer: Ibrahim Committed: Tue Jun 14 00:38:48 2016 +0530 ---------------------------------------------------------------------- ocw/dataset_processor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/89acf56a/ocw/dataset_processor.py ---------------------------------------------------------------------- diff --git a/ocw/dataset_processor.py b/ocw/dataset_processor.py index c0e384f..a455fb9 100755 --- a/ocw/dataset_processor.py +++ b/ocw/dataset_processor.py @@ -351,7 +351,9 @@ def subset(subregion, target_dataset, subregion_name=None): subregion_name = target_dataset.name if target_dataset.lats.ndim ==2 and target_dataset.lons.ndim ==2: - target_dataset = temporal_slice(subregion.start, subregion.end, target_dataset) + start_time_index = np.where(target_dataset.times == subregion.start)[0][0] + end_time_index = np.where(target_dataset.times == subregion.end)[0][0] + target_dataset = temporal_slice(start_time_index, end_time_index, target_dataset) nt, ny, nx = target_dataset.values.shape y_index, x_index = np.where((target_dataset.lats >= subregion.lat_max) | (target_dataset.lats <= subregion.lat_min) | (target_dataset.lons >= subregion.lon_max) | (target_dataset.lons <= subregion.lon_min))