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

snapshot...

parent bff3266a
No related branches found
No related tags found
No related merge requests found
......@@ -363,22 +363,44 @@ class IcingIntensityFCN:
def get_in_mem_data_batch_test(self, idxs):
return self.get_in_mem_data_batch(idxs, False)
# For full image processing, not quite there yet :(
# def get_in_mem_data_batch_eval(self, idxs):
# data = []
# for param in self.train_params:
# nda = self.data_dct[param]
# nda = normalize(nda, param, mean_std_dct)
# data.append(nda)
# data = np.stack(data)
# data = data.astype(np.float32)
# data = np.transpose(data, axes=(1, 2, 0))
# data = np.expand_dims(data, axis=0)
#
# nda = np.zeros([1])
# nda[0] = self.flight_level
# nda = tf.one_hot(nda, 5).numpy()
# nda = np.expand_dims(nda, axis=0)
# nda = np.expand_dims(nda, axis=0)
#
# return data, nda
def get_in_mem_data_batch_eval(self, idxs):
# sort these to use as numpy indexing arrays
nd_idxs = np.array(idxs)
nd_idxs = np.sort(nd_idxs)
data = []
for param in self.train_params:
nda = self.data_dct[param]
nda = self.data_dct[param][nd_idxs, ]
nda = normalize(nda, param, mean_std_dct)
data.append(nda)
data = np.stack(data)
data = data.astype(np.float32)
data = np.transpose(data, axes=(1, 2, 0))
data = np.expand_dims(data, axis=0)
data = np.transpose(data, axes=(1, 2, 3, 0))
nda = np.zeros([1])
nda[0] = self.flight_level
# TODO: altitude data will be specified by user at run-time
nda = np.zeros([nd_idxs.size])
nda[:] = self.flight_level
nda = tf.one_hot(nda, 5).numpy()
nda = np.expand_dims(nda, axis=0)
nda = np.expand_dims(nda, axis=0)
return data, nda
......
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