@@ -61,7 +61,7 @@ def convert_to_dtype(data, dtype):
6161Compositing Functions
6262"""
6363
64- def create_mosaic (dataset_in , clean_mask = None , no_data = - 9999 , dtype = None , intermediate_product = None , ** kwargs ):
64+ def create_mosaic (dataset_in , clean_mask = None , no_data = float ( 'nan' ) , dtype = None , intermediate_product = None , ** kwargs ):
6565 """
6666 Creates a most-recent-to-oldest mosaic of the input dataset.
6767
@@ -125,7 +125,7 @@ def create_mosaic(dataset_in, clean_mask=None, no_data=-9999, dtype=None, interm
125125 dataset_out = restore_or_convert_dtypes (dtype , band_list , dataset_in_dtypes , dataset_out , no_data )
126126 return dataset_out
127127
128- def create_mean_mosaic (dataset_in , clean_mask = None , no_data = - 9999 , dtype = None , ** kwargs ):
128+ def create_mean_mosaic (dataset_in , clean_mask = None , no_data = float ( 'nan' ) , dtype = None , ** kwargs ):
129129 """
130130 Method for calculating the mean pixel value for a given dataset.
131131
@@ -215,7 +215,7 @@ def create_median_mosaic(dataset_in, clean_mask=None, no_data=float('nan'), dtyp
215215 return dataset_out
216216
217217
218- def create_max_ndvi_mosaic (dataset_in , clean_mask = None , no_data = - 9999 , dtype = None , intermediate_product = None , ** kwargs ):
218+ def create_max_ndvi_mosaic (dataset_in , clean_mask = None , no_data = float ( 'nan' ) , dtype = None , intermediate_product = None , ** kwargs ):
219219 """
220220 Method for calculating the pixel value for the max ndvi value.
221221
@@ -279,7 +279,7 @@ def create_max_ndvi_mosaic(dataset_in, clean_mask=None, no_data=-9999, dtype=Non
279279 return dataset_out
280280
281281
282- def create_min_ndvi_mosaic (dataset_in , clean_mask = None , no_data = [ - 9999 , 0 , np . float ('nan' )] , dtype = None , intermediate_product = None , ** kwargs ):
282+ def create_min_ndvi_mosaic (dataset_in , clean_mask = None , no_data = float ('nan' ), dtype = None , intermediate_product = None , ** kwargs ):
283283 """
284284 Method for calculating the pixel value for the min ndvi value.
285285
@@ -525,12 +525,12 @@ def restore_or_convert_dtypes(dtype_for_all, band_list, dataset_in_dtypes, datas
525525 if dtype_for_all is not None :
526526 # Integer types can't represent nan.
527527 if np .issubdtype (dtype_for_all , np .integer ): # This also works for Python int type.
528- utilities . nan_to_num ( dataset_out , no_data )
528+ dataset_out . fillna ( no_data )
529529 convert_to_dtype (dataset_out , dtype_for_all )
530530 else : # Restore dtypes to state before masking.
531531 for band in band_list :
532532 band_dtype = dataset_in_dtypes [band ]
533533 if np .issubdtype (band_dtype , np .integer ):
534- utilities . nan_to_num ( dataset_out [band ], no_data )
534+ dataset_out [band ]. fillna ( no_data )
535535 dataset_out [band ] = dataset_out [band ].astype (band_dtype )
536536 return dataset_out
0 commit comments