If all data pixel are on NaN, then assign a value of 0.0 for each pixel.

This commit is contained in:
2023-04-26 15:36:08 +02:00
parent ab9fd59148
commit a3492c10f3

View File

@@ -198,6 +198,11 @@ def check_image_properties(data, data_file):
list_nans = np.where(np.isnan(data))[0]
data_clean = np.delete(data, list_nans)
# If all pixels are on NaN, then put the mean value onto 0.0.
if len(list_nans) == len(data):
data_mean = 0.0
else:
data_mean = np.mean(data_clean)
for nan in list_nans: