Skip to content
Snippets Groups Projects

Naerstad Potato Blight Model - spatial version

The model is based on several years of experiments where trap plants have been placed next to a potato field infected with late blight. Infections on these plants have been correlated with weather conditions the day of exposure, and this is the data the model is based on. The model predicts if there are favorable conditions for spore production and the following spread, survival and infection of these spores. The model produces an infection risk, and a value of 2.5 corresponds to one spot of late blight on each trap plant exposed. This value of 2.5 is the threshold where the model issues a warning.

Technical description

Software requirements

The model can only be run on Linux, as some of the tools mentioned below are only available on Linux. The development and testing of the model has been done using Ubuntu Linux 22.04LTS.

CDO and GDAL

The heavy lifting in this model is done by the tools CDO and GDAL. These tools need to be installed and available. CDO is only available on Linux.

Python requirements

The Python requirements are specified in the requirements.txt file, and are included in the virtualenv created by the run_NAERSTADMO.sh (see below).

Input data requirements

The model assumes weather data files named met_1_0km_nordic-[YYYY-MM-DD].nc with hourly values of:

  • Temperature (TM)
  • Relative humidity (UM)
  • Precipitation (RR)
  • Wind speed (FF)
  • Global radiation (Q0)

Running the model

It is required that you have set the following environment variables:

# Path to this code
HOME_DIR=/foobar/gridmodels/NAERSTADMO/
# Path to the weather data files. Expecting hourly values in files named met_1_0km_nordic-[YYYY-MM-DD].nc
WEATHER_DATA_DIR=/foobar/met_1_0km_nordic/2024/
# Start date for the model (MM-DD)
RECURRING_START_DATE=05-15
# Local time zone
LOCAL_TIMEZONE=Europe/Oslo
# Use this file to crop the output of the grid
MASK_FILE=Norge_landomrader.csv
# Where the GeoTIFF files will be output
DATA_DIR=/foobar/mapserver/data/NAERSTADMO/
# Where the mapfile will be output
MAPFILE_DIR=/foobar/mapserver/wms/NAERSTADMO/
# Path to the GeoTIFF files used by mapserver (written to mapfile)
MAPSERVER_DATA_DIR=/foobar2/mapserver/data/NAERSTADMO/
# Path to the mapfile used by mapserver (written to mapfile)
MAPSERVER_MAPFILE_DIR=/foobar2/mapserver/wms/NAERSTADMO/
# Path to the mapserver log file for this WMS (written to mapfile)
MAPSERVER_LOG_FILE=/foobar2/mapserver/log/NAERSTADMO.log
# Path for mapserver to store tmp images (written to mapfile)
MAPSERVER_IMAGE_PATH=/foobar2/mapserver/tmp/
# Extent of map  (written to mapfile)
MAPSERVER_EXTENT="-1.5831861262936526 52.4465003983706595 39.2608060398730458 71.7683216082912736"
# Whether or not to debug log. Default value is False
DEBUG=False

...this is the contents of the env-sample file

$ ./run_NAERSTADMO.sh

This creates a Python virtualenv, installs all the Python dependencies, runs the model and stores output in a log file.

The script can be run for a specific year like this:

$ ./run_NAERSTADMO.sh 2024

Viewing the result of the model

TODO Add more details

WARNING_STATUS example. Showing Norway and surrounding area