Skip to content

Command line

monitoreo-ugr edited this page Nov 5, 2026 · 1 revision

Versión en español

Command line

The Python package installs the monitoreo command, which does the same as the functions of the Python package from the terminal: useful for shell scripts, scheduled tasks or a quick look without opening Python. Installation: Getting started.

Without a project, it computes with the shared account of MonitorEO. To use your Earth Engine account (and export to Google Drive), give your project with --project (before the command) or with the environment variable EE_PROJECT:

export EE_PROJECT=my-ee-project             # on Windows: set EE_PROJECT=my-ee-project
monitoreo --help                            # available commands
monitoreo series --help                     # options of a command

Regions are written as JSON between single quotes (see Concepts): '{"wdpa_id": 389012}', '{"bbox": [-6.6, 36.8, -6.2, 37.2]}', '{"file": "zonas.gpkg", "name_field": "nombre"}'.

Find variables and areas

monitoreo list --sensor Landsat
ref  variable  sensor   collection  resolution_m  unit        name
3    LSWI      Landsat  LANDSAT     30            [unitless]  Land Surface Water Index
5    NDSI      Landsat  LANDSAT     30            [unitless]  Normalized Difference Snow Index
9    NDWI      Landsat  LANDSAT     30            [unitless]  Normalized Difference Water Index
...
monitoreo info NDSI --sensor Sentinel-2      # formula, collection, scale, filters, notes (JSON)
monitoreo parks "Doñana" --limit 4
SITE_ID    NAME                  DESIG                                           ISO3  REP_AREA
555588792  Doñana                Zona de Importancia Comunitaria ZIC (ZEPA/ZEC)  ESP   1139
555595662  Doñana Norte y Oeste  Zona de Importancia Comunitaria ZIC (ZEPA/ZEC)  ESP   185.9
389012     Doñana                Parque Nacional                                 ESP   534.2
349268     Doñana                Parque Natural                                  ESP   682.4

Time series

The monthly MODIS NDVI in the Doñana National Park in 2023:

monitoreo series NDVI --sensor Modis --region '{"wdpa_id": 389012}' --start 2023-01-01 --end 2023-12-31 \
    --step monthly --csv ndvi_donana.csv --png ndvi_donana.png
region  date        value   n_pixels  n_images
Doñana  2023-01-01  0.508   4082      2
Doñana  2023-02-01  0.4685  4024      2
...
Doñana  2023-10-01  0.3484  3514      1
Doñana  2023-11-01  0.3828  4094      2
Doñana  2023-12-01  0.4757  4171      2

NDVI Modis | 2023-01-01 / 2023-12-31 | monthly mean, spatial mean | scale 250 m | unit [unitless] | CSV ndvi_donana.csv | chart ndvi_donana.png

Options: --step (daily, 16-day, monthly, annual), --metric (in time: mean, median, max, p95...), --stat (over the region), --scale (pixel in metres), --csv and --png.

Map as GeoTIFF

The median of the Sentinel-2 NDVI of summer 2023 in a circle of 1.5 km radius in Sierra Nevada, at the resolution of the data (10 m):

monitoreo image NDVI --sensor Sentinel-2 --region '{"point": [-3.42, 37.13], "buffer": 1500}' \
    --start 2023-06-01 --end 2023-08-31 --out ndvi_summer.tif
ndvi_summer.tif: NDVI Sentinel-2 | 2023-06-01 / 2023-08-31 (median) | 300 x 301 pixels of 10 m | 19 images | p5-p95 0.2322 to 0.8115 [unitless]

Options: --metric (median by default), --temporal and --interannual (the metric of each year and then across years, see Concepts), --resolution (pixel in metres) and --out. It is download_image of the Python package: for small regions; large ones are better exported to Google Drive.

Trends and comparison of periods

The trend of the annual mean land surface temperature of Doñana from 2005 to 2024:

monitoreo trend LST --sensor Modis --region '{"wdpa_id": 389012}' --start 2005-01-01 --end 2024-12-31
region  key  label  n   tau      z       p_value  significant  slope   intercept
Doñana  all  year   20  0.06316  0.3893  0.697    False        0.0252  32.92

LST Modis | 2005-01-01 / 2024-12-31 | trends of the annual mean, spatial mean | scale 1000 m | slope in [ºC] / year

+0.025 ºC per year, but not significant (p = 0.70). By month, with a chart:

monitoreo trend NDVI --sensor Modis --region '{"wdpa_id": 389011}' --start 2005-01-01 --end 2024-12-31 \
    --step monthly --csv trends.csv --png trends.png

Compare 2020-2024 with 2005-2009, month by month:

monitoreo compare NDVI --sensor Modis --region '{"wdpa_id": 389011}' --start 2005-01-01 --end 2009-12-31 \
    --other-start 2020-01-01 --other-end 2024-12-31 --step monthly --csv comparison.csv --png comparison.png

Download variables with a recipe

With a YAML recipe (see Python package) and the study area, as a vector file or as a region:

monitoreo download recipe.yaml --area area.gpkg --out variables --dry-run     # only the plan
monitoreo download recipe.yaml --area area.gpkg --out variables               # download
monitoreo download recipe.yaml --area '{"wdpa_id": 389011}' --out variables --only study

Options: --layer (layer of the file), --only study|ecoregion, --overwrite, --drive (everything via Google Drive), --drive-dir (local folder of Google Drive), --no-wait (do not wait for the exports: they are imported when the command is repeated), --tile and --workers.

Other commands

monitoreo eecu                  # your Earth Engine EECUs of this month (research EECUs with the shared account)
monitoreo --project my-ee-project eecu --limit Contributor   # those of your project, of tier Contributor
monitoreo about                 # description and acknowledgements
monitoreo mcp                   # MCP server (see the MCP server page)
monitoreo assistant             # assistant for managers, in its own window (see the Assistant page)
monitoreo --version

monitoreo eecu draws a bar with the part of your EECUs of the month spent (with the shared account, your research EECUs; see Concepts); the commands that compute warn you when they finish if less than 10 % is left.

Clone this wiki locally