[2/2] climate git commit: Implementing a multilingual map in ocw UI this closes #356

2016-06-16 Thread omkarr
Implementing a multilingual map in ocw UI this closes #356


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/de573a5c
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/de573a5c
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/de573a5c

Branch: refs/heads/master
Commit: de573a5ca140cfe279a55c8ce7082b0245de4915
Parents: 6b9fae9 dd2985d
Author: Omkar20895 
Authored: Thu Jun 16 15:39:29 2016 +0530
Committer: Omkar20895 
Committed: Thu Jun 16 15:39:29 2016 +0530

--
 ocw-ui/frontend/app/scripts/directives/leafletmap.js | 5 -
 ocw-ui/frontend/app/scripts/directives/previewmap.js | 5 -
 2 files changed, 8 insertions(+), 2 deletions(-)
--




[1/2] climate git commit: Implementing a multilingual map in ocw UI

2016-06-16 Thread omkarr
Repository: climate
Updated Branches:
  refs/heads/master 6b9fae9d5 -> de573a5ca


Implementing a multilingual map in ocw UI


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/dd2985d2
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/dd2985d2
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/dd2985d2

Branch: refs/heads/master
Commit: dd2985d24e4f518ae09740afb03d9f6865318ade
Parents: 6b9fae9
Author: Omkar20895 
Authored: Wed Jun 15 18:03:51 2016 +0530
Committer: Omkar20895 
Committed: Wed Jun 15 18:03:51 2016 +0530

--
 ocw-ui/frontend/app/scripts/directives/leafletmap.js | 5 -
 ocw-ui/frontend/app/scripts/directives/previewmap.js | 5 -
 2 files changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/dd2985d2/ocw-ui/frontend/app/scripts/directives/leafletmap.js
--
diff --git a/ocw-ui/frontend/app/scripts/directives/leafletmap.js 
b/ocw-ui/frontend/app/scripts/directives/leafletmap.js
index 9b0a6eb..859a93e 100644
--- a/ocw-ui/frontend/app/scripts/directives/leafletmap.js
+++ b/ocw-ui/frontend/app/scripts/directives/leafletmap.js
@@ -40,7 +40,10 @@ angular.module('ocwUiApp')
worldCopyJump: true,
});
 
-   L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', 
{}).addTo($rootScope.map);
+   
L.tileLayer('http://{s}.tile.thunderforest.com/transport/{z}/{x}/{y}.png', {
+   attribution: ' http://www.thunderforest.com/;>Thunderforest,  http://www.openstreetmap.org/copyright;>OpenStreetMap',
+   maxZoom: 19
+   }).addTo($rootScope.map);
}
};
 });

http://git-wip-us.apache.org/repos/asf/climate/blob/dd2985d2/ocw-ui/frontend/app/scripts/directives/previewmap.js
--
diff --git a/ocw-ui/frontend/app/scripts/directives/previewmap.js 
b/ocw-ui/frontend/app/scripts/directives/previewmap.js
index 78aae8c..600d2f2 100644
--- a/ocw-ui/frontend/app/scripts/directives/previewmap.js
+++ b/ocw-ui/frontend/app/scripts/directives/previewmap.js
@@ -47,7 +47,10 @@ angular.module('ocwUiApp')
worldCopyJump: true,
});
 
-   
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {}).addTo(map);
+   
L.tileLayer('http://{s}.tile.thunderforest.com/transport/{z}/{x}/{y}.png', {
+   attribution: ' http://www.thunderforest.com/;>Thunderforest,  http://www.openstreetmap.org/copyright;>OpenStreetMap',
+   maxZoom: 19
+   }).addTo(map);
 
// Zoom the map to the dataset bound regions 
(or at least try our best to do so)
var datasetBounds = 
[[scope.dataset.latlonVals.latMax, scope.dataset.latlonVals.lonMin], 



[1/2] climate git commit: Addressing CLIMATE-810 Demo tab doesn't appear in ocw ui

2016-06-16 Thread omkarr
Repository: climate
Updated Branches:
  refs/heads/master de573a5ca -> 705403a03


Addressing CLIMATE-810 Demo tab doesn't appear in ocw ui


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/16f03a51
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/16f03a51
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/16f03a51

Branch: refs/heads/master
Commit: 16f03a513afe4eefbc66f62bd8bf444bb96dd9a7
Parents: de573a5
Author: Omkar20895 
Authored: Fri Jun 17 00:45:31 2016 +0530
Committer: Omkar20895 
Committed: Fri Jun 17 00:45:31 2016 +0530

--
 ocw-ui/frontend/app/index.html | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/16f03a51/ocw-ui/frontend/app/index.html
--
diff --git a/ocw-ui/frontend/app/index.html b/ocw-ui/frontend/app/index.html
index 2da8183..fe3a4a4 100644
--- a/ocw-ui/frontend/app/index.html
+++ b/ocw-ui/frontend/app/index.html
@@ -56,6 +56,7 @@ under the License.
   
 Evaluate
 Results
+Demo
   
 
   



[2/2] climate git commit: close #276

2016-01-28 Thread omkarr
close #276


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/47430210
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/47430210
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/47430210

Branch: refs/heads/master
Commit: 474302106e6788eba4e00d9c6bd09b7ec5cc4017
Parents: a9dab5b aa9f832
Author: Omkar20895 
Authored: Thu Jan 28 23:34:30 2016 +0530
Committer: Omkar20895 
Committed: Thu Jan 28 23:34:30 2016 +0530

--
 .../frontend/app/scripts/controllers/observationselect.js | 10 --
 ocw-ui/frontend/app/views/selectobservation.html  |  8 
 2 files changed, 16 insertions(+), 2 deletions(-)
--




[1/2] climate git commit: CLIMATE-379 - Allows dataset customisation

2016-01-28 Thread omkarr
Repository: climate
Updated Branches:
  refs/heads/master a9dab5b49 -> 474302106


CLIMATE-379 - Allows dataset customisation


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/aa9f832f
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/aa9f832f
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/aa9f832f

Branch: refs/heads/master
Commit: aa9f832f8828ee6addb2b14e3bec20a86911344f
Parents: 67189a7
Author: Omkar20895 
Authored: Wed Jan 20 19:26:59 2016 +0530
Committer: Omkar20895 
Committed: Wed Jan 20 19:26:59 2016 +0530

--
 .../frontend/app/scripts/controllers/observationselect.js | 10 --
 ocw-ui/frontend/app/views/selectobservation.html  |  8 
 2 files changed, 16 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/aa9f832f/ocw-ui/frontend/app/scripts/controllers/observationselect.js
--
diff --git a/ocw-ui/frontend/app/scripts/controllers/observationselect.js 
b/ocw-ui/frontend/app/scripts/controllers/observationselect.js
index 024b567..39d66b4 100644
--- a/ocw-ui/frontend/app/scripts/controllers/observationselect.js
+++ b/ocw-ui/frontend/app/scripts/controllers/observationselect.js
@@ -152,6 +152,7 @@ angular.module('ocwUiApp')
 
   var newDataset = {};
   var input = $('#observationFileInput').val();
+  var name = $('#customDatasetName').val();
 
   // If the backend is limiting directory access we need to add that 
leader to our path
   // so it remains valid!
@@ -163,8 +164,13 @@ angular.module('ocwUiApp')
   // Save the model path. Note that the path is effectively the "id" for 
the model.
   newDataset['id'] = input;
   // Grab the file name later for display purposes.
-  var splitFilePath = input.split('/');
-  newDataset['name'] = splitFilePath[splitFilePath.length - 1];
+  if(name == ""){
+var splitFilePath = input.split('/');
+newDataset['name'] = splitFilePath[splitFilePath.length - 1];  
+  }
+  else{
+newDataset['name'] = name;
+  }
   // Save the model parameter variable. We save it twice for consistency 
and display convenience.
   newDataset['param'] = $scope.paramSelect;
   newDataset['paramName'] = newDataset['param'];

http://git-wip-us.apache.org/repos/asf/climate/blob/aa9f832f/ocw-ui/frontend/app/views/selectobservation.html
--
diff --git a/ocw-ui/frontend/app/views/selectobservation.html 
b/ocw-ui/frontend/app/views/selectobservation.html
index 96a8054..3a93ab3 100644
--- a/ocw-ui/frontend/app/views/selectobservation.html
+++ b/ocw-ui/frontend/app/views/selectobservation.html
@@ -69,6 +69,14 @@ under the License.
   
 
   
+  
+
+  Custom Dataset Name
+
+
+  
+
+  
 
   
   



[1/3] climate git commit: CLIMATE-715 Adding a new demo tab along with the evaluate and result so that user can see the demo of the ocw in this tab

2016-01-30 Thread omkarr
Repository: climate
Updated Branches:
  refs/heads/master 947478539 -> c706df1c6


CLIMATE-715 Adding a new demo tab along with the evaluate and result so that 
user can see the demo of the ocw in this tab


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/8e150de8
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/8e150de8
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/8e150de8

Branch: refs/heads/master
Commit: 8e150de857fb9c4ecb18ad569497a4f48643fd63
Parents: 4743021
Author: Omkar20895 
Authored: Thu Jan 28 23:51:24 2016 +0530
Committer: Omkar20895 
Committed: Thu Jan 28 23:51:24 2016 +0530

--
 ocw-ui/frontend/app/index.html  | 16 
 ocw-ui/frontend/app/scripts/app.js  |  4 
 ocw-ui/frontend/app/views/demo.html | 22 ++
 3 files changed, 42 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/8e150de8/ocw-ui/frontend/app/index.html
--
diff --git a/ocw-ui/frontend/app/index.html b/ocw-ui/frontend/app/index.html
index 4d5996a..421c52d 100644
--- a/ocw-ui/frontend/app/index.html
+++ b/ocw-ui/frontend/app/index.html
@@ -143,5 +143,21 @@ under the License.
 
 
 
+
+
+
+  
+
+
+  Apache Open Climate Workbench Software . 
+  https://climate.apache.org/; target="_blank">About Us . 
https://issues.apache.org/jira/browse/CLIMATE/?selectedTab=com.atlassian.jira.jira-projects-plugin:issues-panel;
 target="_blank">Report an issue .
+  
+  Copyright © 2013 The Apache Software Foundation, Licensed under the 
+  
+  http://www.apache.org/licenses/LICENSE-2.0;>Apache License, 
Version 2.0.
+
+  
+
+  
   
 

http://git-wip-us.apache.org/repos/asf/climate/blob/8e150de8/ocw-ui/frontend/app/scripts/app.js
--
diff --git a/ocw-ui/frontend/app/scripts/app.js 
b/ocw-ui/frontend/app/scripts/app.js
index 8dca2dc..606d2cb 100644
--- a/ocw-ui/frontend/app/scripts/app.js
+++ b/ocw-ui/frontend/app/scripts/app.js
@@ -62,6 +62,10 @@ angular
   templateUrl: 'views/results.html',
   controller: 'ResultCtrl'
 })
