GeoscienceAustralia / dea-notebooks

Repository for Digital Earth Australia Jupyter Notebooks: tools and workflows for geospatial analysis with Open Data Cube and Xarray
https://docs.dea.ga.gov.au/notebooks/
Apache License 2.0
442 stars 128 forks source link

sklearn_flatten in dea_tools/classification not working as expected #1260

Open Kooie-cate opened 1 month ago

Kooie-cate commented 1 month ago

sklean_flattern appears to be dropping pixels.

Expected behaviour when using this model to flatten an array I expect the resulting 1D array to have the same size and the original array (ie an array where x=200 and y = 400 should return a 1d array with a size of 80000 pixels.)

when I run this with data that has data masked out for cloud or shadow it seems to drop those pixels from the 1D array.

Environment information DEA Sandbox

robbibt commented 1 month ago

Thanks @Kooie-cate! I think Ness may have run into something similar... would be great to make sure this is working as expected! There may have been some changes to numpy/xarray logic in recent Sandbox updates

Kooie-cate commented 1 month ago

Oh no! @robbibt I talked to Damien about it just by chance and it seems like the problem is me! or rather it doesn't do what I expect but it does do what is intended, but the documentation doesn't make that clear that this is the intended behavior. Maybe improving the documentation and or adding a flag to turn this on/off is needed?