data_cube_notebooks icon indicating copy to clipboard operation
data_cube_notebooks copied to clipboard

get a TypeError when plotting

Open aarifsk opened this issue 5 years ago • 2 comments

code :- import utils.data_cube_utilities.plotter_utils as plotter plotter.plot_band(cleaned_landsat_dataset, ndvi_data_arr)

TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

--> 657 within plotter_utils.py mask = ~np.isnan(means) & ~np.isnan(medians)

Notebook name :- NDVI_Thresholds

aarifsk avatar Jun 17 '19 09:06 aarifsk

the error can be fixed by replacing np.isnan with pd.isnull

however, the next immediate line throws an error. This is because the method is not defined to receive two xarray datasets as arguments and is as follows :-

def plot_band(dataset, figsize=(20,15), fontsize=24, legend_fontsize=24)

however, the call made in the notebook is plotter.plot_band(cleaned_landsat_dataset, ndvi_data_arr)

and the ndvi_data_arr is interpreted as the figsize

aarifsk avatar Jun 17 '19 17:06 aarifsk

plotter.plot_band(cleaned_landsat_dataset, ndvi_data_arr) should be changed to plotter.plot_band(ndvi_data_arr)

aarifsk avatar Jun 17 '19 17:06 aarifsk