How to use the hydrafloods.utils.decode_date 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 / hfcli.py View on Github external
def process(self,product, date,skipPreprocessing=False):
        try:
            ee.Initialize()
        except EEException as e:
            print(e)

        self._parse_config()

        if product in ['sentinel1','atms','viirs','modis']:
            dt = utils.decode_date(date)
            tomorrow = (dt + datetime.timedelta(1)).strftime('%Y-%m-%d')

            dateDir = os.path.join(self.workdir,dt.strftime('%Y%m%d'))
            prodDir = os.path.join(dateDir,product)

            geom = ee.Geometry.Rectangle(list(self.region.bounds.values[0]))

            hand = ee.Image(self.hand)

            if product == 'atms':
                params = self.atmsParams
                paramKeys = list(params.keys())

                collId = self.atmsParams['waterFractionAsset']
                worker = Atms(geom,date,tomorrow,collectionid=collId)
github Servir-Mekong / hydra-floods / hydrafloods / hfcli.py View on Github external
def process(self,product, date,skipPreprocessing=False):
        if product in ['sentinel1','atms','viirs']:
            dt = utils.decode_date(date)
            tomorrow = (dt + datetime.timedelta(1)).strftime('%Y-%m-%d')

            dateDir = os.path.join(self.workdir,dt.strftime('%Y%m%d'))
            prodDir = os.path.join(dateDir,product)

            geom = ee.Geometry.Rectangle(list(self.region.bounds.values[0]))

            hand = ee.Image(self.hand)

            if product == 'atms':
                params = self.atmsParams
                paramKeys = list(params.keys())

                collId = self.atmsParams['waterFractionAsset']
                worker = Atms(geom,date,tomorrow,collectionid=collId)