English | Deutsch
How a download works¶
The satellites do not send you files; they send the Copernicus Data Space petabytes of images. You would not want to download all of them just to look at one city. CDEC therefore uses openEO, a standard way to ask a server to do the work.
Describe, do not download¶
A download_* function does not fetch images. It writes down a recipe for the server, as a data cube: a
block of data with the dimensions x, y, time and band. The recipe of the NDVI reads like this:
Load the red and near-infrared bands (and the scene classification) of your area and period.
Mask the pixels that you do not want, such as clouds.
Average over time, so that one value per pixel is left.
Calculate the index from the averages.
Download the result as a GeoTIFF.
Only the final result, a few megabytes, travels to your computer. Every module of the package
(src/cdec/eo/) is this recipe for one data type; Why the package looks like this says why the recipe is not hidden in a
function that all modules share.
Why one image per period¶
The result has no time dimension: it is the mean of the period. A single satellite image is always incomplete, because clouds hide parts of it, and the mean of the usable observations is the simplest way to a complete, calm picture. The index is calculated from the mean reflectance, not as the mean of daily indices. If you need to see change, download two periods and compare them.
The login¶
The Copernicus Data Space asks you to log in. The first time, the package shows a code and a web address; you confirm the code in your browser. The openEO client stores a token on your computer, so later calls log in without a question. Every download function connects and logs in again; this is cheap once the token exists.
The file¶
The function first writes the download into a hidden temporary folder next to the target. Then it applies the
colour enhancement if you asked for one, converts the file to a Cloud Optimized GeoTIFF, and only then moves it
to the name you gave. If something fails on the way, the target file is untouched
(Control the output file). At the end the function returns the path of the finished file. What is in the file
is described in the docstring of the function (help(download_ndvi)) and on the page of the data type.
Where to read on¶
Clouds and masking explains the masking step, Colours and values what happens to the colours, and Grids and time what the grid of the result is.