Skip to content
Snippets Groups Projects
Commit f79a05e1 authored by tomrink's avatar tomrink
Browse files

snapshot...

parent f74a467f
Branches
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment