Review Board #11785 - Updating any modules using PyNio. Applying the latest changes

git-svn-id: https://svn.apache.org/repos/asf/incubator/climate/trunk@1496657 13f79535-47bb-0310-9956-ffa450edef68

Former-commit-id: 42375a0da846d90390bb06b6e6ae130a3da465ac
diff --git a/rcmet/src/main/python/rcmes/services/dataset_helpers.py b/rcmet/src/main/python/rcmes/services/dataset_helpers.py
index 2d71df6..0bdb293 100644
--- a/rcmet/src/main/python/rcmes/services/dataset_helpers.py
+++ b/rcmet/src/main/python/rcmes/services/dataset_helpers.py
@@ -22,7 +22,6 @@
 from bottle import request, route
 
 import requests
-import Nio
 
 @route('/getObsDatasets')
 def getObservationDatasetData():
diff --git a/rcmet/src/main/python/rcmes/services/decode_model_times.py b/rcmet/src/main/python/rcmes/services/decode_model_times.py
index c585864..a36b5ab 100755
--- a/rcmet/src/main/python/rcmes/services/decode_model_times.py
+++ b/rcmet/src/main/python/rcmes/services/decode_model_times.py
@@ -104,9 +104,9 @@
    import string
    import math
    import numpy
-   import Nio
+   import netCDF4
 
-   f = Nio.open_file(filelist[0])
+   f = netCDF4.Dataset(filelist[0], mode='r')
    xtimes = f.variables[timeVarName]
    timeFormat = xtimes.units
 
diff --git a/rcmet/src/main/python/rcmes/services/find_latlon_var.py b/rcmet/src/main/python/rcmes/services/find_latlon_var.py
index 2cf1395..916401d 100755
--- a/rcmet/src/main/python/rcmes/services/find_latlon_var.py
+++ b/rcmet/src/main/python/rcmes/services/find_latlon_var.py
@@ -49,7 +49,7 @@
 """
 
 import sys
-import Nio
+import netCDF4
 import bottle
 from bottle import request
 import json
@@ -60,11 +60,11 @@
 def find_latlon(filename):
   success = 0
   filename = filename.strip('"')
-  f = Nio.open_file(filename)
-  var_name_list = f.variables.keys()
+  f = netCDF4.Dataset(filename, mode='r')
 
   # convert all variable names into lower case
-  var_name_list_lower = [x.lower() for x in var_name_list]
+  var_name_list_lower = [key.encode().lower() for key in f.variables.keys()]
+  var_name_list = var_name_list_lower
 
   # create a "set" from this list of names
   varset = set(var_name_list_lower)
diff --git a/rcmet/src/main/python/rcmes/services/find_time_var.py b/rcmet/src/main/python/rcmes/services/find_time_var.py
index 9eb6a04..71e8fc6 100755
--- a/rcmet/src/main/python/rcmes/services/find_time_var.py
+++ b/rcmet/src/main/python/rcmes/services/find_time_var.py
@@ -45,7 +45,7 @@
 import sys
 import bottle
 from bottle import request
-import Nio
+import netCDF4
 import json
 import decode_model_times as dmt
 
@@ -57,10 +57,10 @@
 def list_time(filename):
     filename = filename.strip('"')
     success = 0
-    f = Nio.open_file(filename)
-    var_name_list = f.variables.keys()
+    f = netCDF4.Dataset(filename, mode='r')
     # convert all variable names into lower case
-    var_name_list_lower = [x.lower() for x in var_name_list]
+    var_name_list_lower = [key.encode().lower() for key in f.variables.keys()]
+    var_name_list = var_name_list_lower
     # create a "set" from this list of names
     varset = set(var_name_list_lower)
     # Use "set" types for finding common variable name from in the file and from the list of possibilities
diff --git a/rcmet/src/main/python/rcmes/services/list_vars_in_file.py b/rcmet/src/main/python/rcmes/services/list_vars_in_file.py
index d6ffb0b..3e32861 100755
--- a/rcmet/src/main/python/rcmes/services/list_vars_in_file.py
+++ b/rcmet/src/main/python/rcmes/services/list_vars_in_file.py
@@ -40,7 +40,7 @@
 """
 
 import sys
-import Nio
+import netCDF4
 import bottle
 from bottle import request
 import json
@@ -53,13 +53,13 @@
     filename = filename.strip('"')
     print filename + ' is filename variable'
     try:
-      f = Nio.open_file(filename)
+      f = netCDF4.Dataset(filename, mode='r')
       success = 1
     except:
       print 'Error_reading_file '+filename
     
     if success:  #make some json
-      var_name_list = json.dumps({'variables':f.variables.keys() }, \
+      var_name_list = json.dumps({'variables':f.variables.keys().encode() }, \
                                  sort_keys=True, indent=2)
       if (request.query.callback):
           return "%s(%s)" % (request.query.callback, var_name_list)
diff --git a/rcmet/src/main/python/rcmes/storage/db.py.REMOVED.git-id b/rcmet/src/main/python/rcmes/storage/db.py.REMOVED.git-id
index beebee0..0343934 100644
--- a/rcmet/src/main/python/rcmes/storage/db.py.REMOVED.git-id
+++ b/rcmet/src/main/python/rcmes/storage/db.py.REMOVED.git-id
@@ -1 +1 @@
-21502b62406d954db34c6461fa73a2b455e073b3
\ No newline at end of file
+b6b0197168f62d04398b6a030e636ed9bcba0943
\ No newline at end of file
diff --git a/rcmet/src/main/python/rcmes/storage/files.py.REMOVED.git-id b/rcmet/src/main/python/rcmes/storage/files.py.REMOVED.git-id
index 0a4c4cd..863f145 100644
--- a/rcmet/src/main/python/rcmes/storage/files.py.REMOVED.git-id
+++ b/rcmet/src/main/python/rcmes/storage/files.py.REMOVED.git-id
@@ -1 +1 @@
-a0917d1311192c11e850e70e9ae77cd93fab260b
\ No newline at end of file
+4d1d834b058d4dba5c1289af634d361e575d6892
\ No newline at end of file
diff --git a/rcmet/src/main/python/rcmes/utils/misc.py.REMOVED.git-id b/rcmet/src/main/python/rcmes/utils/misc.py.REMOVED.git-id
index f1dcf65..7162413 100644
--- a/rcmet/src/main/python/rcmes/utils/misc.py.REMOVED.git-id
+++ b/rcmet/src/main/python/rcmes/utils/misc.py.REMOVED.git-id
@@ -1 +1 @@
-41e7b1d2221ff4251edf118aec8575615c33ef8f
\ No newline at end of file
+48777becb23e692f2dd693f448fbd42c8296f4e5
\ No newline at end of file