How to use the hydrafloods.downscale.bathtub 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
handErr = hand.add(ee.Image.random(i).subtract(0.5).multiply(6)
                .multiply(elvStdDev))
            return downscale.bathtub(inImage,handErr,permanent)


        inImage = self.collection.mean().divide(10000)
        if probablistic:
            iters = ee.List.sequence(0,nIters-1)

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

        else:
            mapResult = downscale.bathtub(inImage,hand,permanent)

        return mapResult
github Servir-Mekong / hydra-floods / hydrafloods / processing.py View on Github external
def _downscaleWrapper(iteration):
            i = ee.Number(iteration)
            handErr = hand.add(ee.Image.random(i).subtract(0.5).multiply(6)
                .multiply(elvStdDev))
            return downscale.bathtub(inImage,handErr,permanent)