Repository: creare-com/podpac
Issue: Test and update SMAP with regard to Coordinates refactor

**Description**
The Coordinates API was updated in #84 but SMAP has not been tested. I suppose it is possible that there are no issues.

**Steps to Reproduce**

Run the SMAP notebooks.

Changed files:
podpac/datalib/airmoss.py, podpac/datalib/smap.py

diff --git a/podpac/datalib/airmoss.py b/podpac/datalib/airmoss.py
index 340d9866..93dd8d84 100644
--- a/podpac/datalib/airmoss.py
+++ b/podpac/datalib/airmoss.py
@@ -52,16 +52,11 @@ class AirMOSS_Source(datatype.PyDAP):
         ds = self.dataset
         base_date = ds['time'].attributes['units']
         base_date = self.date_url_re.search(base_date).group()
-        times = (ds['time'][:]).astype('timedelta64[h]')\\
-            + np.array(base_date, 'datetime64')
+        times = (ds['time'][:]).astype('timedelta64[h]') + np.array(base_date, 'datetime64')
 
-        lons = (ds['lon'][0], ds['lon'][-1],
-                ds['lon'][1] - ds['lon'][0])
-        lats = (ds['lat'][0], ds['lat'][-1],
-                ds['lat'][1] - ds['lat'][0])
-
-        coords = podpac.Coordinate(time=np.array(times), lat=lats, lon=lons,
-                                   coord_order=['time', 'lat', 'lon'])
+        lons = podpac.crange(ds['lon'][0], ds['lon'][-1], ds['lon'][1] - ds['lon'][0])
+        lats = podpac.crange(ds['lat'][0], ds['lat'][-1], ds['lat'][1] - ds['lat'][0])
+        coords = podpac.Coordinates([times, lats, lons], dims=['time', 'lat', 'lon'])
         self.cache_obj(coords, 'native.coordinates')
 
         return coords
@@ -82,8 +77,7 @@ class AirMOSS_Source(datatype.PyDAP):
             Description
         """
         data = self.dataset[self.datakey].array[tuple(coordinates_index)]
-        d = self.initialize_coord_array(coordinates, 'data',
-                                        fillval=data.reshape(coordinates.shape))
+        d = self.initialize_coord_array(coordinates, 'data', fillval=data.reshape(coordinates.shape))
         return d
 
 
@@ -105,10 +99,8 @@ class AirMOSS_Site(podpac.OrderedCompositor):
     """
 
     product = tl.Enum(['L4RZSM'], default_value='L4RZSM')
-    base_url = tl.Unicode(    u'https://thredds.daac.ornl.gov/thredds/dodsC/'
-                              u'ornldaac/1421')
-    base_dir_url = tl.Unicode(u'https://thredds.daac.ornl.gov/thredds/catalog/'
-                              u'ornldaac/1421/catalog.html')
+    base_url = tl.Unicode(u'https://thredds.daac.ornl.gov/thredds/dodsC/ornldaac/1421')
+    base_dir_url = tl.Unicode(u'https://thredds.daac.ornl.gov/thredds/catalog/ornldaac/1421/catalog.html')
     site = tl.Unicode('')
     date_url_re = re.compile('[0-9]{8}')
 
@@ -127,13 +119,9 @@ class AirMOSS_Site(podpac.OrderedCompositor):
 
         ds = self.dataset
         times = self.get_available_dates()
-        lons = (ds['lon'][0], ds['lon'][-1],
-                ds['lon'][1] - ds['lon'][0])
-        lats = (ds['lat'][0], ds['lat'][-1],
-                ds['lat'][1] - ds['lat'][0])
-
-        coords = podpac.Coordinate(time=np.array(times), lat=lats, lon=lons,
-                                   coord_order=['time', 'lat', 'lon'])
+        lons = podpac.crange(ds['lon'][0], ds['lon'][-1], ds['lon'][1] - ds['lon'][0])
+        lats = podpac.crange(ds['lat'][0], ds['lat'][-1], ds['lat'][1] - ds['lat'][0])
+        coords = podpac.Coordinates([times, lats, lons], dims=['time', 'lat', 'lon'])
         self.cache_obj(coords, 'native.coordinates')
 
         return coords
@@ -215,8 +203,7 @@ if __name__ == '__main__':
                        site='BermsP')
     print(ams.native_coordinates)
 
-    source = ('https://thredds.daac.ornl.gov/thredds/dodsC/ornldaac/1421/'
-              'L4RZSM_BermsP_20121025_v5.nc4')
+    source = 'https://thredds.daac.ornl.gov/thredds/dodsC/ornldaac/1421/L4RZSM_BermsP_20121025_v5.nc4'
     am = AirMOSS_Source(source=source, interpolation='nearest_preview')
     coords = am.native_coordinates
     print(coords)
@@ -225,7 +212,7 @@ if __name__ == '__main__':
     lat, lon = am.native_coordinates.coords['lat'], am.native_coordinates.coords['lon']
     lat = lat[::10][np.isfinite(lat[::10])]
     lon = lon[::10][np.isfinite(lon[::10])]
-    coords = podpac.Coordinate(lat=lat, lon=lon, order=['lat', 'lon'])
+    coords = podpac.Coordinates([lat, lon], order=['lat', 'lon'])
     o = am.execute(coords)
 
     print('Done')
