This example requires the cloudremoval package, which can be found at https://gitlab.inf.unibz.it/earth_observation_public/modis_snow_cloud_removal See the link for instructions, how to install the package.

In [1]:
%matplotlib inline
from cloudremoval import download_from_eurac_rasdaman
from datetime import datetime
import rasterio
In [2]:
# the default will download Eurac's Snow maps for the whole extent for a given day
# let's take the map from February 28, 2019, as in the paper
date=datetime(2019, 2, 28)
file="modis_snow_20190228"
download_from_eurac_rasdaman(date=date, file=file, coverage="EURAC_SNOW_MODIS_ALPS_LAEA")
Out[2]:
'modis_snow_20190228'
In [3]:
# open the downloaded file
src = rasterio.open(file)
In [4]:
# print some information
src.meta
Out[4]:
{'driver': 'GTiff',
 'dtype': 'uint8',
 'nodata': None,
 'width': 4901,
 'height': 2867,
 'count': 1,
 'crs': CRS.from_epsg(3035),
 'transform': Affine(231.6563582615793, 0.0, 3847097.79599,
        0.0, -231.6563582629999, 2872447.74497)}
In [5]:
# and plot examplarily
from rasterio.plot import show
show(src)
Out[5]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fee1b849198>
In [6]:
# now try the cloudremoval map
# needs as workaround to supply a None band, because of Rasdaman issues with single band coverages
file_cloudremoval="modis_snow_cloudremoval_20190228"
download_from_eurac_rasdaman(date=date, 
                             file=file_cloudremoval, 
                             coverage="EURAC_SNOW_CLOUDREMOVAL_MODIS_ALPS_LAEA", 
                             band=None)
src_cloudremoval = rasterio.open(file_cloudremoval)
show(src_cloudremoval)
Out[6]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fee191829b0>
In [7]:
# we can also specifiy only a subset to download by using the xlim and ylim arguments
file_cloudremoval_sub="modis_snow_cloudremoval_sub_20190228"
download_from_eurac_rasdaman(date=date, 
                             file=file_cloudremoval_sub, 
                             coverage="EURAC_SNOW_CLOUDREMOVAL_MODIS_ALPS_LAEA", 
                             band=None,
                             xlim=(4.2e6, 4.6e6),
                             ylim=(2.5e6, 2.7e6))
src_cloudremoval_sub = rasterio.open(file_cloudremoval_sub)
show(src_cloudremoval_sub)
Out[7]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fee1913fb70>