diff --git a/modules/deeplearning/icing_fcn.py b/modules/deeplearning/icing_fcn.py index 68ff1476d7267b7004a7cb90c7a262cdc266347b..0266abf82b84bb1027e5fba3a50e9d0853969fc4 100644 --- a/modules/deeplearning/icing_fcn.py +++ b/modules/deeplearning/icing_fcn.py @@ -42,7 +42,7 @@ NOISE_TRAINING = True NOISE_STDDEV = 0.001 DO_AUGMENT = True -img_width = 16 +IMG_WIDTH = 16 # This is the X,Y dimension length during training mean_std_dct = {} mean_std_file = ancillary_path+'mean_std_lo_hi_l2.pkl' @@ -138,7 +138,8 @@ def build_residual_block_1x1(input_layer, num_filters, activation, block_name, p class IcingIntensityFCN: - def __init__(self, day_night='DAY', l1b_or_l2='both', satellite='GOES16', use_flight_altitude=False, datapath=None): + def __init__(self, y_dim_len=IMG_WIDTH, x_dim_len=IMG_WIDTH, + day_night='DAY', l1b_or_l2='both', use_flight_altitude=False, datapath=None): if day_night == 'DAY': self.train_params_l1b = train_params_l1b_day @@ -159,8 +160,6 @@ class IcingIntensityFCN: elif l1b_or_l2 == 'l2': self.train_params = train_params_l2_night - # self.train_params, self.train_params_l1b, self.train_params_l2 = get_training_parameters(day_night=day_night, l1b_andor_l2=l1b_or_l2, satellite=satellite) - self.train_data = None self.train_label = None self.test_data = None @@ -245,13 +244,16 @@ class IcingIntensityFCN: self.data_dct = None self.cth_max = None + self.Y_DIM_LEN = y_dim_len + self.X_DIM_LEN = x_dim_len + n_chans = len(self.train_params) if TRIPLET: n_chans *= 3 - self.X_img = tf.keras.Input(shape=(None, None, n_chans)) + self.X_img = tf.keras.Input(shape=(self.Y_DIM_LEN, self.X_DIM_LEN, n_chans)) self.inputs.append(self.X_img) - self.inputs.append(tf.keras.Input(shape=(None, None, NumFlightLevels))) + self.inputs.append(tf.keras.Input(shape=(self.Y_DIM_LEN // IMG_WIDTH, self.X_DIM_LEN // IMG_WIDTH, NumFlightLevels))) self.flight_level = 0