+.state('demo', {
+  url: '/demo',
+  templateUrl: 'views/demo.html'
+})
 .state('results.list', {
   // parent: 'results',
   url: '',

http://git-wip-us.apache.org/repos/asf/climate/blob/8e150de8/ocw-ui/frontend/app/views/demo.html
--
diff --git a/ocw-ui/frontend/app/views/demo.html 
b/ocw-ui/frontend/app/views/demo.html
new file mode 100644
index 000..412a18c
--- /dev/null
+++ b/ocw-ui/frontend/app/views/demo.html
@@ -0,0 +1,22 @@
+
+
+  https://www.youtube.com/embed/wjUbifVeqa8?autoplay=0;>
+  
+



[2/2] climate git commit: Merge branch 'CLIMATE-776' Updating conda dependencies this closes #324

2016-04-07 Thread omkarr
Merge branch 'CLIMATE-776'
Updating conda dependencies this closes #324


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/5c261c6d
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/5c261c6d
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/5c261c6d

Branch: refs/heads/master
Commit: 5c261c6ddcb6ca54e7969e241413e56ad0217832
Parents: 584ee86 8b54ff2
Author: Omkar20895 
Authored: Thu Apr 7 23:39:15 2016 +0530
Committer: Omkar20895 
Committed: Thu Apr 7 23:39:15 2016 +0530

--
 easy-ocw/ocw-conda-dependencies.txt | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--




[2/2] climate git commit: CLIMATE-572 Address deprecations and WARN's in ocw-ui/frontend npm install this closes #317

2016-03-02 Thread omkarr
CLIMATE-572 Address deprecations and WARN's in ocw-ui/frontend npm install this 
closes #317


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/ab83d688
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/ab83d688
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/ab83d688

Branch: refs/heads/master
Commit: ab83d6884c4335796f3357484da4d3b3e3f8442a
Parents: 6386761 4eac1ad
Author: Omkar20895 
Authored: Thu Mar 3 12:56:59 2016 +0530
Committer: Omkar20895 
Committed: Thu Mar 3 12:56:59 2016 +0530

--
 MANIFEST.in |   3 +-
 RCMES/cli_app.py|  12 +-
 .../CORDEX-Africa_examples/Fig10a_cru.yaml  |  93 +
 .../CORDEX-Africa_examples/Fig10b_cru.yaml  |  90 +
 .../CORDEX-Africa_examples/Fig1_2_4a_5.yaml | 107 ++
 .../CORDEX-Africa_examples/Fig3a_summer.yaml|  90 +
 .../CORDEX-Africa_examples/Fig3a_winter.yaml|  90 +
 .../CORDEX-Africa_examples/Fig3b_summer.yaml|  90 +
 .../CORDEX-Africa_examples/Fig3b_winter.yaml|  90 +
 .../CORDEX-Africa_examples/Fig4d_7d_8ad.yaml| 101 ++
 .../CORDEX-Africa_examples/Fig4f_9bcd.yaml  | 104 ++
 .../CORDEX-Africa_examples/Fig7e_8be.yaml   |  95 +
 .../CORDEX-Africa_examples/Fig7f_8cf.yaml   |  97 +
 .../dscale_prmo-eus_rcmed.yaml  |  83 
 .../dscale_prmo-wus_local.yaml  |  82 
 .../dscale_prmo-wus_rcmed.yaml  |  83 
 .../dscale_wus_prec_trmm_vs_nldas.yaml  |  82 
 ocw-ui/backend/run_webservices.py   |   6 +-
 ocw-ui/frontend/app/img/globe.png   | Bin 0 -> 25857 bytes
 ocw-ui/frontend/app/index.html  |   9 +-
 .../scripts/controllers/observationselect.js|   4 +-
 ocw-ui/frontend/app/views/selectrcmed.html  |   2 +-
 ocw-ui/frontend/package.json|   2 +-
 ocw/data_source/dap.py  |  22 +-
 ocw/data_source/local.py|   3 +-
 ocw/data_source/rcmed.py|   2 +
 ocw/dataset_processor.py|   7 +-
 ocw/tests/test_dap.py   |  20 +-
 ocw/tests/test_dataset_processor.py |  32 +--
 ocw/tests/test_local.py | 202 +--
 ocw/utils.py|   4 +-
 setup.cfg   |   4 -
 setup.py|   1 -
 33 files changed, 1549 insertions(+), 163 deletions(-)
--




[1/2] climate git commit: CLIMATE-830 Reverting the broken test case in test_dap.py

2016-08-15 Thread omkarr
Repository: climate
Updated Branches:
  refs/heads/master 05519e16c -> 5c195a139


CLIMATE-830 Reverting the broken test case in test_dap.py


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/8e38ccfb
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/8e38ccfb
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/8e38ccfb

Branch: refs/heads/master
Commit: 8e38ccfb0ef18a2a6685f296acf06a9363e9ae0d
Parents: 05519e1
Author: Omkar20895 
Authored: Mon Aug 15 17:10:37 2016 +0530
Committer: Omkar20895 
Committed: Mon Aug 15 17:10:37 2016 +0530

--
 ocw/tests/test_dap.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/8e38ccfb/ocw/tests/test_dap.py
--
diff --git a/ocw/tests/test_dap.py b/ocw/tests/test_dap.py
index a895a27..6ae7546 100644
--- a/ocw/tests/test_dap.py
+++ b/ocw/tests/test_dap.py
@@ -30,6 +30,7 @@ class TestDap(unittest.TestCase):
 cls.name = 'foo'
 cls.dataset = dap.load(cls.url, 'CGusfc', name=cls.name)
 
+'''
 # The tests fail for this dataset since the dataset does not have a 
time(1D) variable.
 # The tests fail because dap.py assumes that the openDAP datasets 
necessarily have the 
 # three variables 1D variables lat, lon and time and the lines 53,54 
and 55 are written
@@ -37,7 +38,7 @@ class TestDap(unittest.TestCase):
 cls.url2 = 'http://opendap-uat.jpl.nasa.gov/opendap/GeodeticsGravity/'\

'tellus/L3/mascon/RL05/JPL/CRI/netcdf/CLM4.SCALE_FACTOR.JPL.MSCNv01CRIv01.nc'
 cls.name2 = 'foo2'
-cls.dataset2 = dap.load(cls.url2, 'scale_factor', name=cls.name)
+cls.dataset2 = dap.load(cls.url2, 'scale_factor', name=cls.name)'''
 
 def test_dataset_is_returned(self):
 self.assertTrue(isinstance(self.dataset, Dataset))



[2/2] climate git commit: Merge branch 'CLIMATE-853'

2016-08-19 Thread omkarr
Merge branch 'CLIMATE-853'


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/7e53612b
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/7e53612b
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/7e53612b

Branch: refs/heads/master
Commit: 7e53612bd78a86b2ac3ce88d5e82b41c66e13b5d
Parents: 28964ae 83c19de
Author: Omkar20895 
Authored: Fri Aug 19 20:16:16 2016 +0530
Committer: Omkar20895 
Committed: Fri Aug 19 20:16:16 2016 +0530

--
 ocw/data_source/dap.py | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)
--




[1/2] climate git commit: CLIMATE-853 Fixing broken documentation in dap.py and making it PEP8 compliant

2016-08-19 Thread omkarr
Repository: climate
Updated Branches:
  refs/heads/master 28964ae74 -> 7e53612bd


CLIMATE-853 Fixing broken documentation in dap.py and making it PEP8 compliant


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/83c19de7
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/83c19de7
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/83c19de7

Branch: refs/heads/master
Commit: 83c19de75b0976e0b06a0a6c8b171ea4bb901ce9
Parents: 817c854
Author: Omkar20895 
Authored: Wed Aug 17 22:50:22 2016 +0530
Committer: Omkar20895 
Committed: Wed Aug 17 22:50:22 2016 +0530

--
 ocw/data_source/dap.py | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/83c19de7/ocw/data_source/dap.py
--
diff --git a/ocw/data_source/dap.py b/ocw/data_source/dap.py
index fc9d2a3..663bc36 100644
--- a/ocw/data_source/dap.py
+++ b/ocw/data_source/dap.py
@@ -47,18 +47,21 @@ def load(url, variable, name=''):
 # but conventions aren't always followed and all dimensions aren't always 
present so
 # see if we can make some educated deductions before defaulting to just 
pulling the first three
 # columns.
-temp_dimensions = map(lambda x:x.lower(),dataset.dimensions)
+temp_dimensions = map(lambda x: x.lower(), dataset.dimensions)
 
 dataset_dimensions = dataset.dimensions
-time = dataset_dimensions[temp_dimensions.index('time') if 'time' in 
temp_dimensions else 0]
-lat = dataset_dimensions[temp_dimensions.index('lat') if 'lat' in 
temp_dimensions else 1]
-lon = dataset_dimensions[temp_dimensions.index('lon') if 'lon' in 
temp_dimensions else 2]
+time = dataset_dimensions[temp_dimensions.index(
+'time') if 'time' in temp_dimensions else 0]
+lat = dataset_dimensions[temp_dimensions.index(
+'lat') if 'lat' in temp_dimensions else 1]
+lon = dataset_dimensions[temp_dimensions.index(
+'lon') if 'lon' in temp_dimensions else 2]
 
 # Time is given to us in some units since an epoch. We need to convert
 # these values to datetime objects. Note that we use the main object's
 # time object and not the dataset specific reference to it. We need to
 # grab the 'units' from it and it fails on the dataset specific object.
-times = np.array(_convert_times_to_datetime(d[time]))
+times = np.array(convert_times_to_datetime(d[time]))
 
 lats = np.array(dataset[lat][:])
 lons = np.array(dataset[lon][:])
@@ -73,7 +76,7 @@ def load(url, variable, name=''):
name=name, origin=origin)
 
 
-def _convert_times_to_datetime(time):
+def convert_times_to_datetime(time):
 '''Convert the OpenDAP time object's values to datetime objects
 
 The time values are stored as some unit since an epoch. These need to be



[14/16] climate git commit: CLIMATE-769 Adding PO.DAAC data source

2016-08-26 Thread omkarr
CLIMATE-769 Adding PO.DAAC data source


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/0b2b21a5
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/0b2b21a5
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/0b2b21a5

Branch: refs/heads/master
Commit: 0b2b21a54636ecb95ad75e24a83dd4e49d0c8a2c
Parents: e12314a
Author: Omkar20895 
Authored: Sat Aug 27 00:03:49 2016 +0530
Committer: Omkar20895 
Committed: Sat Aug 27 00:03:49 2016 +0530

--
 docs/source/data_source/data_sources.rst |   5 ++
 easy-ocw/ocw-pip-dependencies.txt|   1 +
 examples/podaac_integration_example.py   |  75 +
 ocw/data_source/podaac.py| 113 --
 ocw/data_source/podaac_datasource.py | 111 +
 ocw/dataset_loader.py|   6 +-
 ocw/tests/test_podaac.py |  10 +--
 7 files changed, 202 insertions(+), 119 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/0b2b21a5/docs/source/data_source/data_sources.rst
--
diff --git a/docs/source/data_source/data_sources.rst 
b/docs/source/data_source/data_sources.rst
index 19f9293..4bb4f16 100644
--- a/docs/source/data_source/data_sources.rst
+++ b/docs/source/data_source/data_sources.rst
@@ -20,3 +20,8 @@ ESGF Module
 ===
 .. automodule:: esgf
 :members:
+
+PODAAC Module
+===
+.. automodule:: podaac
+:members:

http://git-wip-us.apache.org/repos/asf/climate/blob/0b2b21a5/easy-ocw/ocw-pip-dependencies.txt
--
diff --git a/easy-ocw/ocw-pip-dependencies.txt 
b/easy-ocw/ocw-pip-dependencies.txt
index bd609dd..867c801 100644
--- a/easy-ocw/ocw-pip-dependencies.txt
+++ b/easy-ocw/ocw-pip-dependencies.txt
@@ -9,3 +9,4 @@ esgf-pyclient>=0.1.6
 python-dateutil>=2.5.3
 mock>=2.0.0
 myproxyclient>=1.4.3
+podaacpy>=1.0.2

http://git-wip-us.apache.org/repos/asf/climate/blob/0b2b21a5/examples/podaac_integration_example.py
--
diff --git a/examples/podaac_integration_example.py 
b/examples/podaac_integration_example.py
new file mode 100644
index 000..da90373
--- /dev/null
+++ b/examples/podaac_integration_example.py
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import ocw.data_source.podaac_datasource as podaac
+import ocw.evaluation as evaluation
+import ocw.metrics as metrics
+import ocw.plotter as plotter
+
+datasetId = 'PODAAC-CCF30-01XXX'
+variable = 'uwnd'
+name = 'PO.DAAC_test_dataset'
+OUTPUT_PLOT = "ccmp_temporal_std"
+""" Step 1: Load Local NetCDF Files into OCW Dataset Objects """
+print("Loading %s dataset into an OCW dataset objects" % datasetShortName)
+ccmp_dataset = podaac.load_dataset(
+variable=variable, datasetId=datasetId, name=name)
+print("CCMP_Dataset.values shape: (times, lats, lons) - %s \n" %
+  (ccmp_dataset.values.shape,))
+
+# Acessing latittudes and longitudes of netCDF file
+lats = ccmp_dataset.lats
+lons = ccmp_dataset.lons
+
+""" Step 2:  Build a Metric to use for Evaluation - Temporal STD for this 
example """
+# You can build your own metrics, but OCW also ships with some common metrics
+print("Setting up a Temporal STD metric to use for evaluation")
+std = metrics.TemporalStdDev()
+
+""" Step 3: Create an Evaluation Object using Datasets and our Metric """
+# The Evaluation Class Signature is:
+# Evaluation(reference, targets, metrics, subregions=None)
+# Evaluation can take in multiple targets and metrics, so we need to convert
+# our examples into Python lists.  Evaluation will iterate over the lists
+print("Making the Evaluation definition")
+# Temporal STD Metric gets one target dataset then reference dataset
+# should be None
+std_evaluation = evaluation.Evaluation(None, [ccmp_dataset], [std])
+print("Executing the Evaluation using the object's run() method")

[06/16] climate git commit: Updating documentation and adding example to podaac data source

2016-08-26 Thread omkarr
Updating documentation and adding example to podaac data source


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/0caf4b71
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/0caf4b71
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/0caf4b71

Branch: refs/heads/master
Commit: 0caf4b71f1f5f1f5d67870fa97936ffb0354bd25
Parents: e12314a
Author: Omkar20895 
Authored: Sat Aug 13 01:42:27 2016 +0530
Committer: Omkar20895 
Committed: Sat Aug 13 01:42:27 2016 +0530

--
 docs/source/data_source/data_sources.rst |  5 ++
 examples/podaac_integration_example.py   | 75 +++
 ocw/data_source/podaac.py|  8 +--
 3 files changed, 84 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/0caf4b71/docs/source/data_source/data_sources.rst
--
diff --git a/docs/source/data_source/data_sources.rst 
b/docs/source/data_source/data_sources.rst
index 19f9293..4bb4f16 100644
--- a/docs/source/data_source/data_sources.rst
+++ b/docs/source/data_source/data_sources.rst
@@ -20,3 +20,8 @@ ESGF Module
 ===
 .. automodule:: esgf
 :members:
+
+PODAAC Module
+===
+.. automodule:: podaac
+:members:

http://git-wip-us.apache.org/repos/asf/climate/blob/0caf4b71/examples/podaac_integration_example.py
--
diff --git a/examples/podaac_integration_example.py 
b/examples/podaac_integration_example.py
new file mode 100644
index 000..990ee56
--- /dev/null
+++ b/examples/podaac_integration_example.py
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import ocw.data_source.podaac as podaac
+import ocw.evaluation as evaluation
+import ocw.metrics as metrics
+import ocw.plotter as plotter
+
+datasetId = 'PODAAC-CCF30-01XXX'
+datasetShortName = 'CCMP_MEASURES_ATLAS_L4_OW_L3_0_WIND_VECTORS_FLK'
+variable = 'uwnd'
+name = 'PO.DAAC_test_dataset'
+OUTPUT_PLOT = "cmc_temporal_std"
+""" Step 1: Load Local NetCDF Files into OCW Dataset Objects """
+print("Loading %s dataset into an OCW dataset objects" % datasetShortName)
+cmc_dataset = podaac.load_dataset(
+variable=variable, datasetId=datasetId, datasetShortName=datasetShortName, 
name=name)
+print "CMC_Dataset.values shape: (times, lats, lons) - %s \n" % 
(cmc_dataset.values.shape,)
+
+# Acessing latittudes and longitudes of netCDF file
+lats = cmc_dataset.lats
+lons = cmc_dataset.lons
+
+""" Step 2:  Build a Metric to use for Evaluation - Temporal STD for this 
example """
+# You can build your own metrics, but OCW also ships with some common metrics
+print "Setting up a Temporal STD metric to use for evaluation"
+std = metrics.TemporalStdDev()
+
+""" Step 3: Create an Evaluation Object using Datasets and our Metric """
+# The Evaluation Class Signature is:
+# Evaluation(reference, targets, metrics, subregions=None)
+# Evaluation can take in multiple targets and metrics, so we need to convert
+# our examples into Python lists.  Evaluation will iterate over the lists
+print "Making the Evaluation definition"
+# Temporal STD Metric gets one target dataset then reference dataset
+# should be None
+std_evaluation = evaluation.Evaluation(None, [cmc_dataset], [std])
+print "Executing the Evaluation using the object's run() method"
+std_evaluation.run()
+
+""" Step 4: Make a Plot from the Evaluation.results """
+# The Evaluation.results are a set of nested lists to support many different
+# possible Evaluation scenarios.
+#
+# The Evaluation results docs say:
+# The shape of results is (num_metrics, num_target_datasets) if no subregion
+# Accessing the actual results when we have used 1 metric and 1 dataset is
+# done this way:
+print "Accessing the Results of the Evaluation run"
+results = std_evaluation.unary_results[0][0]
+print "The results are of type: %s" % type(results)
+print "Generating a contour map using ocw.plotter.draw_contour_map()"
+

[02/16] climate git commit: Updating the data source.

2016-08-26 Thread omkarr
Updating the data source.


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/fbdc087a
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/fbdc087a
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/fbdc087a

Branch: refs/heads/master
Commit: fbdc087a7958b3fa3dfe02fc366024cafaf50783
Parents: 116d16f
Author: Omkar20895 
Authored: Tue Aug 9 01:11:22 2016 +0530
Committer: Omkar20895 
Committed: Tue Aug 9 01:11:22 2016 +0530

--
 ocw/data_source/podaac.py | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/fbdc087a/ocw/data_source/podaac.py
--
diff --git a/ocw/data_source/podaac.py b/ocw/data_source/podaac.py
index 1eb0195..d2600b5 100644
--- a/ocw/data_source/podaac.py
+++ b/ocw/data_source/podaac.py
@@ -15,8 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-import sys
-sys.path.append('/Users/omkar/Documents/Git/podaacpy/podaac')
 from podaac_data_source import Podaac 
 import numpy as np
 from ocw.dataset import Dataset



[07/16] climate git commit: Making the code python 3 compliant and fixing indentation

2016-08-26 Thread omkarr
Making the code python 3 compliant and fixing indentation


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/21a78abd
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/21a78abd
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/21a78abd

Branch: refs/heads/master
Commit: 21a78abdae41a81c55b418b885371c0100d459d5
Parents: 0caf4b7
Author: Omkar20895 
Authored: Fri Aug 19 23:40:38 2016 +0530
Committer: Omkar20895 
Committed: Fri Aug 19 23:40:38 2016 +0530

--
 examples/podaac_integration_example.py | 14 
 ocw/data_source/podaac.py  | 56 ++---
 ocw/tests/test_podaac.py   |  4 +--
 3 files changed, 36 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/21a78abd/examples/podaac_integration_example.py
--
diff --git a/examples/podaac_integration_example.py 
b/examples/podaac_integration_example.py
index 990ee56..d68f747 100644
--- a/examples/podaac_integration_example.py
+++ b/examples/podaac_integration_example.py
@@ -29,7 +29,7 @@ OUTPUT_PLOT = "cmc_temporal_std"
 print("Loading %s dataset into an OCW dataset objects" % datasetShortName)
 cmc_dataset = podaac.load_dataset(
 variable=variable, datasetId=datasetId, datasetShortName=datasetShortName, 
name=name)
-print "CMC_Dataset.values shape: (times, lats, lons) - %s \n" % 
(cmc_dataset.values.shape,)
+print("CMC_Dataset.values shape: (times, lats, lons) - %s \n" % 
(cmc_dataset.values.shape,))
 
 # Acessing latittudes and longitudes of netCDF file
 lats = cmc_dataset.lats
@@ -37,7 +37,7 @@ lons = cmc_dataset.lons
 
 """ Step 2:  Build a Metric to use for Evaluation - Temporal STD for this 
example """
 # You can build your own metrics, but OCW also ships with some common metrics
-print "Setting up a Temporal STD metric to use for evaluation"
+print("Setting up a Temporal STD metric to use for evaluation")
 std = metrics.TemporalStdDev()
 
 """ Step 3: Create an Evaluation Object using Datasets and our Metric """
@@ -45,11 +45,11 @@ std = metrics.TemporalStdDev()
 # Evaluation(reference, targets, metrics, subregions=None)
 # Evaluation can take in multiple targets and metrics, so we need to convert
 # our examples into Python lists.  Evaluation will iterate over the lists
-print "Making the Evaluation definition"
+print("Making the Evaluation definition")
 # Temporal STD Metric gets one target dataset then reference dataset
 # should be None
 std_evaluation = evaluation.Evaluation(None, [cmc_dataset], [std])
-print "Executing the Evaluation using the object's run() method"
+print("Executing the Evaluation using the object's run() method")
 std_evaluation.run()
 
 """ Step 4: Make a Plot from the Evaluation.results """
@@ -60,10 +60,10 @@ std_evaluation.run()
 # The shape of results is (num_metrics, num_target_datasets) if no subregion
 # Accessing the actual results when we have used 1 metric and 1 dataset is
 # done this way:
-print "Accessing the Results of the Evaluation run"
+print("Accessing the Results of the Evaluation run")
 results = std_evaluation.unary_results[0][0]
-print "The results are of type: %s" % type(results)
-print "Generating a contour map using ocw.plotter.draw_contour_map()"
+print("The results are of type: %s" % type(results))
+print("Generating a contour map using ocw.plotter.draw_contour_map()")
 
 fname = OUTPUT_PLOT
 gridshape = (4, 5)  # 20 Years worth of plots. 20 rows in 1 column

http://git-wip-us.apache.org/repos/asf/climate/blob/21a78abd/ocw/data_source/podaac.py
--
diff --git a/ocw/data_source/podaac.py b/ocw/data_source/podaac.py
index 7c233b3..b4085e8 100644
--- a/ocw/data_source/podaac.py
+++ b/ocw/data_source/podaac.py
@@ -21,8 +21,6 @@ from ocw.dataset import Dataset
 from netCDF4 import Dataset as netcdf_dataset
 from netcdftime import utime
 import os
-import urllib
-import xml.etree.ElementTree as ET
 
 
 def convert_times_to_datetime(time):
@@ -69,45 +67,45 @@ def load_dataset(variable, datasetId='', 
datasetShortName='', name=''):
 :raises: ServerError
 '''
 # Downloading the dataset using podaac toolkit
