1

I'm using geemap package to refactor a code from JavaScript to Python and I couldn't find a way to replicate these two lines

var swbdMask = swbd.unmask().not().focal_median(1)
var hmask = hand30_100.gt(20).focal_max(10).not()

My issue is with the not(). Both swbdMask and hmask are ee.Image objects. I tried using not but it changes the object type into boolean which is clearly not what I want. Is there a way to do it in Python?

Kevin Reid
  • 37,492
  • 13
  • 80
  • 108
salRad
  • 320
  • 1
  • 8
  • 21
  • Reading the docs https://developers.google.com/earth-engine/apidocs/ee-image-not#javascript it says that either a 0 or 1 will be returned. Which from my understanding is basically the same as a boolean. I didnt use the package before so this is just a shot in the dark. – Aaron Sep 23 '20 at 04:59
  • Yes, but at the same time it states that the returned object is an Image. I think it does it pixel wise in this case, I guess. At least this is how I understood it – salRad Sep 23 '20 at 05:05

0 Answers0