Carrot Rust Fly (Psila rosae) temperature model - spatial version
The warning system model «Carrot rust fly temperature» is based on a Finnish temperature-based model (Markkula et al, 1998; Tiilikkala & Ojanen, 1999; Markkula et al, 2000). The model determines the start of the flight period for the 1st and 2nd generation of carrot rust fly based on accumuleted degree-days (day-degrees) over a base temperature of 5,0 °C. VIPS uses the model for the 1st generation only.
Standard air temperature (temperature measured 2 m above ground) is used in the model. Degree-days are defined for this model as the sum of the difference between a base temperature of 5,0 °C and the mean temperature for all days with a temperature >5,0 °C, in other words (daily mean temperature – 5,0 °C) from 1 March (beginning when the ground has thawed).
Interpretation of the warning
Green rectangles indicate that the flight period has not yet begun. The accumulated day-degrees are < 260 degree-days (day-degrees).
Yellow rectangles indicate that the flight period is beginning and that flies can be coming into the field. The accumulated day-degrees are ≥ 260 degree-days (day-degrees).
Red rectangles indicate peak flight period. The accumulated day-degrees are ≥ 360 degree-days (day-degrees).
Grey rectangles indicate that the flight period of the 1st generation is over. The accumulated day-degrees are ≥ 560 degree-days (day-degrees).
Be aware that in areas with field covers (plastic, single or double non-woven covers, etc.) with early crops the preceding season (either on the current field or neighboring fields), the flight period can start earlier due to higher soil temperature under the covers.
The graphic presentation shows the progress of the day-degree calculation that is the basis for the green, yellow and red warnings (the line: «Accumulated day-degrees with the base temperature of 5 degrees C»). The graph show straight horizontal lines for the threshold values. «Day-degree threshold for low likelihood of attack» corresponds to when the warning changes from green to yellow (260 day-degrees). «Day-degree threshold for high likelihood of attack » corresponds to when the warning changes from yellow to red (360 day-degrees). «Day-degree threshold for end of flight period» corresponds to when the warning changes from red to grey (560 day-degrees) and the flight period for the 1st generation is considered to be over. When the line « Accumulated day-degrees with the base temperature of 5 degrees C» intersects one of the lines for the day-degree threshold, the warning will advance to the next level and the color of the warning rectangle will change. The graph also shows the daily mean temperature for the relevant weather station. The graph is dynamic and the user can choose which parameters that are shown by clicking on the explanation below the graph.
Warning season – start and end of the warning
Starting time: Shown in VIPS from 1 April (starting date for accumulation of degree-days beginning from when the ground has thawed).
Ending time: When the model has reached the requirement for the end of the flight period for the 1st generation (560 day-degrees).
Testing and validation of the model
National
The model has been tested for Norwegian conditions in the period of 2011-2015. Validation has shown that the model was accurate for most locations for the 1st generation. The model was, however, inaccurate for the 2nd generation for many locations and was totally incorrect for the district of Jæren. Based on the validation results, we have therefore chosen to remove warning of the 2nd generation of carrot rust fly from this model.
International
The model is in use in Finland. The extent to which the model has been validated in Finland is uncertain, but a validation was done in the summer of 1997. This validation showed that the model was quite accurate, but that the threshold temperature sm should be lowered to 255 day-degrees for the start of the flight period (as opposed to 260 degree-days in the original model) and 355 degree-days forthe peak flight period (as opposed to 360 degree-days in the original model) (Tiilikkala & Ojanen, 1999).
Literature
Markkula, I., H. Ojanen and K. Tiilikkala. 1998. Forecasting and monitoring of the carrot fly (Psila rosae) in Finland. The 1998 Brighton Conference: Pests and Diseases: Conference Proceedings, Volume 2, pages 657-662.
Tiilikkala, K. and H. Ojanen. 1999. Use of a geographical information system (GIS) for forecasting the activities of carrot fly and cabbage root fly. IOBC/WPRS Bulletin 22 (5): 15-24.
Markkula, I., A. Hannukkala, A. Lehtinen, I. Mattila, H. Ojanen, S. Raisjio, P. Reijonen and K. Tiilikkala. 2000. Pest warnings and forecasts sent as SMS messages from models into \"farmer's pocket\". In publication: Pests & Diseases 2000. Proceedings of an international conference held at the Brighton Hilton Metropole Hotel, UK, 13-16 November 2000. BCPC Conference Proceedings pages 285-290.
Contacts
Annette Folkedal Schjøll annette.folkedal.schjoll@nibio.no
Tor J. Johansen tor.johansen@nibio.no
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_PSILARTEMP.sh
(see below).
Input data requirements
The model (as per 2023-11-14) assumes that a weather data file named met_1_0km_nordic-2023.nc
is available in the in/
folder. The file must contain daily timesteps of average temperature (TM
)
Running the model
It is required that you have set the following environment variables:
# Where your application resides
HOME_DIR=/home/foo/PSILARTEMP/
# Path to the weather data
WEATHER_DATA_DIR=in/
# 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/PSILARTEMP/
# Where your generated MAPFILE and query templates should be placed
MAPSERVER_MAPFILE_DIR=/foo/mapserver/wms/PSILARTEMP/
# Where mapserver logs for this WMS are written
MAPSERVER_LOG_FILE=/foo/log/PSILARTEMP.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"
$ ./run_PSILARTEMP.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_PSILARTEMP.sh 2024
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 Carrot Rust Fly- 0 = No infection risk (grey)
- 2 = No infection risk (green)
- 3 = Medium infection risk (yellow)
- 4 = High risk (red)
-
result_[YYYY-MM-DD].tif
, which contains the accumulated day degrees (DD
) - which is the sum of daily average temperatures with a base temperature of 5 °C
A Jinja2 template mapfile (for Mapserver) with separate layers (WARNING_STATUS and WHS) for each date is found in the mapfile/
folder.
Multi language support
Mapserver supports the &language=[language code] query parameter. Read more about the specifics here. Through this, we have been able to add language specific titles and abstracts. See an example below
MAP
[...]
WEB
METADATA
[...]
"wms_inspire_capabilities" "embed"
"wms_title.en" "Carrot rust fly (Psila rosae) temperature model"
"wms_title.nb" "Gulrotflue svermetidspunktmodell"
END
END
END
Hacking i18n of mapserver generated legends
The auto generated legends from these mapserver sections do not support internationalization:
CLASS
NAME "Model not running"
EXPRESSION ([pixel] >= 0 AND [pixel] < 2)
STYLE
COLOR 112 112 112
END
END
CLASS
NAME "No infection risk"
EXPRESSION ([pixel] >= 2 AND [pixel] < 3)
STYLE
COLOR 0 180 87
END
END
CLASS
NAME "Possible infection risk"
EXPRESSION ([pixel] >= 3 AND [pixel] < 4)
STYLE
COLOR 255 204 0
END
END
CLASS
NAME "High infection risk"
EXPRESSION ([pixel] >= 4)
STYLE
COLOR 255 0 0
END
END
We have hacked this by using the "wms_abstract"
metadata option for each layer. For example:
LAYER
NAME "PSILARTEMP.WARNING_STATUS.2023-04-01"
[...]
METADATA
"wms_abstract.en" "
<ul style=\"list-style: none; padding: 0;\">
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #707070;\"> </span> No forecast</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #00B457;\"> </span> No risk</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #FFCC00;\"> </span> Possible risk</li>
<li><span style=\"background-color: #FF0000;\"> </span> High risk</li>
</ul>
"
"wms_abstract.nb" "
<ul style=\"list-style: none; padding: 0;\">
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #707070;\"> </span> Varsel beregnes ikke</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #00B457;\"> </span> Ingen infeksjonsrisikok</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #FFCC00;\"> </span> Mulig fare for angrep</li>
<li><span style=\"background-color: #FF0000;\"> </span> Høy fare for angrep</li>
</ul>
"
END
END
The client must then check if the layer abstract exists in the requested language. If not, default to the auto generated legend. For example like this (using OpenLayers):
// See if there is a language specific legend available
if(currentLayer.Abstract != undefined)
{
document.getElementById("layerLegend").innerHTML=currentLayer.Abstract;
}
else // Fallback to auto generated legend
{
document.getElementById("layerLegend").innerHTML='<img id="layerLegendImg" src="' + currentLayer.Style[0].LegendURL[0].OnlineResource + '"/>';
}