Beispiel #1
0
    def map(self, collection, **kwargs):
        """ Map the mask function over a collection

        :param collection: the ImageCollection
        :type collection: ee.ImageCollection
        :param renamed: whether the collection is renamed or not
        :type renamed: bool
        :param col: the EE Collection
        :type col: geetools.collection.Collection
        :return: the ImageCollection with all images masked
        :rtype: ee.ImageCollection
        """
        col = kwargs.get('col')
        renamed = kwargs.get('renamed', False)

        bands = []
        for band in [
                'aerosol', 'blue', 'green', 'red_edge_1', 'red_edge_2',
                'red_edge_3', 'red_edge_4', 'water_vapor', 'cirrus', 'swir'
        ]:
            if renamed:
                bands.append(band)
            else:
                bands.append(col.get_band(band, 'name').id)

        if 'hollstein' in col.algorithms:
            f = lambda img: cloud_mask.applyHollstein(img, self.options, *bands
                                                      )
            return collection.map(f)
        else:
            return lambda img: img
Beispiel #2
0
def test_snow():
    masked = cloud_mask.applyHollstein(image, ['snow'])
    vals = getValue(masked, p_snow, 30)

    assert vals.get("B1").getInfo() == None
Beispiel #3
0
def test_cirrus():
    masked = cloud_mask.applyHollstein(image, ['cirrus'])
    vals = getValue(masked, p_cirrus, 30)

    assert vals.get("B1").getInfo() == None