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

add icing altitude

parent 05cf73d4
Branches
Tags
No related merge requests found
...@@ -303,6 +303,35 @@ class IcingIntensityNN: ...@@ -303,6 +303,35 @@ class IcingIntensityNN:
nda = h5f[param][nd_idxs,] nda = h5f[param][nd_idxs,]
return nda return nda
def get_scalar_data(self, nd_idxs, is_training):
param = 'flight_altitude'
if is_training:
if self.h5f_l1b_trn is not None:
h5f = self.h5f_l1b_trn
else:
h5f = self.h5f_l2_trn
else:
if self.h5f_l1b_tst is not None:
h5f = self.h5f_l1b_tst
else:
h5f = self.h5f_l2_tst
nda = h5f[param][nd_idxs,]
b0 = np.logical_and(nda >= 0, nda < 2000)
b1 = np.logical_and(nda >= 2000, nda < 4000)
b2 = np.logical_and(nda >= 4000, nda < 6000)
b3 = np.logical_and(nda >= 6000, nda < 8000)
b4 = np.logical_and(nda >= 8000, nda < 15000)
nda[b0] = 0
nda[b1] = 1
nda[b2] = 2
nda[b3] = 3
nda[b4] = 4
nda = tf.one_hot(nda, 5).numpy()
return nda
def get_label_data(self, nd_idxs, is_training): def get_label_data(self, nd_idxs, is_training):
# Note: labels will be same for nd_idxs across both L1B and L2 # Note: labels will be same for nd_idxs across both L1B and L2
if is_training: if is_training:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment