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

snapshot...

parent 1e024149
No related branches found
No related tags found
No related merge requests found
...@@ -125,6 +125,20 @@ def get_horz_layer_s(xr_dataset, fld_names, press, lon_lo=None, lon_hi=None, lat ...@@ -125,6 +125,20 @@ def get_horz_layer_s(xr_dataset, fld_names, press, lon_lo=None, lon_hi=None, lat
return sub_fld return sub_fld
def get_time_interpolated_layer(ds_0, ds_1, time_0, time_1, time, fld_name, press, lon_lo, lon_hi, lat_lo, lat_hi):
lyr_0 = get_horz_layer(ds_0, fld_name, press, lon_lo, lon_hi, lat_lo, lat_hi)
lyr_1 = get_horz_layer(ds_1, fld_name, press, lon_lo, lon_hi, lat_lo, lat_hi)
lyr = xr.concat([lyr_0, lyr_1], 'time')
lyr = lyr.assign_coords(time=[time_0, time_1])
intrp_lyr = lyr.interp(time=time, method='linear')
intrp_lyr = intrp_lyr.expand_dims('channel')
intrp_lyr = intrp_lyr.assign_coords(channel=[fld_name])
return intrp_lyr
def get_vert_profile(xr_dataset, fld_name, lons, lats): def get_vert_profile(xr_dataset, fld_name, lons, lats):
if lon360: # convert -180/+180 to 0,360 if lon360: # convert -180/+180 to 0,360
lons = np.where(lons < 0, lons + 360, lons) lons = np.where(lons < 0, lons + 360, lons)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment