georasters icon indicating copy to clipboard operation
georasters copied to clipboard

block_reduce loses mask data

Open marthinwurer opened this issue 5 years ago • 1 comments

As per https://stackoverflow.com/a/56331273/3000741, using the scipy block reduce loses all mask information. This can cause lots of calculation errors. The one that I'm running into at the moment is with the CHELSEA dataset. When I try to block reduce, the masked array is filled with the no data value and the mean calculation is completely thrown off in blocks with masked pixels.

marthinwurer avatar Oct 19 '19 07:10 marthinwurer

Sorry @marthinwurer I have been busy so have not had time to look into this. If you can put some code to show the issue with the data you are using (or a subset of it) I may be able to look at it once I have some time. In the tests I had performed using the np.ma.sum or similar functions seemed to work correctly, but may have been just the use case I had. It would be good to ensure this is properly treated.

ozak avatar Oct 29 '19 13:10 ozak