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.
%matplotlib inline
from cloudremoval import download_from_eurac_rasdaman
from datetime import datetime
import rasterio
# 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")
# open the downloaded file
src = rasterio.open(file)
# print some information
src.meta
# and plot examplarily
from rasterio.plot import show
show(src)
# 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)
# 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)