-podaac = Podaac()
-path = os.path.dirname(os.path.abspath(__file__))
-granuleName = podaac.extract_l4_granule(
-datasetId=datasetId, shortName=datasetShortName, path=path)
-path = path + '/' + granuleName
-d = netcdf_dataset(path, mode='r')
-dataset = d.variables[variable]
+podaac = Podaac()
+path = os.path.dirname(os.path.abspath(__file__))
+granuleName = podaac.extract_l4_granule(
+dataset_id=datasetId, 

[03/16] climate git commit: Fixing all the PEP8 violations

2016-08-26 Thread omkarr
Fixing all the PEP8 violations


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/7d53faac
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/7d53faac
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/7d53faac

Branch: refs/heads/master
Commit: 7d53faac39c4a5198b5d3971fda0318865b1c48e
Parents: fbdc087
Author: Omkar20895 
Authored: Thu Aug 11 02:10:42 2016 +0530
Committer: Omkar20895 
Committed: Thu Aug 11 02:10:42 2016 +0530

--
 ocw/data_source/podaac.py | 69 --
 ocw/tests/test_podaac.py  | 76 ++
 2 files changed, 77 insertions(+), 68 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/7d53faac/ocw/data_source/podaac.py
--
diff --git a/ocw/data_source/podaac.py b/ocw/data_source/podaac.py
index d2600b5..47a5409 100644
--- a/ocw/data_source/podaac.py
+++ b/ocw/data_source/podaac.py
@@ -15,12 +15,13 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from podaac_data_source import Podaac 
+from podaac_data_source import Podaac
 import numpy as np
 from ocw.dataset import Dataset
 from netCDF4 import Dataset as netcdf_dataset
 from netcdftime import utime
-import os, urllib
+import os
+import urllib
 import xml.etree.ElementTree as ET
 
 
@@ -43,14 +44,13 @@ def _convert_times_to_datetime(time):
 return [parsed_time.num2date(x) for x in time[:]]
 
 
-
-def load_dataset(variable ,datasetId='', datasetShortName='', name=''):
+def load_dataset(variable, datasetId='', datasetShortName='', name=''):
 '''Loads a Dataset from PODAAC
 
 :param variable: The name of the variable to read from the dataset.
 :type variable: :mod:`string`
 
-   :param datasetId: dataset persistent ID. datasetId or \
+:param datasetId: dataset persistent ID. datasetId or \
 shortName is required for a granule search. Example: \
 PODAAC-ASOP2-25X01
 :type datasetId: :mod:`string` 
@@ -68,41 +68,46 @@ def load_dataset(variable ,datasetId='', 
datasetShortName='', name=''):
 
 :raises: ServerError
 '''
-#Downloading the dataset using podaac toolkit
-   podaac = Podaac()
-   path = os.path.dirname(os.path.abspath(__file__))
-   granuleName = podaac.extract_l4_granule(datasetId=datasetId, 
shortName=datasetShortName, path=path)
-   path = path+'/'+granuleName
-   d = netcdf_dataset(path, mode='r')
-   dataset = d.variables[variable]
+# Downloading the dataset using podaac toolkit
+podaac = Podaac()
+path = os.path.dirname(os.path.abspath(__file__))
+granuleName = podaac.extract_l4_granule(
+datasetId=datasetId, shortName=datasetShortName, path=path)
+path = path + '/' + granuleName
+d = netcdf_dataset(path, mode='r')
+dataset = d.variables[variable]
 
 # By convention, but not by standard, if the dimensions exist, they will 
be in the order:
 # time (t), altitude (z), latitude (y), longitude (x)
 # but conventions aren't always followed and all dimensions aren't always 
present so
 # see if we can make some educated deductions before defaulting to just 
pulling the first three
 # columns.
-   temp_dimensions = map(lambda x:x.lower(),dataset.dimensions)
-   dataset_dimensions = dataset.dimensions
-   time = dataset_dimensions[temp_dimensions.index('time') if 'time' in 
temp_dimensions else 0]
-   lat = dataset_dimensions[temp_dimensions.index('lat') if 'lat' in 
temp_dimensions else 1]
-   lon = dataset_dimensions[temp_dimensions.index('lon') if 'lon' in 
temp_dimensions else 2]
+temp_dimensions = map(lambda x: x.lower(), dataset.dimensions)
+dataset_dimensions = dataset.dimensions
+time = dataset_dimensions[temp_dimensions.index(
+'time') if 'time' in temp_dimensions else 0]
+lat = dataset_dimensions[temp_dimensions.index(
+'lat') if 'lat' in temp_dimensions else 1]
+lon = dataset_dimensions[temp_dimensions.index(
+'lon') if 'lon' in temp_dimensions else 2]
 
 # Time is given to us in some units since an epoch. We need to convert
 # these values to datetime objects. Note that we use the main object's
 # time object and not the dataset specific reference to it. We need to
 # grab the 'units' from it and it fails on the dataset specific object.
-   times = np.array(_convert_times_to_datetime(d[time]))
-   lats = np.array(d.variables[lat][:])
-   lons = np.array(d.variables[lon][:])
-   values = np.array(dataset[:])
-   origin = {
-'source' : 'PO.DAAC',
-'url' : 

[12/16] climate git commit: Trivial update to trigger travis-ci

2016-08-26 Thread omkarr
Trivial update to trigger travis-ci


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/7d0daf0c
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/7d0daf0c
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/7d0daf0c

Branch: refs/heads/master
Commit: 7d0daf0c0accd9a60d64a773a31f31fa33cc8679
Parents: 7afea8a
Author: Omkar20895 
Authored: Fri Aug 26 17:49:35 2016 +0530
Committer: Omkar20895 
Committed: Fri Aug 26 17:49:35 2016 +0530

--
 ocw/data_source/podaac_datasource.py | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/7d0daf0c/ocw/data_source/podaac_datasource.py
--
diff --git a/ocw/data_source/podaac_datasource.py 
b/ocw/data_source/podaac_datasource.py
index d06c73f..7e184d4 100644
--- a/ocw/data_source/podaac_datasource.py
+++ b/ocw/data_source/podaac_datasource.py
@@ -109,3 +109,4 @@ def load_dataset(variable, datasetId='', 
datasetShortName='', name=''):
 os.remove(path)
 
 return Dataset(lats, lons, times, values, variable, name=name, 
origin=origin)
+



[04/16] climate git commit: CLIMATE-769 Create data source input for NASA JPL PO.DAAC

2016-08-26 Thread omkarr
CLIMATE-769 Create data source input for NASA JPL PO.DAAC


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/a847e1b6
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/a847e1b6
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/a847e1b6

Branch: refs/heads/master
Commit: a847e1b645a0474f5fd01124fac55a5d8be2fec1
Parents: 116d16f
Author: Omkar20895 
Authored: Thu Aug 11 17:45:58 2016 +0530
Committer: Omkar20895 
Committed: Thu Aug 11 17:45:58 2016 +0530

--
 ocw/data_source/podaac.py | 71 ---
 ocw/tests/test_podaac.py  | 76 ++
 2 files changed, 77 insertions(+), 70 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/a847e1b6/ocw/data_source/podaac.py
--
diff --git a/ocw/data_source/podaac.py b/ocw/data_source/podaac.py
index 1eb0195..47a5409 100644
--- a/ocw/data_source/podaac.py
+++ b/ocw/data_source/podaac.py
@@ -15,14 +15,13 @@
 # specific language governing permissions and limitations
 # under the License.
 
-import sys
-sys.path.append('/Users/omkar/Documents/Git/podaacpy/podaac')
-from podaac_data_source import Podaac 
+from podaac_data_source import Podaac
 import numpy as np
 from ocw.dataset import Dataset
 from netCDF4 import Dataset as netcdf_dataset
 from netcdftime import utime
-import os, urllib
+import os
+import urllib
 import xml.etree.ElementTree as ET
 
 
@@ -45,14 +44,13 @@ def _convert_times_to_datetime(time):
 return [parsed_time.num2date(x) for x in time[:]]
 
 
-
-def load_dataset(variable ,datasetId='', datasetShortName='', name=''):
+def load_dataset(variable, datasetId='', datasetShortName='', name=''):
 '''Loads a Dataset from PODAAC
 
 :param variable: The name of the variable to read from the dataset.
 :type variable: :mod:`string`
 
-   :param datasetId: dataset persistent ID. datasetId or \
+:param datasetId: dataset persistent ID. datasetId or \
 shortName is required for a granule search. Example: \
 PODAAC-ASOP2-25X01
 :type datasetId: :mod:`string` 
@@ -70,41 +68,46 @@ def load_dataset(variable ,datasetId='', 
datasetShortName='', name=''):
 
 :raises: ServerError
 '''
-#Downloading the dataset using podaac toolkit
-   podaac = Podaac()
-   path = os.path.dirname(os.path.abspath(__file__))
-   granuleName = podaac.extract_l4_granule(datasetId=datasetId, 
shortName=datasetShortName, path=path)
-   path = path+'/'+granuleName
-   d = netcdf_dataset(path, mode='r')
-   dataset = d.variables[variable]
+# Downloading the dataset using podaac toolkit
+podaac = Podaac()
+path = os.path.dirname(os.path.abspath(__file__))
+granuleName = podaac.extract_l4_granule(
+datasetId=datasetId, shortName=datasetShortName, path=path)
+path = path + '/' + granuleName
+d = netcdf_dataset(path, mode='r')
+dataset = d.variables[variable]
 
 # By convention, but not by standard, if the dimensions exist, they will 
be in the order:
 # time (t), altitude (z), latitude (y), longitude (x)
 # but conventions aren't always followed and all dimensions aren't always 
present so
 # see if we can make some educated deductions before defaulting to just 
pulling the first three
 # columns.
-   temp_dimensions = map(lambda x:x.lower(),dataset.dimensions)
-   dataset_dimensions = dataset.dimensions
-   time = dataset_dimensions[temp_dimensions.index('time') if 'time' in 
temp_dimensions else 0]
-   lat = dataset_dimensions[temp_dimensions.index('lat') if 'lat' in 
temp_dimensions else 1]
-   lon = dataset_dimensions[temp_dimensions.index('lon') if 'lon' in 
temp_dimensions else 2]
+temp_dimensions = map(lambda x: x.lower(), dataset.dimensions)
+dataset_dimensions = dataset.dimensions
+time = dataset_dimensions[temp_dimensions.index(
+'time') if 'time' in temp_dimensions else 0]
+lat = dataset_dimensions[temp_dimensions.index(
+'lat') if 'lat' in temp_dimensions else 1]
+lon = dataset_dimensions[temp_dimensions.index(
+'lon') if 'lon' in temp_dimensions else 2]
 
 # Time is given to us in some units since an epoch. We need to convert
 # these values to datetime objects. Note that we use the main object's
 # time object and not the dataset specific reference to it. We need to
 # grab the 'units' from it and it fails on the dataset specific object.
-   times = np.array(_convert_times_to_datetime(d[time]))
-   lats = np.array(d.variables[lat][:])
-   lons = np.array(d.variables[lon][:])
-   

[16/16] climate git commit: Merge branch 'CLIMATE-769'

2016-08-26 Thread omkarr
Merge branch 'CLIMATE-769'


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/fba1ce63
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/fba1ce63
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/fba1ce63

Branch: refs/heads/master
Commit: fba1ce638eeacd73b60f46e1ce3c8f96afc4466d
Parents: 9deb819 39960b5
Author: Omkar20895 
Authored: Sat Aug 27 09:11:24 2016 +0530
Committer: Omkar20895 
Committed: Sat Aug 27 09:11:24 2016 +0530

--
 docs/source/data_source/data_sources.rst |   5 ++
 easy-ocw/ocw-pip-dependencies.txt|   1 +
 examples/podaac_integration_example.py   |  75 +
 ocw/data_source/podaac_datasource.py | 111 ++
 ocw/dataset_loader.py|   6 +-
 ocw/tests/test_podaac.py |  66 +++
 6 files changed, 263 insertions(+), 1 deletion(-)
--




[05/16] climate git commit: Merge branch 'CLIMATE-769' of https://github.com/Omkar20895/climate into CLIMATE-769

2016-08-26 Thread omkarr
Merge branch 'CLIMATE-769' of https://github.com/Omkar20895/climate into 
CLIMATE-769


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/e12314a5
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/e12314a5
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/e12314a5

Branch: refs/heads/master
Commit: e12314a5cbc8b2a3a3ecf5a0be72206a96b8f2f5
Parents: a847e1b 7d53faa
Author: Omkar20895 
Authored: Thu Aug 11 17:47:18 2016 +0530
Committer: Omkar20895 
Committed: Thu Aug 11 17:47:18 2016 +0530

--

--




[15/16] climate git commit: Merge branch 'CLIMATE-769' of https://github.com/Omkar20895/climate into CLIMATE-769

2016-08-26 Thread omkarr
Merge branch 'CLIMATE-769' of https://github.com/Omkar20895/climate into 
CLIMATE-769


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/39960b5d
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/39960b5d
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/39960b5d

Branch: refs/heads/master
Commit: 39960b5d82c86126a10d7c0c119d98418294f654
Parents: 0b2b21a 2441b16
Author: Omkar20895 
Authored: Sat Aug 27 00:07:44 2016 +0530
Committer: Omkar20895 
Committed: Sat Aug 27 00:07:44 2016 +0530

--

--




[10/16] climate git commit: Reverifying all imports and tests

2016-08-26 Thread omkarr
Reverifying all imports and tests


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/0a9d6b4f
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/0a9d6b4f
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/0a9d6b4f

Branch: refs/heads/master
Commit: 0a9d6b4ff80d0d03aeec019030e5bcdd187e8f55
Parents: 02e5c2b
Author: Omkar20895 
Authored: Thu Aug 25 20:27:10 2016 +0530
Committer: Omkar20895 
Committed: Thu Aug 25 20:27:10 2016 +0530

--
 examples/podaac_integration_example.py | 5 +++--
 ocw/dataset_loader.py  | 2 +-
 ocw/tests/test_podaac.py   | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/0a9d6b4f/examples/podaac_integration_example.py
--
diff --git a/examples/podaac_integration_example.py 
b/examples/podaac_integration_example.py
index d68f747..9194e9f 100644
--- a/examples/podaac_integration_example.py
+++ b/examples/podaac_integration_example.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-import ocw.data_source.podaac as podaac
+import ocw.data_source.podaac_datasource as podaac
 import ocw.evaluation as evaluation
 import ocw.metrics as metrics
 import ocw.plotter as plotter
@@ -29,7 +29,8 @@ OUTPUT_PLOT = "cmc_temporal_std"
 print("Loading %s dataset into an OCW dataset objects" % datasetShortName)
 cmc_dataset = podaac.load_dataset(
 variable=variable, datasetId=datasetId, datasetShortName=datasetShortName, 
name=name)
-print("CMC_Dataset.values shape: (times, lats, lons) - %s \n" % 
(cmc_dataset.values.shape,))
+print("CMC_Dataset.values shape: (times, lats, lons) - %s \n" %
+  (cmc_dataset.values.shape,))
 
 # Acessing latittudes and longitudes of netCDF file
 lats = cmc_dataset.lats

http://git-wip-us.apache.org/repos/asf/climate/blob/0a9d6b4f/ocw/dataset_loader.py
--
diff --git a/ocw/dataset_loader.py b/ocw/dataset_loader.py
index a4f3466..ed8fdb0 100644
--- a/ocw/dataset_loader.py
+++ b/ocw/dataset_loader.py
@@ -24,7 +24,7 @@ import ocw.data_source.local as local
 import ocw.data_source.esgf as esgf
 import ocw.data_source.rcmed as rcmed
 import ocw.data_source.dap as dap
-import ocw.data_source.podaac as podaac
+import ocw.data_source.podaac_datasource as podaac
 
 
 class DatasetLoader:

http://git-wip-us.apache.org/repos/asf/climate/blob/0a9d6b4f/ocw/tests/test_podaac.py
--
diff --git a/ocw/tests/test_podaac.py b/ocw/tests/test_podaac.py
index b2d4402..3e2dafd 100644
--- a/ocw/tests/test_podaac.py
+++ b/ocw/tests/test_podaac.py
@@ -16,7 +16,7 @@
 # under the License.
 
 
-import ocw.data_source.podaac as podaac
+import ocw.data_source.podaac_datasource as podaac
 import unittest
 import os
 import datetime as dt



[09/16] climate git commit: Renaming podaac.py to podaac_datasource.py and adding podaacpy dependency

2016-08-26 Thread omkarr
Renaming podaac.py to podaac_datasource.py and adding podaacpy dependency


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/02e5c2b1
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/02e5c2b1
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/02e5c2b1

Branch: refs/heads/master
Commit: 02e5c2b1b55a6b621b1650087603a512ab556851
Parents: a67ea7d
Author: Omkar20895 
Authored: Sun Aug 21 02:09:47 2016 +0530
Committer: Omkar20895 
Committed: Sun Aug 21 02:09:47 2016 +0530

--
 easy-ocw/ocw-pip-dependencies.txt|   1 +
 ocw/data_source/podaac.py| 111 --
 ocw/data_source/podaac_datasource.py | 111 ++
 3 files changed, 112 insertions(+), 111 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/02e5c2b1/easy-ocw/ocw-pip-dependencies.txt
--
diff --git a/easy-ocw/ocw-pip-dependencies.txt 
b/easy-ocw/ocw-pip-dependencies.txt
index bd609dd..91e24be 100644
--- a/easy-ocw/ocw-pip-dependencies.txt
+++ b/easy-ocw/ocw-pip-dependencies.txt
@@ -9,3 +9,4 @@ esgf-pyclient>=0.1.6
 python-dateutil>=2.5.3
 mock>=2.0.0
 myproxyclient>=1.4.3
+podaacpy>=1.0.1

http://git-wip-us.apache.org/repos/asf/climate/blob/02e5c2b1/ocw/data_source/podaac.py
--
diff --git a/ocw/data_source/podaac.py b/ocw/data_source/podaac.py
deleted file mode 100644
index e7d7b68..000
--- a/ocw/data_source/podaac.py
+++ /dev/null
@@ -1,111 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-from podaac.podaac_data_source import Podaac
-import numpy as np
-from ocw.dataset import Dataset
-from netCDF4 import Dataset as netcdf_dataset
-from netcdftime import utime
-import os
-
-
-def convert_times_to_datetime(time):
-'''Convert the time object's values to datetime objects
-
-The time values are stored as some unit since an epoch. These need to be
-converted into datetime objects for the OCW Dataset object.
-
-:param time: The time object's values to convert
-:type time: pydap.model.BaseType
-
-:returns: list of converted time values as datetime objects
-'''
-units = time.units
-# parse the time units string into a useful object.
-# NOTE: This assumes a 'standard' calendar. It's possible (likely?) that
-# users will want to customize this in the future.
-parsed_time = utime(units)
-return [parsed_time.num2date(x) for x in time[:]]
-
-
-def load_dataset(variable, datasetId='', datasetShortName='', name=''):
-'''Loads a Dataset from PODAAC
-
-:param variable: The name of the variable to read from the dataset.
-:type variable: :mod:`string`
-
-:param datasetId: dataset persistent ID. datasetId or \
-shortName is required for a granule search. Example: \
-PODAAC-ASOP2-25X01
-:type datasetId: :mod:`string`
-
-:param shortName: the shorter name for a dataset. \
-Either shortName or datasetId is required for a \
-granule search. Example: ASCATA-L2-25km
-:type shortName: :mod:`string`
-
-:param name: (Optional) A name for the loaded dataset.
-:type name: :mod:`string`
-
-:returns: A :class:`dataset.Dataset` containing the dataset pointed to by
-the OpenDAP URL.
-
-:raises: ServerError
-'''
-# Downloading the dataset using podaac toolkit
-podaac = Podaac()
-path = os.path.dirname(os.path.abspath(__file__))
-granuleName = podaac.extract_l4_granule(
-dataset_id=datasetId, short_name=datasetShortName, path=path)
-path = path + '/' + granuleName
-d = netcdf_dataset(path, mode='r')
-dataset = d.variables[variable]
-
-# By convention, but not by standard, if the dimensions exist, they will 
be in the order:
-# time (t), altitude (z), latitude (y), longitude (x)
-# but conventions aren't always followed and all dimensions aren't always 
present so
-

[11/16] climate git commit: Updating podaac dependency and example file

2016-08-26 Thread omkarr
Updating podaac dependency and example file


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/7afea8a6
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/7afea8a6
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/7afea8a6

Branch: refs/heads/master
Commit: 7afea8a61ce7f60666f93231ff60dcf82b069c3c
Parents: 0a9d6b4
Author: Omkar20895 
Authored: Fri Aug 26 08:43:05 2016 +0530
Committer: Omkar20895 
Committed: Fri Aug 26 08:43:05 2016 +0530

--
 easy-ocw/ocw-pip-dependencies.txt  |  2 +-
 examples/podaac_integration_example.py | 16 
 2 files changed, 9 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/7afea8a6/easy-ocw/ocw-pip-dependencies.txt
--
diff --git a/easy-ocw/ocw-pip-dependencies.txt 
b/easy-ocw/ocw-pip-dependencies.txt
index 91e24be..867c801 100644
--- a/easy-ocw/ocw-pip-dependencies.txt
+++ b/easy-ocw/ocw-pip-dependencies.txt
@@ -9,4 +9,4 @@ esgf-pyclient>=0.1.6
 python-dateutil>=2.5.3
 mock>=2.0.0
 myproxyclient>=1.4.3
-podaacpy>=1.0.1
+podaacpy>=1.0.2

http://git-wip-us.apache.org/repos/asf/climate/blob/7afea8a6/examples/podaac_integration_example.py
--
diff --git a/examples/podaac_integration_example.py 
b/examples/podaac_integration_example.py
index 9194e9f..f81ba31 100644
--- a/examples/podaac_integration_example.py
+++ b/examples/podaac_integration_example.py
@@ -24,17 +24,17 @@ datasetId = 'PODAAC-CCF30-01XXX'
 datasetShortName = 'CCMP_MEASURES_ATLAS_L4_OW_L3_0_WIND_VECTORS_FLK'
 variable = 'uwnd'
 name = 'PO.DAAC_test_dataset'
-OUTPUT_PLOT = "cmc_temporal_std"
+OUTPUT_PLOT = "ccmp_temporal_std"
 """ Step 1: Load Local NetCDF Files into OCW Dataset Objects """
 print("Loading %s dataset into an OCW dataset objects" % datasetShortName)
-cmc_dataset = podaac.load_dataset(
+ccmp_dataset = podaac.load_dataset(
 variable=variable, datasetId=datasetId, datasetShortName=datasetShortName, 
name=name)
-print("CMC_Dataset.values shape: (times, lats, lons) - %s \n" %
-  (cmc_dataset.values.shape,))
+print("CCMP_Dataset.values shape: (times, lats, lons) - %s \n" %
+  (ccmp_dataset.values.shape,))
 
 # Acessing latittudes and longitudes of netCDF file
-lats = cmc_dataset.lats
-lons = cmc_dataset.lons
+lats = ccmp_dataset.lats
+lons = ccmp_dataset.lons
 
 """ Step 2:  Build a Metric to use for Evaluation - Temporal STD for this 
example """
 # You can build your own metrics, but OCW also ships with some common metrics
@@ -49,7 +49,7 @@ std = metrics.TemporalStdDev()
 print("Making the Evaluation definition")
 # Temporal STD Metric gets one target dataset then reference dataset
 # should be None
-std_evaluation = evaluation.Evaluation(None, [cmc_dataset], [std])
+std_evaluation = evaluation.Evaluation(None, [ccmp_dataset], [std])
 print("Executing the Evaluation using the object's run() method")
 std_evaluation.run()
 
@@ -68,7 +68,7 @@ print("Generating a contour map using 
ocw.plotter.draw_contour_map()")
 
 fname = OUTPUT_PLOT
 gridshape = (4, 5)  # 20 Years worth of plots. 20 rows in 1 column
-plot_title = "CMC Temporal Standard Deviation"
+plot_title = "CCMP Temporal Standard Deviation"
 sub_titles = range(2002, 2010, 1)
 
 plotter.draw_contour_map(results, lats, lons, fname,



[08/16] climate git commit: Adding podaac to dataset_loader.py and updating the tests

2016-08-26 Thread omkarr
Adding podaac to dataset_loader.py and updating the tests


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/a67ea7d4
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/a67ea7d4
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/a67ea7d4

Branch: refs/heads/master
Commit: a67ea7d4d1b7da5e5fa0708fe1d6b0994eb55c27
Parents: 21a78ab
Author: Omkar20895 
Authored: Sun Aug 21 00:17:38 2016 +0530
Committer: Omkar20895 
Committed: Sun Aug 21 00:17:38 2016 +0530

--
 ocw/data_source/podaac.py | 2 +-
 ocw/dataset_loader.py | 6 +-
 ocw/tests/test_podaac.py  | 3 ++-
 3 files changed, 8 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/a67ea7d4/ocw/data_source/podaac.py
--
diff --git a/ocw/data_source/podaac.py b/ocw/data_source/podaac.py
index b4085e8..e7d7b68 100644
--- a/ocw/data_source/podaac.py
+++ b/ocw/data_source/podaac.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from podaac_data_source import Podaac
+from podaac.podaac_data_source import Podaac
 import numpy as np
 from ocw.dataset import Dataset
 from netCDF4 import Dataset as netcdf_dataset

http://git-wip-us.apache.org/repos/asf/climate/blob/a67ea7d4/ocw/dataset_loader.py
--
diff --git a/ocw/dataset_loader.py b/ocw/dataset_loader.py
index 7c90123..a4f3466 100644
--- a/ocw/dataset_loader.py
+++ b/ocw/dataset_loader.py
@@ -24,6 +24,7 @@ import ocw.data_source.local as local
 import ocw.data_source.esgf as esgf
 import ocw.data_source.rcmed as rcmed
 import ocw.data_source.dap as dap
+import ocw.data_source.podaac as podaac
 
 
 class DatasetLoader:
@@ -69,6 +70,8 @@ class DatasetLoader:
 * ``'rcmed'`` - Download the dataset from the Regional Climate Model
 Evaluation System Database
 * ``'dap'`` - Download the dataset from an OPeNDAP URL
+* ``'podaac'`` - Download the dataset from Physical Oceanography
+Distributed Active Archive Center
 
 Users who wish to load datasets from loaders not described above may
 define their own custom dataset loader function and incorporate it as
@@ -94,7 +97,8 @@ class DatasetLoader:
 'local_split': local.load_dataset_from_multiple_netcdf_files,
 'esgf': esgf.load_dataset,
 'rcmed': rcmed.parameter_dataset,
-'dap': dap.load
+'dap': dap.load,
+'podaac': podaac.load_dataset
 }
 
 def add_source_loader(self, loader_name, loader_func):

http://git-wip-us.apache.org/repos/asf/climate/blob/a67ea7d4/ocw/tests/test_podaac.py
--
diff --git a/ocw/tests/test_podaac.py b/ocw/tests/test_podaac.py
index 04712b8..b2d4402 100644
--- a/ocw/tests/test_podaac.py
+++ b/ocw/tests/test_podaac.py
@@ -19,6 +19,7 @@
 import ocw.data_source.podaac as podaac
 import unittest
 import os
+import datetime as dt
 from ocw.dataset import Dataset
 
 
@@ -51,7 +52,7 @@ class TestPodaacDataSource(unittest.TestCase):
 self.assertEquals(len(self.dataset.values), 1)
 
 def test_valid_date_conversion(self):
-start = dt.datetime(2006, 6, 7, 12)
+start = dt.datetime(1991, 9, 2, 12)
 self.assertTrue(start == self.dataset.times[0])
 
 def test_dataset_origin(self):



[2/4] climate git commit: CLIMATE-852 [OCW Documentation] Theme not found error

2016-09-27 Thread omkarr
http://git-wip-us.apache.org/repos/asf/climate/blob/731419f8/ocw/data_source/local.py
--
diff --git a/ocw/data_source/local.py b/ocw/data_source/local.py
index f2956fa..ce57538 100644
--- a/ocw/data_source/local.py
+++ b/ocw/data_source/local.py
@@ -16,7 +16,7 @@
 # under the License.
 
 import calendar
-from datetime import timedelta ,datetime
+from datetime import timedelta, datetime
 from time import strptime
 from glob import glob
 import re
@@ -113,6 +113,7 @@ def _get_netcdf_variable_name(valid_var_names, netcdf, 
netcdf_var):
 )
 raise ValueError(error)
 
+
 def load_WRF_2d_files(file_path=None,
   filename_pattern=None,
   filelist=None,
@@ -154,18 +155,19 @@ def load_WRF_2d_files(file_path=None,
 WRF_files.sort()
 
 file_object_first = netCDF4.Dataset(WRF_files[0])
-lats = file_object_first.variables['XLAT'][0,:]
-lons = file_object_first.variables['XLONG'][0,:]
+lats = file_object_first.variables['XLAT'][0, :]
+lons = file_object_first.variables['XLONG'][0, :]
 
 times = []
 nfile = len(WRF_files)
 for ifile, file in enumerate(WRF_files):
-print('Reading file '+str(ifile+1)+'/'+str(nfile), file)
+print('Reading file ' + str(ifile + 1) + '/' + str(nfile), file)
 file_object = netCDF4.Dataset(file)
-time_struct_parsed = strptime(file[-19:],"%Y-%m-%d_%H:%M:%S")
+time_struct_parsed = strptime(file[-19:], "%Y-%m-%d_%H:%M:%S")
 for ihour in numpy.arange(24):
-times.append(datetime(*time_struct_parsed[:6]) + 
timedelta(hours=ihour))
-values0= file_object.variables[variable_name][:]
+times.append(
+datetime(*time_struct_parsed[:6]) + timedelta(hours=ihour))
+values0 = file_object.variables[variable_name][:]
 if ifile == 0:
 values = values0
 variable_unit = file_object.variables[variable_name].units
@@ -175,9 +177,10 @@ def load_WRF_2d_files(file_path=None,
 times = numpy.array(times)
 return Dataset(lats, lons, times, values, variable_name, 
units=variable_unit, name=name)
 
+
 def load_file(file_path,
   variable_name,
-  variable_unit = None,
+  variable_unit=None,
   elevation_index=0,
   name='',
   lat_name=None,
@@ -229,14 +232,14 @@ def load_file(file_path,
 try:
 netcdf = netCDF4.Dataset(file_path, mode='r')
 except IOError:
-err = "Dataset filepath '%s' is invalid. Please ensure it is correct." 
%file_path
+err = "Dataset filepath '%s' is invalid. Please ensure it is correct." 
% file_path
 raise ValueError(err)
 except:
 err = (
 "The given file '%s' cannot be loaded. Either the path is invalid 
or the given file is invalid. "
 "Please ensure that it is a valid "
 "NetCDF file. If problems persist, report them to the project's "
-"mailing list." %file_path
+"mailing list." % file_path
 )
 raise ValueError(err)
 
@@ -245,7 +248,8 @@ def load_file(file_path,
 if lon_name is None:
 lon_name = _get_netcdf_variable_name(LON_NAMES, netcdf, variable_name)
 if time_name is None:
-time_name = _get_netcdf_variable_name(TIME_NAMES, netcdf, 
variable_name)
+time_name = _get_netcdf_variable_name(
+TIME_NAMES, netcdf, variable_name)
 
 lats = netcdf.variables[lat_name][:]
 lons = netcdf.variables[lon_name][:]
@@ -271,13 +275,13 @@ def load_file(file_path,
 
 # Strip out the elevation values so we're left with a 3D array.
 if level_index == 0:
-values = values [elevation_index,:,:,:]
+values = values[elevation_index, :, :, :]
 elif level_index == 1:
-values = values [:,elevation_index,:,:]
+values = values[:, elevation_index, :, :]
 elif level_index == 2:
-values = values [:,:,elevation_index,:]
-else: #pragma: no cover
-values = values [:,:,:,elevation_index]
+values = values[:, :, elevation_index, :]
+else:  # pragma: no cover
+values = values[:, :, :, elevation_index]
 
 origin = {
 'source': 'local',
@@ -286,11 +290,13 @@ def load_file(file_path,
 'lon_name': lon_name,
 'time_name': time_name
 }
-if elevation_index != 0: origin['elevation_index'] = elevation_index
+if elevation_index != 0:
+origin['elevation_index'] = elevation_index
 
 return Dataset(lats, lons, times, values, variable=variable_name,
units=variable_unit, name=name, origin=origin)
 
+
 def load_multiple_files(file_path,
 variable_name,
 dataset_name='data',
@@ -346,19 +352,20 @@ def load_multiple_files(file_path,
 prefix = 

[1/4] climate git commit: CLIMATE-852 [OCW Documentation] Theme not found error

2016-09-27 Thread omkarr
Repository: climate
Updated Branches:
  refs/heads/master f931bb12c -> 18fe8a385


http://git-wip-us.apache.org/repos/asf/climate/blob/731419f8/ocw/tests/test_dataset.py
--
diff --git a/ocw/tests/test_dataset.py b/ocw/tests/test_dataset.py
index 9d77400..a51cddc 100644
--- a/ocw/tests/test_dataset.py
+++ b/ocw/tests/test_dataset.py
@@ -24,6 +24,7 @@ import datetime as dt
 
 
 class TestDatasetAttributes(unittest.TestCase):
+
 def setUp(self):
 self.lat = np.array([10, 12, 14, 16, 18])
 self.lon = np.array([100, 102, 104, 106, 108])
@@ -64,6 +65,7 @@ class TestDatasetAttributes(unittest.TestCase):
 
 
 class TestInvalidDatasetInit(unittest.TestCase):
+
 def setUp(self):
 self.lat = np.array([10, 12, 14, 16, 18])
 self.lon = np.array([100, 102, 104, 106, 108])
@@ -122,6 +124,7 @@ class TestInvalidDatasetInit(unittest.TestCase):
 
 
 class TestDatasetFunctions(unittest.TestCase):
+
 def setUp(self):
 self.lat = np.array([10, 12, 14, 16, 18])
 self.lon = np.array([100, 102, 104, 106, 108])
@@ -213,14 +216,18 @@ class TestDatasetFunctions(unittest.TestCase):
 
 
 class TestBounds(unittest.TestCase):
+
 def setUp(self):
 self.bounds_rectangular = Bounds(lat_min=-80, lat_max=80,  
  # Lats
- lon_min=-160, lon_max=160,   # Lons
- start=dt.datetime(2000, 1, 1),  # Start time
- end=dt.datetime(2002, 1, 1))  # End time
+ lon_min=-160, lon_max=160,
   # Lons
+ start=dt.datetime(
+ 2000, 1, 1),  # Start time
+ end=dt.datetime(2002, 1, 1))  # End 
time
 self.bounds_CORDEX = Bounds(boundary_type='CORDEX South Asia')
-self.bounds_us_states = Bounds(boundary_type='us_states', 
us_states=['CA','NV','AZ'])
-self.bounds_countries = Bounds(boundary_type='countries', 
countries=['United States','Canada','Mexico'])
+self.bounds_us_states = Bounds(
+boundary_type='us_states', us_states=['CA', 'NV', 'AZ'])
+self.bounds_countries = Bounds(boundary_type='countries', countries=[
+   'United States', 'Canada', 'Mexico'])
 
 def test_keywords(self):
 self.assertEqual(self.bounds_rectangular.boundary_type, 'rectangular')
@@ -228,17 +235,18 @@ class TestBounds(unittest.TestCase):
 self.assertEqual(self.bounds_rectangular.lat_max, 80)
 self.assertEqual(self.bounds_rectangular.lon_min, -160)
 self.assertEqual(self.bounds_rectangular.lon_max, 160)
-self.assertEqual(self.bounds_rectangular.start, dt.datetime(2000,1,1))
-self.assertEqual(self.bounds_rectangular.end, dt.datetime(2002,1,1))
+self.assertEqual(self.bounds_rectangular.start,
+ dt.datetime(2000, 1, 1))
+self.assertEqual(self.bounds_rectangular.end, dt.datetime(2002, 1, 1))
 
 self.assertEqual(self.bounds_CORDEX.boundary_type, 'CORDEX South Asia')
 self.assertEqual(self.bounds_CORDEX.lat_min, -15.23)
 self.assertEqual(self.bounds_CORDEX.lat_max, 45.07)
 self.assertEqual(self.bounds_CORDEX.lon_min, 19.88)
 self.assertEqual(self.bounds_CORDEX.lon_max, 115.55)
-
+
 self.assertEqual(self.bounds_us_states.boundary_type, 'us_states')
-
+
 self.assertEqual(self.bounds_countries.boundary_type, 'countries')
 
 # Temporal tests

http://git-wip-us.apache.org/repos/asf/climate/blob/731419f8/ocw/tests/test_dataset_loader.py
--
diff --git a/ocw/tests/test_dataset_loader.py b/ocw/tests/test_dataset_loader.py
index b3c613b..5331310 100644
--- a/ocw/tests/test_dataset_loader.py
+++ b/ocw/tests/test_dataset_loader.py
@@ -22,7 +22,9 @@ import numpy as np
 from ocw.dataset import Dataset
 from ocw.dataset_loader import DatasetLoader
 
+
 class TestDatasetLoader(unittest.TestCase):
+
 def setUp(self):
 # Read netCDF file
 self.file_path = create_netcdf_object()
@@ -88,6 +90,7 @@ class TestDatasetLoader(unittest.TestCase):
 np.testing.assert_array_equal(self.loader.datasets[1].values,
   self.values2)
 
+
 def build_dataset(*args, **kwargs):
 '''
 Wrapper to Dataset constructor from fictitious 'foo' data_source.
@@ -95,6 +98,7 @@ def build_dataset(*args, **kwargs):
 origin = {'source': 'foo'}
 return Dataset(*args, origin=origin, **kwargs)
 
+
 def create_netcdf_object():
 # To create the temporary netCDF file
 file_path = '/tmp/temporaryNetcdf.nc'
@@ -138,7 +142,8 @@ def create_netcdf_object():
 values[:] = values_data
 # Assign time info to time variable
 

[4/4] climate git commit: Merge branch 'CLIMATE-852'

2016-09-27 Thread omkarr
Merge branch 'CLIMATE-852'


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/18fe8a38
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/18fe8a38
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/18fe8a38

Branch: refs/heads/master
Commit: 18fe8a38573a590a01ec97c16b21f565ae2e1bd7
Parents: f931bb1 731419f
Author: Omkar20895 
Authored: Wed Sep 28 02:34:32 2016 +0530
Committer: Omkar20895 
Committed: Wed Sep 28 02:34:32 2016 +0530

--
 docs/source/conf.py   |  35 ++--
 docs/source/data_source/data_sources.rst  |   4 +-
 docs/source/ocw/dataset_loader.rst|   2 +-
 examples/draw_climatology_map_MISR_AOD.py |  18 +-
 examples/esgf_integration_example.py  |   2 +-
 examples/knmi_to_cru31_full_bias.py   |  59 ---
 examples/model_ensemble_to_rcmed.py   |  51 +++---
 examples/multi_model_evaluation.py|  97 +-
 examples/multi_model_taylor_diagram.py| 106 +--
 examples/simple_model_to_model_bias.py|  14 +-
 examples/simple_model_tstd.py |   5 +-
 examples/subregions_portrait_diagram.py   | 115 ++--
 examples/subregions_rectangular_boundaries.py |  50 +++---
 examples/subset_TRMM_data_for_NCA_regions.py  |  32 ++--
 examples/taylor_diagram_example.py|  32 ++--
 examples/time_series_with_regions.py  | 146 +++
 ez_setup.py   |  20 ++-
 mccsearch/code/mainProg.py|  67 ---
 mccsearch/code/mainProgTemplate.py|  67 ---
 ocw/data_source/esgf.py   |   3 +
 ocw/data_source/local.py  | 141 ---
 ocw/data_source/rcmed.py  |  47 ++---
 ocw/dataset.py|  46 +++--
 ocw/dataset_processor.py  |  73 
 ocw/esgf/download.py  |  35 ++--
 ocw/esgf/logon.py |   2 +-
 ocw/esgf/main.py  |  47 ++---
 ocw/esgf/search.py|  27 ++-
 ocw/evaluation.py |  65 ---
 ocw/metrics.py|  88 +
 ocw/plotter.py| 196 -
 ocw/statistical_downscaling.py|  41 +++--
 ocw/tests/test_dap.py |   1 +
 ocw/tests/test_dataset.py |  26 ++-
 ocw/tests/test_dataset_loader.py  |   7 +-
 ocw/tests/test_dataset_processor.py   |  10 ++
 ocw/tests/test_evaluation.py  |   1 +
 ocw/tests/test_local.py   |  10 +-
 ocw/tests/test_plotter.py |   3 +
 ocw/tests/test_rcmed.py   |   1 +
 ocw/tests/test_utils.py   |   7 +
 ocw/utils.py  | 106 ++-
 setup.py  |  29 +--
 test_smoke.py |   4 +-
 44 files changed, 1077 insertions(+), 861 deletions(-)
--




[3/3] climate git commit: Merge branch 'CLIMATE-886'

2016-11-15 Thread omkarr
Merge branch 'CLIMATE-886'


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/c025ecb8
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/c025ecb8
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/c025ecb8

Branch: refs/heads/master
Commit: c025ecb88e748966f70b370ad18f81eeeadd726c
Parents: ae0ade2 67de19c
Author: Omkar20895 
Authored: Tue Nov 15 18:55:02 2016 +0530
Committer: Omkar20895 
Committed: Tue Nov 15 18:55:02 2016 +0530

--
 ocw-ui/frontend/Gruntfile.js   | 10 ++
 ocw-ui/frontend/README.md  | 23 +++
 ocw-ui/frontend/app/index.html |  6 +++---
 ocw-ui/frontend/package.json   |  1 +
 4 files changed, 33 insertions(+), 7 deletions(-)
--




[1/3] climate git commit: CLIMATE-877 Adding PODAAC data source to OCW GUI

2016-11-15 Thread omkarr
Repository: climate
Updated Branches:
  refs/heads/master ae0ade234 -> c025ecb88


CLIMATE-877 Adding PODAAC data source to OCW GUI


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/253b9973
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/253b9973
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/253b9973

Branch: refs/heads/master
Commit: 253b9973a17167a8f32b61a36ed059dccc1c00c2
Parents: 386f7b9
Author: Omkar20895 
Authored: Tue Oct 25 18:46:32 2016 +0530
Committer: Omkar20895 
Committed: Tue Oct 25 18:46:32 2016 +0530

--
 ocw-ui/backend/podaac_helpers.py| 31 +++
 ocw-ui/backend/run_webservices.py   |  2 +
 ocw-ui/frontend/app/index.html  |  1 +
 .../app/scripts/controllers/datasetselect.js|  1 +
 .../app/scripts/controllers/podaacselection.js  | 40 
 ocw-ui/frontend/app/views/selectpodaac.html | 29 ++
 6 files changed, 104 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/climate/blob/253b9973/ocw-ui/backend/podaac_helpers.py
--
diff --git a/ocw-ui/backend/podaac_helpers.py b/ocw-ui/backend/podaac_helpers.py
new file mode 100644
index 000..a17949d
--- /dev/null
+++ b/ocw-ui/backend/podaac_helpers.py
@@ -0,0 +1,31 @@
+#
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#
+
+''' Services for interacting with NASA JPL's PODAAC Database. '''
+
+from podaac.podaac_utils import PodaacUtils
+from bottle import Bottle
+
+podaac_app = Bottle()
+podaac_utils = PodaacUtils()
+
+@podaac_app.route('/datasets/', methods=['GET'])
+def get_observation_dataset_data():
+''' Return a list of dataset information from JPL's PODAAC.
+'''
+r = podaac_utils.list_available_granule_search_level2_dataset_ids()
+return r

http://git-wip-us.apache.org/repos/asf/climate/blob/253b9973/ocw-ui/backend/run_webservices.py
--
diff --git a/ocw-ui/backend/run_webservices.py 
b/ocw-ui/backend/run_webservices.py
index dae2567..41587c6 100644
--- a/ocw-ui/backend/run_webservices.py
+++ b/ocw-ui/backend/run_webservices.py
@@ -20,12 +20,14 @@ from bottle import Bottle, response, static_file
 from local_file_metadata_extractors import lfme_app
 from directory_helpers import dir_app
 from rcmed_helpers import rcmed_app
+from podaac_helpers import podaac_app
 from processing import processing_app
 
 app = Bottle()
 app.mount('/lfme/', lfme_app)
 app.mount('/dir/', dir_app)
 app.mount('/rcmed/', rcmed_app)
+app.mount('/podaac/', podaac_app)
 app.mount('/processing/', processing_app)
 
 @app.route('/')

http://git-wip-us.apache.org/repos/asf/climate/blob/253b9973/ocw-ui/frontend/app/index.html
--
diff --git a/ocw-ui/frontend/app/index.html b/ocw-ui/frontend/app/index.html
index fe3a4a4..4a2cf20 100644
--- a/ocw-ui/frontend/app/index.html
+++ b/ocw-ui/frontend/app/index.html
@@ -125,6 +125,7 @@ under the License.
 
 
 
+
 
 
 

http://git-wip-us.apache.org/repos/asf/climate/blob/253b9973/ocw-ui/frontend/app/scripts/controllers/datasetselect.js
--
diff --git a/ocw-ui/frontend/app/scripts/controllers/datasetselect.js 
b/ocw-ui/frontend/app/scripts/controllers/datasetselect.js
index b6b52ef..7a22500 100644
--- a/ocw-ui/frontend/app/scripts/controllers/datasetselect.js
+++ b/ocw-ui/frontend/app/scripts/controllers/datasetselect.js
@@ -56,6 +56,7 @@ angular.module('ocwUiApp')
   $scope.templates = [
 {title:'Local File', url: 'views/selectobservation.html'},
 {title:'RCMED', url: 'views/selectrcmed.html'},
+{title:'PODAAC', url: 'views/selectpodaac.html'},
 {title:'ESG', disabled: true}
   ];