Pollen beetle migration model - spatial version
This model is based on the work of Ferguson et al., (2015) to predict migration risk of the Pollen Beetle. The default value of 15 degrees celsius is used to predict migration risk, as that is the temperature advised in the UK at which pollen beetles will fly Threshold however can also be overwritten by the user. The model can only be used between growth stage 51 and 59. (From the file MELIAEController.cs)
Input data for opprinnelig modell:
DSSInput_Parameters
- weatherData weatherData (required)
- int growthStage (required)
- optionalData optionalData
weatherData
- string timeStart
- string timeEnd
- int Interval
- List weatherParameters
- List LocationWeatherData z
locationWeatherData
- double longitude
- double latitude
- double altitude
- List amalgamation
- List<List<double?>> data
- int width
- List qc
- int length
optionalData
- double temp_threshold
- DateTime? startDate
- DateTime? endDate
Se MELIAEController.cs for oppstart av applikasjonen Se MELIAE_DSS.cs for kjøring av modellen
Technical description
The model has been implemented by Tor-Einar Skog, NIBIO. It is designed to fit into the gridded pest prediction models of VIPS.
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 requirements.txt
file, and are included in the virtualenv created by the run_ADASMELIAE.sh
(see below).
Input data requirements
The model (as per 2023-10-25) assumes that weather data files named met_1_0km_nordic-[YYYY-MM-DD].nc
are available in the in/
folder. The files must contain hourly timesteps with the following weather parameters:
- RR (Rainfall in mm)
- UM (Relative humidity in %)
Running the model
It is required that you have set the following environment variables:
# This is used to auto generate some variables and file names
MODEL_ID="ADASMELIAE"
# Where your application resides
HOME_DIR=/home/foo/2023_vips_in_space/
# Path to the weather data
WEATHER_DATA_DIR=in/
# Used for iterating the weather data files
FILENAME_PATTERN="met_1_0km_nordic-*.nc"
# Used to extract date info from the filename
FILENAME_DATEFORMAT="met_1_0km_nordic-%Y-%m-%d.nc"
# Names of weather parameters in NetCDF files
# Hourly precipitation
RR="RR"
# Relative humidity (2m)
UM="UM"
# Timezone for weather data/daily aggregations
LOCAL_TIMEZONE="Europe/Oslo"
# Path to optional CSV file with polygons for masking result.
MASK_FILE=Norge_landomrader.csv
# Path to the output (GeoTIFF) files as seen from the running model code
DATA_DIR=out/
# Path to the generated mapfile as seen from the running model code
MAPFILE_DIR=mapfile/
# The path to the output (GeoTIFF files) as seen from Mapserver
MAPSERVER_DATA_DIR=/foo/mapserver/data/ADASMELIAE/
# Where your generated MAPFILE and query templates should be placed
MAPSERVER_MAPFILE_DIR=/foo/mapserver/wms/ADASMELIAE/
# Where mapserver logs for this WMS are written
MAPSERVER_LOG_FILE=/foo/mapserver/log/ADASMELIAE.log
# Path to the temporary directory for writing temporary files and images. Must be writable by the user the web server is running as
MAPSERVER_IMAGE_PATH=/foo/mapserver/tmp/
# The value of the EXTENT parameter in Mapserver's mapfile. Units are DD (Decimal degrees)
MAPSERVER_EXTENT="-1.5831861262936526 52.4465003983706595 39.2608060398730458 71.7683216082912736"
...this is the contents of the env-sample
file
$ ./run_ADASMELIAE.sh
This creates a Python virtualenv, installs all the Python dependencies, runs the model and stores output in a log file.
Alternatively, primarily for development purposes, you can run the Python script ADASMELIAE directly:
$ ./ADASMELIAE.py
All intermediary files are stored in the tmp/
folder, and they are all deleted when the model is done calculating. The GeoTIFF files are stored in the out/
folder, and the generated mapfile is stored in the mapfile/
folder
Viewing the result of the model
The model outputs GeoTIFF files, two per day in the season/period of calculation:
-
result_WARNING_STATUS_[YYYY-MM-DD].tif
, wich indicates infection risk of Septoria.- 0 = No infection risk (grey)
- 2 = Low infection risk (yellow)
- 3 = Medium infection risk (orange)
- 4 = High risk (red)
-
result_[YYYY-MM-DD].tif
, which contains the wet hour sum (WHS) - which is the sum of wet hours for "yesterday", "today" and "tomorrow", relative to the current file date.
A Jinja2 template mapfile (for Mapserver) with separate layers (WARNING_STATUS and WHS) for each date is found in the mapfile/
folder.
Examples of the two layers are shown below
WARNING_STATUS example. Showing Norway
WHS (Wet Hour Sum) example. Showing Norway