How to use the hydrafloods.geeutils.globalOtsu function in hydrafloods

To help you get started, we’ve selected a few hydrafloods examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Servir-Mekong / hydra-floods / hydrafloods / processing.py View on Github external
i = ee.Number(iteration)
            sim = geeutils.globalOtsu(self.downscaled,target_date,self.region,seed=i,**kwargs)
            return sim.And(hand.lt(30))

        tDate = ee.Date(target_date)

        if probablistic:
            iters = ee.List.sequence(0,nIters-1)

            sims = ee.ImageCollection(iters.map(_threholdWrapper))
            probs = sims.sum().divide(nIters).rename(['probability'])
            water = probs.select(['probability']).gt(probTreshold).rename('water')
            mapResult = water.addBands(probs.multiply(10000).uint16())

        else:
            mapResult = geeutils.globalOtsu(self.downscaled,target_date,self.region,**kwargs)\
                .And(hand.lt(30))

        return mapResult
github Servir-Mekong / hydra-floods / hydrafloods / collection.py View on Github external
self.downscaled, target_date, self.region, seed=i, **kwargs)
            return sim.And(hand.lt(30))

        tDate = ee.Date(target_date)

        if probablistic:
            iters = ee.List.sequence(0, nIters - 1)

            sims = ee.ImageCollection(iters.map(_threholdWrapper))
            probs = sims.sum().divide(nIters).rename(['probability'])
            water = probs.select(['probability']).gt(
                probTreshold).rename('water')
            mapResult = water.addBands(probs.multiply(10000).uint16())

        else:
            mapResult = geeutils.globalOtsu(self.downscaled, target_date, self.region, **kwargs)\
                .And(hand.lt(30))

        return mapResult
github Servir-Mekong / hydra-floods / hydrafloods / collection.py View on Github external
def _threholdWrapper(iteration):
            i = ee.Number(iteration)
            sim = geeutils.globalOtsu(
                self.downscaled, target_date, self.region, seed=i, **kwargs)
            return sim.And(hand.lt(30))
github Servir-Mekong / hydra-floods / hydrafloods / processing.py View on Github external
def _threholdWrapper(iteration):
            i = ee.Number(iteration)
            sim = geeutils.globalOtsu(self.downscaled,target_date,self.region,seed=i,**kwargs)
            return sim.And(hand.lt(30))