From f79a05e157218d08c7495e90e7937210d712a5df Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Wed, 18 Nov 2020 13:59:20 -0600
Subject: [PATCH] snapshot...

---
 modules/util/gfs_reader.py | 32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/modules/util/gfs_reader.py b/modules/util/gfs_reader.py
index 0550cb39..4281bd15 100644
--- a/modules/util/gfs_reader.py
+++ b/modules/util/gfs_reader.py
@@ -157,8 +157,6 @@ def get_time_interpolated_layer(xr_dataset_s, time_s, time, fld_name, press, lon
     lyr = lyr.assign_coords(time=time_s)
 
     intrp_lyr = lyr.interp(time=time, method=method)
-    intrp_lyr = intrp_lyr.expand_dims('channel')
-    intrp_lyr = intrp_lyr.assign_coords(channel=[fld_name])
 
     return intrp_lyr
 
@@ -252,7 +250,7 @@ def get_time_interpolated_vert_profile(xr_dataset_s, time_s, fld_name, time, lon
 def get_time_interpolated_vert_profile_s(xr_dataset_s, time_s, fld_name_s, time, lons, lats, method='linear'):
     prof_s = []
     for ds in xr_dataset_s:
-        vp = get_vert_profile(ds, fld_name_s, lons, lats)
+        vp = get_vert_profile_s(ds, fld_name_s, lons, lats)
         prof_s.append(vp)
 
     prof = xr.concat(prof_s, 'time')
@@ -278,6 +276,20 @@ def get_time_interpolated_point(ds_0, ds_1, time0, time1, fld_name, time, lons,
     return intrp_vals
 
 
+def get_time_interpolated_voxel(xr_dataset_s, time_s, time, fld_name, lon, lat, press, x_width=5, y_width=5, z_width=3, method='linear'):
+    vox_s = []
+    for ds in xr_dataset_s:
+        vox = get_voxel(ds, fld_name, lon, lat, press, x_width=x_width, y_width=y_width, z_width=z_width)
+        vox_s.append(vox)
+
+    vox = xr.concat(vox_s, 'time')
+    vox = vox.assign_coords(time=time_s)
+
+    intrp_vox = vox.interp(time=time, method=method)
+
+    return intrp_vox
+
+
 def get_voxel(xr_dataset, fld_name, lon, lat, press, x_width=5, y_width=5, z_width=3):
     if lon360:
         if lon < 0:
@@ -301,6 +313,20 @@ def get_voxel(xr_dataset, fld_name, lon, lat, press, x_width=5, y_width=5, z_wid
     return sub_fld
 
 
+def get_time_interpolated_voxel_s(xr_dataset_s, time_s, time, fld_name_s, lon, lat, press, x_width=5, y_width=5, z_width=3, method='linear'):
+    vox_s = []
+    for ds in xr_dataset_s:
+        vox = get_voxel_s(ds, fld_name_s, lon, lat, press, x_width=x_width, y_width=y_width, z_width=z_width)
+        vox_s.append(vox)
+
+    vox = xr.concat(vox_s, 'time')
+    vox = vox.assign_coords(time=time_s)
+
+    intrp_vox = vox.interp(time=time, method=method)
+
+    return intrp_vox
+
+
 def get_voxel_s(xr_dataset, fld_name_s, lon, lat, press, x_width=5, y_width=5, z_width=3):
     if lon360:
         if lon < 0:
-- 
GitLab