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

snapshot...

parent 350b99ac
No related branches found
Tags 0.2
No related merge requests found
......@@ -12,6 +12,7 @@ import pickle
from netCDF4 import Dataset
from util.setup import ancillary_path
from scipy.interpolate import RectBivariateSpline, interp2d
from scipy.ndimage import gaussian_filter
LatLonTuple = namedtuple('LatLonTuple', ['lat', 'lon'])
......@@ -1426,6 +1427,18 @@ def resample_2d_linear_one(x, y, z, x_new, y_new):
return f(x_new, y_new)
# Gaussian filter suitable for model training Data Pipeline
# z: input array. Must have dimensions: [BATCH_SIZE, Y, X]
# sigma: Standard deviation for Gaussian kernel
# returns stacked 2d arrays of same input dimension
def smooth_2d(z, sigma=1.0):
z_smoothed = []
for j in range(z.shape[0]):
z_j = z[j, :, :]
z_smoothed.append(gaussian_filter(z_j, sigma=sigma))
return np.stack(z_smoothed)
def get_training_parameters(day_night='DAY', l1b_andor_l2='both', satellite='GOES16', use_dnb=False):
if day_night == 'DAY':
train_params_l2 = ['cld_height_acha', 'cld_geo_thick', 'cld_temp_acha', 'cld_press_acha', 'supercooled_cloud_fraction',
......
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