If all data pixel are on NaN, then assign a value of 0.0 for each pixel.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user