diff --git a/podpac/datalib/smap.py b/podpac/datalib/smap.py
index 406a5c2a..6c7ad028 100644
--- a/podpac/datalib/smap.py
+++ b/podpac/datalib/smap.py
@@ -55,9 +55,9 @@ COMMON_DOC.update(
 
         Returns
         -------
-        podpac.Coordinate
+        podpac.Coordinates
             Coordinates that uniquely describe each source''',
-                                                             'keys': '''Available layers that are in the OpenDAP dataset
+     'keys': '''Available layers that are in the OpenDAP dataset
 
         Returns
         -------
@@ -245,8 +245,7 @@ class SMAPSource(datatype.PyDAP):
         lats[lats == self.nan_vals[0]] = np.nan
         lons = np.nanmean(lons, axis=0)
         lats = np.nanmean(lats, axis=1)
-        coords = podpac.Coordinate(lat=lats, lon=lons, time=np.array(times),
-                                   order=['time', 'lat', 'lon'])
+        coords = podpac.Coordinates([lat, lon, time], dims=['time', 'lat', 'lon'])
         self.cache_obj(coords, 'native.coordinates')
         return coords
 
@@ -346,20 +345,18 @@ class SMAPProperties(SMAPSource):
         """{get_native_coordinates}
         """
         try:
-            return self.load_cached_obj('native.coordinates')
+            coords = self.load_cached_obj('native.coordinates')
         except:
-            pass
-
-        ds = self.dataset
-        lons = np.array(ds[self.lonkey][:, :])
-        lats = np.array(ds[self.latkey][:, :])
-        lons[lons == self.nan_vals[0]] = np.nan
-        lats[lats == self.nan_vals[0]] = np.nan
-        lons = np.nanmean(lons, axis=0)
-        lats = np.nanmean(lats, axis=1)
-        coords = podpac.Coordinate(lat=lats, lon=lons,
-                                   order=['lat', 'lon'])
-        self.cache_obj(coords, 'native.coordinates')
+            ds = self.dataset
+            lons = np.array(ds[self.lonkey][:, :])
+            lats = np.array(ds[self.latkey][:, :])
+            lons[lons == self.nan_vals[0]] = np.nan
+            lats[lats == self.nan_vals[0]] = np.nan
+            lons = np.nanmean(lons, axis=0)
+            lats = np.nanmean(lats, axis=1)
+            coords = podpac.Coordinates([lats, lons], dims=['lat', 'lon'])
+            self.cache_obj(coords, 'native.coordinates')
+        
         return coords
 
 class SMAPPorosity(SMAPProperties):
@@ -442,9 +439,7 @@ class SMAPDateFolder(podpac.OrderedCompositor):
     layerkey = tl.Unicode()
     @tl.default('layerkey')
     def _layerkey_default(self):
-        return SMAP_PRODUCT_MAP.sel(
-            product=self.product,
-            attr='layerkey').item()
+        return SMAP_PRODUCT_MAP.sel(product=self.product, attr='layerkey').item()
 
     @tl.observe('layerkey')
     def _layerkey_change(self, change):
@@ -485,12 +480,10 @@ class SMAPDateFolder(podpac.OrderedCompositor):
             tol = tol - tol
             tol = np.timedelta64(1, dtype=(tol.dtype))
 
-        src_objs = np.array([SMAPSource(source=b + s,
-                                        interpolation_tolerance=tol,
-                                        auth_session=self.auth_session,
-                                        layerkey=self.layerkey)
-                             for s in sources])
-        return src_objs
+        src_objs = [
+            SMAPSource(source=b+s, interpolation_tolerance=tol, auth_session=self.auth_session, layerkey=self.layerkey)
+            for s in sources]
+        return np.array(src_objs)
 
     @tl.default('is_source_coordinates_complete')
     def src_crds_complete_default(self):
@@ -514,19 +507,16 @@ class SMAPDateFolder(podpac.OrderedCompositor):
         times, latlon, _ = self.get_available_coords_sources()
 
         if latlon is not None and latlon.size > 0:
-            crds = podpac.Coordinate(
-                time_lat_lon=(times,
-                              podpac.Coord(latlon[:, 0], delta=self.latlon_delta),
-                              podpac.Coord(latlon[:, 1], delta=self.latlon_delta)
-                            )
-            )
+            lat = podpac.Coord(latlon[:, 0], delta=self.latlon_delta) # TODO
+            lon = podpac.Coord(latlon[:, 1], delta=self.latlon_delta) # TODO
+            crds = podpac.Coordinates([[times, lat, lon]], dims=['lat_lon_time'])
         else:
-            crds = podpac.Coordinate(time=times)
+            crds = podpac.Coordinates([times], dims=['times'])
         self.cache_obj(crds, 'source.coordinates')
         return crds
 
     def get_shared_coordinates(self):
-        """Coordinate that are shared by all files in the folder.
+        """Coordinates that are shared by all files in the folder.
 
         Returns
         -------
@@ -702,7 +692,7 @@ class SMAP(podpac.OrderedCompositor):
     def get_source_coordinates(self):
         """{source_coordinates}
         """
-        return podpac.Coordinate(time=self.get_available_times_dates()[0])
+        return podpac.Coordinates([self.get_available_times_dates()[0]], dims=['time'])
 
     def get_available_times_dates(self):
         """Returns the available folder dates in the SMAP product