Title: Phenology Modelling of Thaumetopoea Processionea
Version: 1.1
Description: Methods to calculate and present 'PHENTHAUproc', an early warning and decision support system for hazard assessment and control of oak processionary moth (OPM) using local and spatial temperature data. It was created by Halbig et al. 2024 (<doi:10.1016/j.foreco.2023.121525>) at FVA (https://www.fva-bw.de/en/homepage/) Forest Research Institute Baden-Wuerttemberg, Germany and at BOKU - University of Natural Ressources and Life Sciences, Vienna, Austria.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.3.1
Depends: R (≥ 3.5)
Imports: grDevices, lubridate (≥ 1.9), methods, rlang, stats, terra (≥ 1.7), utils
Suggests: dplyr, ggplot2 (≥ 3.4), knitr, rmarkdown, testthat (≥ 3.0.0), tidyterra (≥ 0.4.0)
Config/testthat/edition: 3
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2024-06-12 12:51:36 UTC; Lorenz.Bachfischer
Author: Lorenz Bachfischer [aut, cre], Department of Forest Protection, FVA [fnd]
Maintainer: Lorenz Bachfischer <lorenz.bachfischer@posteo.de>
Repository: CRAN
Date/Publication: 2024-06-12 14:00:02 UTC

Regional budswelling data

Description

A netCDF containing the DOY (day of year) for budswelling in the year 2023 provided by the Agricultural meteorology Department of the DWD.

Format

netCDF

Details

The dataset can be loaded using load_test("budswelling").

Spatial resolution: 1 km x 1 km Projection: DHDN / 3-degree Gauss-Kruger zone 3 (EPSG:31467) Parameter: DOY for first day of budswelling


Calculate degree days using the single sine method of Baskerville

Description

The function is vectorized. To use it with SpatRaster data see ?terra::lapp

More Information about the Method itself: Baskerville, G.L. and P. Emin. 1969. Rapid estimation of heat accumulation from maximum and minimum temperature. Ecology 50:514-517.

Usage

calc_baskerville(tmin, tmax, ldt)

Arguments

tmin

min temperature - numeric

tmax

max temperature - numeric

ldt

lower development threshold aka base temperature - numeric

Value

Degree days calculated by using the single sine method of Baskerville.

See Also

Other Temperature sum methods: calc_tsum()


Calculate degree days

Description

Calculate degree days

Usage

calc_degreedays(x, ts_start, ts_end, ldt, method)

Arguments

x

SpatRaster list (tmean, tmax, tmin) - numeric - with time attribute

ts_start

start of timeseries - Date

ts_end

end of timeseries - Date

ldt

lower development threshold - numeric

method

name of degreedays/temperature sum method - character - either "baskerville" or "tsum"

Value

SpatRaster of growing (summed up) degree days.

See Also

Other Models: calc_mortality(), calc_phenology(), calc_sumefftemp()


Calculate first TRUE

Description

Takes multiple logical SpatRasters with time attribute and returns SpatRaster with common time and TRUE if any SpatRaster is TRUE.

Usage

calc_first(...)

Arguments

...

SpatRasters/SpatRaster list - logical - with time attribute

Value

SpatRaster - logical - with time attribute

See Also

Other Calculation: calc_last(), calc_mean()


Calculate last TRUE

Description

Takes multiple logical SpatRasters with time attribute and returns SpatRaster with time serial number of last TRUE layer time.

Usage

calc_last(x)

Arguments

x

SpatRaster - logical - with time attribute

Value

SpatRaster with time serial number (origin = lubridate::origin) of last TRUE layer.

See Also

Other Calculation: calc_first(), calc_mean()


Calculate mean TRUE

Description

Takes multiple logical SpatRasters with time attribute and returns SpatRaster with the mean time serial number of first and last TRUE value.

Usage

calc_mean(x)

Arguments

x

SpatRaster list - logical - with time attribute

Value

SpatRaster - logical - with time attribute

See Also

Other Calculation: calc_first(), calc_last()


Calculate mortality

Description

Calculate mortality

Usage

calc_mortality(x, budswelling, hatch, mot = 0)

Arguments

x

SpatRaster list / dataframe with temperature data and time attribute/column

budswelling

SpatRaster - logical - T/F budswelling/no_budswelling

hatch

SpatRaster - logical - T/F hatch/no_hatch

mot

mortality threshold - numeric - is used as lower development threshold calculating degree days

Value

SpatRaster of starving related mortality in %.

See Also

Other Models: calc_degreedays(), calc_phenology(), calc_sumefftemp()


Calculate phenological models

Description

This function is checking the dependencies of the model and dependent on them:

1 Calculate the needed sum of effective (SET) temperatures for the phenological event to happen 2 Calculate the summed degree days (depending on hatch or not) 3 Check if the summed degree days have reached the needed sum of effective temperatures

Usage

calc_phenology(x, params)

Arguments

x

SpatRaster list - with tmean, tmin, tmax and time attribute

params

parameter list

Value

SpatRaster - logical - with event occurred/not TRUE/FALSE

See Also

Other Models: calc_degreedays(), calc_mortality(), calc_sumefftemp()


Calculate sum of effective temperatures (SET)

Description

Calculate sum of effective temperatures (SET)

Usage

calc_sumefftemp(x, cf_temp, cf_start, cf_end, cf_limit, set, a, b)

Arguments

x

SpatRaster list (tmean, tmax, tmin) - numeric - with time attribute

cf_temp
  • character - "tmean" for cold days and "tmin" for frost days

cf_start
  • Date - start of cold/frost timeseries

cf_end
  • Date - end of cold/frost timeseries

cf_limit
  • numeric - threshold under which a day is defined as cold/frost day

set
  • function - x is cold/frost days, a and b are parameter i.e. function (x, a, b) a + b*x

a
  • numeric - parameter for set function

b
  • numeric - parameter for set function

Value

SpatRaster with sum of effective temperatures.

See Also

Other Models: calc_degreedays(), calc_mortality(), calc_phenology()


Calculate temperature sum

Description

The function is vectorized. To use it with SpatRaster-Data see ?terra::lapp.

Usage

calc_tsum(tmean, ldt)

Arguments

tmean

numeric - mean temperature

ldt

numeric - lower development threshold aka base temperature.

Value

The temperature sum over the lower development threshold.

See Also

Other Temperature sum methods: calc_baskerville()


Call a function from PHENTHAUproc package

Description

calls a function from PHENTHAUproc package

Usage

call_function(f, data, params)

Arguments

f

function

data

SpatRaster list (tmean, tmax, tmin) - numeric - with time attribute

params

parameter list

See Also

Other Helper: check_data_with_params(), check_dimension_and_time(), convert_dwd_to_phenthau(), get_date(), get_formalArgs(), get_time(), load_test(), remove_false(), set_attributes(), subset_time(), timename()


Check data for model requirements

Description

Check data for model requirements

Usage

check_data_with_params(x, params)

Arguments

x

SpatRaster list - numeric - with time attribute

params

parameter list

Value

No return value, called for side effects.

See Also

Other Helper: call_function(), check_dimension_and_time(), convert_dwd_to_phenthau(), get_date(), get_formalArgs(), get_time(), load_test(), remove_false(), set_attributes(), subset_time(), timename()


Check dimension and time attribute of a SpatRaster list

Description

Check dimension and time attribute of a SpatRaster list

Usage

check_dimension_and_time(...)

Arguments

...

SpatRaster/SpatRaster list/data.frame/vector

Value

No return value, called for side effects.

See Also

Other Helper: call_function(), check_data_with_params(), convert_dwd_to_phenthau(), get_date(), get_formalArgs(), get_time(), load_test(), remove_false(), set_attributes(), subset_time(), timename()


Convert dataframe to SpatRaster list

Description

Internal function to create a SpatRaster list out of a dataframe.

By default the dataframe should have a date column called "date". The function is transferring each column into a list object and this object to a 1 col, 1 row nrow nlyr SpatRaster.

Usage

convert_df_to_srl(x, date_col = "date")

Arguments

x

dataframe (tmean, tmax, tmin, date)

date_col
  • character - name for date column which will be used to create time attribute of SpatRaster.

Value

SpatRaster list (tmean, tmax, tmin) - numeric - with time attribute

See Also

Other SpatRaster transformation: convert_doy_to_logical(), convert_hour_to_meanminmax(), convert_logical_to_doy(), convert_logical_to_time(), convert_sr_to_cvec()


Convert day of year (doy) to logical

Description

Convert day of year (doy) to logical

Usage

convert_doy_to_logical(x, from, to, by = "days")

Arguments

x

SpatRaster - numeric - value is day of year

from

Date - ymd - first day of time attribute

to

Date - ymd - last day of time attribute

by

character - either "days", "weeks" or "months". Reduces return to one day per day/week/month

Value

SpatRaster - logical - TRUE/FALSE before_doy/equal_after_doy

See Also

Other SpatRaster transformation: convert_df_to_srl(), convert_hour_to_meanminmax(), convert_logical_to_doy(), convert_logical_to_time(), convert_sr_to_cvec()


Convert hourly DWD temperature data to PHENTHAUproc input

Description

Convert hourly DWD temperature data to PHENTHAUproc input

Usage

convert_dwd_to_phenthau(x)

Arguments

x

filepath to unzipped DWD temperature data (text file)

Value

A dataframe with date, hour and mean air temperature (tmean).

See Also

Other Helper: call_function(), check_data_with_params(), check_dimension_and_time(), get_date(), get_formalArgs(), get_time(), load_test(), remove_false(), set_attributes(), subset_time(), timename()


Convert hourly to daily

Description

Convert hourly to daily

Usage

convert_hour_to_meanminmax(x)

Arguments

x

SpatRaster - numeric - hourly tmean with time attribute

Value

SpatRaster list (tmean, tmax, tmin) - numeric - with time attribute

See Also

Other SpatRaster transformation: convert_df_to_srl(), convert_doy_to_logical(), convert_logical_to_doy(), convert_logical_to_time(), convert_sr_to_cvec()


Convert logical to day of year (doy)

Description

Converts logical SpatRaster with time attribute and one layer per day to single layer with the day of the year (doy) where the layer is 1/TRUE first.

Usage

convert_logical_to_doy(x, from = NULL, to = NULL)

Arguments

x

SpatRaster - logical - with time attribute

from
  • Date - ymd - only if SpatRaster should be subset before being transformed.

to
  • Date - ymd - only if SpatRaster should be subset before being transformed.

Value

SpatRaster - numeric - day of year

See Also

Other SpatRaster transformation: convert_df_to_srl(), convert_doy_to_logical(), convert_hour_to_meanminmax(), convert_logical_to_time(), convert_sr_to_cvec()


Convert logical to time

Description

Converts logical SpatRasters to single layer SpatRaster with timeserialnumber as value for first TRUE

Usage

convert_logical_to_time(x)

Arguments

x

SpatRaster - logical - with time attribute

Value

SpatRaster - numeric

See Also

Other SpatRaster transformation: convert_df_to_srl(), convert_doy_to_logical(), convert_hour_to_meanminmax(), convert_logical_to_doy(), convert_sr_to_cvec()


Convert SpatRaster to characer vector

Description

Transform local PHENTHAUproc results back from SpatRaster to vector format

Usage

convert_sr_to_cvec(x)

Arguments

x

SpatRaster - numeric - value is timeserialnumber

Value

vector - Date as character

See Also

Other SpatRaster transformation: convert_df_to_srl(), convert_doy_to_logical(), convert_hour_to_meanminmax(), convert_logical_to_doy(), convert_logical_to_time()


Get Date format out of numeric year and monthday character value

Description

Get Date format out of numeric year and monthday character value

Usage

get_date(year, monthday, prevyear = FALSE)

Arguments

year

numeric year

monthday

character with month and day i.e. ("-02-01" or "Feb 01")

prevyear

if TRUE starts with previous year

See Also

Other Helper: call_function(), check_data_with_params(), check_dimension_and_time(), convert_dwd_to_phenthau(), get_formalArgs(), get_time(), load_test(), remove_false(), set_attributes(), subset_time(), timename()


Get formalArgs of a function from a list of parameter

Description

Get formalArgs of a function from a list of parameter

Usage

get_formalArgs(p, f)

Arguments

p

parameter list

f

function

See Also

Other Helper: call_function(), check_data_with_params(), check_dimension_and_time(), convert_dwd_to_phenthau(), get_date(), get_time(), load_test(), remove_false(), set_attributes(), subset_time(), timename()


Get legend for PHENTHAUproc models

Description

Get legend for PHENTHAUproc models

Usage

get_legend(x = "stages")

Arguments

x

legend name - character - Available legends: "stages", "mortality", "ppa_biocide"

Value

dataframe with ID, category and colors

See Also

Other Main: mortality(), parameter(), phenology(), phenthau()

Examples

# return legend for development stages
get_legend("stages")


Get time attribute

Description

Get time attribute

Usage

get_time(x)

Arguments

x

SpatRaster, data.frame, list of SpatRaster or SpatRasterDataset

Value

If x is a data.frame returns the time column, else it returns the time attribute of a SpatRaster or the shared time attribute of multiple SpatRaster.

See Also

Other Helper: call_function(), check_data_with_params(), check_dimension_and_time(), convert_dwd_to_phenthau(), get_date(), get_formalArgs(), load_test(), remove_false(), set_attributes(), subset_time(), timename()


Load test data

Description

Load test data

Usage

load_test(type = "SpatRaster")

Arguments

type

character, either day/hour/SpatRaster/SpatRaster_hour/budswelling

Value

data.frame/SpatRaster list with test data

See Also

Other Helper: call_function(), check_data_with_params(), check_dimension_and_time(), convert_dwd_to_phenthau(), get_date(), get_formalArgs(), get_time(), remove_false(), set_attributes(), subset_time(), timename()


load SpatRaster - budswelling - day of year - 16 Rasterpoints around FVA 2023

Description

load SpatRaster - budswelling - day of year - 16 Rasterpoints around FVA 2023

Usage

load_test_bs()

load dataframe - daily tmean tmin tmax - Freiburg 2020

Description

load dataframe - daily tmean tmin tmax - Freiburg 2020

Usage

load_test_day()

load dataframe - hourly tmean - Freiburg 2023

Description

load dataframe - hourly tmean - Freiburg 2023

Usage

load_test_hour()

load SpatRaster list - daily - 16 Rasterpoints around FVA 2020

Description

load SpatRaster list - daily - 16 Rasterpoints around FVA 2020

Usage

load_test_srl()

load SpatRaster - hourly - 16 Rasterpoints around FVA 2022 - 2023

Description

load SpatRaster - hourly - 16 Rasterpoints around FVA 2022 - 2023

Usage

load_test_srl_hour()

Local daily Weather Station data from Freiburg

Description

A dataset containing daily mean, max and min temperatures for Freiburg from 2019-09-01 to 2020-09-30. Downloaded from opendata.dwd.de and preprocessed.

Format

A data frame with 396 rows and 4 variables

Details

The dataset can be loaded using load_test("day").

Stations_id: 01443 Stationsname: Freiburg

The variables are as follows:

Source

https://opendata.dwd.de/climate_environment/CDC/observations_germany/climate/daily/kl/historical/


Local hourly Weather Station data from Freiburg

Description

A dataset containing hourly temperatures for Freiburg from 2019-09-01 to 2022-12-31. Downloaded from opendata.dwd.de and preprocessed.

Format

A data frame with 29232 rows and 3 variables

Details

The dataset can be loaded using load_test("hour").

Stations_id: 01443 Stationsname: Freiburg

The variables are as follows:

Source

https://opendata.dwd.de/climate_environment/CDC/observations_germany/climate/hourly/air_temperature/historical/


Calculating starvation related mortality of Thaumetopoea processionea

Description

Calculating the starvation-related mortality rate of L1 larvae, dependent on degree days from the first hatch to feeding start (bud swelling of the host tree Quercus robur). All already available parameter settings can be shown with parameter().

Usage

mortality(
  x,
  par_budswelling = "quercus_robur_clone256_type1",
  par_hatch = c("custers", "wagenhoff", "meurisse"),
  def_hatch = "first",
  last = TRUE
)

Arguments

x

SpatRaster list (tmean, tmax, tmin) - numeric - with time attribute

par_budswelling

character - parametrisation for bud swelling

par_hatch

character - parametrisation for hatch

def_hatch

definition of hatch - character - either "first" or "mean"

last

If TRUE returns only the result for the last day. last row/layer for data.frame/SpatRaster

Value

SpatRaster with mortality in %.

See Also

Other Main: get_legend(), parameter(), phenology(), phenthau()

Examples


srl <- load_test()
mortality(srl)


Create parameter list

Description

See all available models with parameter: parameter() model can be a single model or a model collection described in "Default settings". Return a data.frame with all model options: parameter()

Default Settings

The default parameter lists for different data input are: "dailymean": Regional PHENTHAUproc described in Halbig et al. 2024 for daily mean temperature data "hour": "Local PHENTHAUproc described in Halbig et al. 2024 for daily hourly temperature data "dailymeanminmax": PHENTHAUproc adapted to DWD Data for daily mean, min and max temperature data

Columns

model: model parametrisation: parametrisation method: method used to calculate effective temperatures ts_start: first day to calculate effective temperatures ts_end last day to calculate effective temperatures (Default 30. Sept) ts_prevyear: If True calculation of effective temperatures starts in previous year. (i.e. wagenhoff) ldt: lower development threshold cf_dependent: Is model cold/frost dependent cf_start: first day to calculate cold/frost days cf_end: last day to calculate cold/frost days cf_prevyear: If True calculation of cold/frost days starts in previous year. cf_temp: tmean" for cold days and "tmin" for frost days cf_limit: threshold for cold/frost days set: formula to calculate sum of effective temperatures a: parameter for set b: parameter for set

Usage

parameter(model = NULL, parametrisation = NULL, year = NULL, first = TRUE)

Arguments

model

type of model for phenthau function - character - Either single model or model collection

parametrisation

type of parametrisation - character

year

year of prognosis - numeric - Default: actual year

first

logical - If TRUE and parametrisation is missing first parametrisation in parameter() is used

Value

If no argument is specified returns a list of parameter (used inside phenthau function). Otherwise returns available parameter for given model, parametrisation and year

See Also

Other Main: get_legend(), mortality(), phenology(), phenthau()

Examples


# Default parameter list for daily mean, min and max temperature data:
parameter("dailymeanminmax")

# overview dataframe with all available parameter sets
parameter("all")

# all hatch model parameter
parameter("hatch")

# return parameter necessary for calculation
parameter("hatch", "custers", 2020)

Calculate phenological events

Description

Using daily mean or min and max temperature data, the function calculates the temperature-dependent development stages of OPM or the bud stages (bud swelling and leaf unfolding) of its host tree Quercus robur.

The default settings correspond to the model described by Halbig et al. 2024. Additional parametrizations are provided but have not yet been tested.

Halbig et al. 2024 It follows 4 different steps:

Usage

phenology(
  x,
  model,
  parametrisation = NULL,
  year = NULL,
  hatch = NULL,
  return_date = TRUE,
  ...
)

Arguments

x

SpatRaster list/dataframe (tmean, tmax, tmin) - numeric - with time attribute/date column

model

name of model - character

parametrisation

name of parametrisation - character

year

year for prognosis - numeric

hatch

SpatRaster - logical - with time attribute TRUE/FALSE hatch/no_hatch

return_date

TRUE/FALSE defines output -> see value

...

parameter to change default values. (i.e. ldt = 3.5)

Value

If return_date is TRUE returns single layered SpatRaster with time serial number (first occurence of phenological event). If return_date is FALSE returns a one layer per day SpatRaster type logical with phenological event occurred/not TRUE/FALSE.

Author(s)

Bachfischer Lorenz, Department of Forest Protection FVA (2024) lorenz.bachfischer@posteo.de

References

Halbig et al. 2014: Halbig, P., Stelzer, A. S., Baier, P., Pennerstorfer, J., Delb, H., & Schopf, A. (2024). PHENTHAUproc–An early warning and decision support system for hazard assessment and control of oak processionary moth (Thaumetopoea processionea). Forest Ecology and Management, 552, 121525
Baskerville & Emin 1969: Baskerville, G. L., & Emin, P. (1969). Rapid estimation of heat accumulation from maximum and minimum temperatures. Ecology, 50(3), 514-517. (doi:10.2307/1933912)
Menzel 1997: Menzel, A. (1997). Phänologie von Waldbäumen unter sich ändernden Klimabedingungen: Auswertung der Beobachtungen in den internationalen phänologischen Gärten und Möglichkeiten der Modellierung von Phänodaten. Frank.

See Also

Other Main: get_legend(), mortality(), parameter(), phenthau()

Examples

## SpatRaster
srl <- load_test()

# Calculating bud swelling for our raster example
budswelling <- phenology(srl,
                         model = "budswelling",
                         parametrisation = "quercus_robur_clone256_type1",
                         year = 2020)


Calculate PHENTHAUproc model

Description

"phenthau" implements the early warning system PHENTHAUproc created by Halbig et al. 2024 in R.

Usage

phenthau(x, params = NULL, def_hatch = "first", budswelling = NULL)

Arguments

x

SpatRaster list/SpatRaster/data.frame - numeric - with time attribute/date column (see Details for Input requirements)

params

list with parameter (see Details for Input requirements)

def_hatch

"first" or "mean": PHENTHAUproc has three hatch models integrated (for details see: Custers 2003, Wagenhoff et al. 2014, Meurisse et al. 2012). With "first" (Default) the first hatch-model which predicts hatch, with "mean", the mean day of all hatch-models will be used for further calculations.

budswelling

SpatRaster/numeric with DOY (Day of year) - If budswelling is provided, internal calculation of budswelling will be replaced. For raster input provide a raster with same extend and crs as x.

Details

Overview

phenthau function combines multiple phenology models:

Input requirements

For different input type different parameter sets are needed. If params is not provided it will be selected dependent on datatype and names(x) so follow the name convention!

daily raster input with tmean, tmin and tmax:

daily raster input with tmean:

hourly raster input:

daily data.frame input with tmean, tmin and tmax:

daily data.frame input with tmean:

hourly data.frame input:

Parametrisation

Additional parametrization is provided but has not yet been tested.

Use parameter() to return a data.frame with all possible parametrization options or choose a model. The default is "dailymeanminmax" and not dependent on the data input anymore.

Output

Regional Output:
A list with all model calculations as SpatRaster objects:

Local Output:
A data.frame with two columns:

Presentation

Regional Output:

Local Output:

Value

data.frame or list of SpatRaster with all PHENTHAUproc model outputs (see Details)

Author(s)

Bachfischer Lorenz, Department of Forest Protection FVA (2024) lorenz.bachfischer@posteo.de

References

Halbig et al. 2024: Halbig, P., Stelzer, A. S., Baier, P., Pennerstorfer, J., Delb, H., & Schopf, A. (2024). PHENTHAUproc–An early warning and decision support system for hazard assessment and control of oak processionary moth (Thaumetopoea processionea). Forest Ecology and Management, 552, 121525
Custers 2003: Custers, C. (2003). Climate change and trophic synchronisation. English Wageningen UR, Chairgroup Environmental Systems Analysis.
Wagenhoff et al. 2014: Wagenhoff, E., Wagenhoff, A., Blum, R., Veit, H., Zapf, D., & Delb, H. (2014). Does the prediction of the time of egg hatch of Thaumetopoea processionea (Lepidoptera: Notodontidae) using a frost day/temperature sum model provide evidence of an increasing temporal mismatch between the time of egg hatch and that of budburst of Quercus robur due to recent global warming?. European Journal of Entomology, 111(2).
Meurisse et al. 2012: Meurisse, N., Hoch, G., Schopf, A., Battisti, A., & Grégoire, J. C. (2012). Low temperature tolerance and starvation ability of the oak processionary moth: implications in a context of increasing epidemics. Agricultural and forest entomology, 14(3), 239-250.

See Also

Other Main: get_legend(), mortality(), parameter(), phenology()

Examples


srl <- load_test()
phen <- phenthau(srl)

Plot SpatRaster with date serial number/time attribute

Description

A wrapper around terra::plot to show the time serial number as a character date in the legend.

Usage

plot_date(x, breaks = NULL, ...)

Arguments

x

SpatRaster - numeric - value is serial number or SpatRaster - logical - with time attribute

breaks

number of breaks in the legend - numeric

...

arguments for terra::plot function, except (type, breaks, col or plg)

Value

A plot of a phenological event by day with legend.

See Also

Other Plot: plot_stages(), plot_station_step()

Examples


data <- load_test()
budswelling <- phenology(data, "budswelling", "quercus_robur_clone256_type1", 2020)
plot_date(budswelling)

Plot regional PHENTHAUproc - Stages

Description

A wrapper to plot the development stages of OPM with assigned names and colors

Usage

plot_stages(x, time = NULL, ...)

Arguments

x

SpatRaster stages output of phenthau - numeric

time

day to plot - Date or character year-month_day i.e.("2020-05-01")

...

arguments passed along to terra::plot

Details

phenthau returns a list of SpatRasters. The stages object describes the development stages of oak processionary moth. This function plots the stages SpatRaster with the right names and colors. To get IDs, caregories and colors use get_legend("stages").

Value

A plot of the PHENTHAUproc stages of the last/chosen time with preset levels and colors.

See Also

Other Plot: plot_date(), plot_station_step()


Plot local PHENTHAUproc in a step plot

Description

Plots the development stages of OPM.

Usage

plot_station_step(x)

Arguments

x

output of phenthau - dataframe - local PHENTHAUproc

Value

A plot showing local PHENTHAUproc results in a step plot.

See Also

Other Plot: plot_date(), plot_stages()

Examples


fr_df <- load_test("day")
fr <- phenthau(fr_df)

plot_station_step(fr)

Regional Weather data

Description

A dataset containing daily mean, minimum and maximum temperatures in °C. The dataset is a 4*4 pixel cutout centered at FVA from the "Hyras" dataset available at the DWD open data center (https://opendata.dwd.de/climate_environment/CDC/grids_germany/daily/hyras_de/)

Format

A list of SpatRaster

Details

The dataset can be loaded using load_test("SpatRaster").

Spatial resolution: 5 km x 5 km Projection: ETRS89 / LCC Europe (EPSG:3034) Parameter: air temperature at 2 m

The dataset is a list with three SpatRaster as objects. The time attribute for all three SpatRaster is equal.

The list objects are:


Regional Weather data

Description

A dataset containing hourly mean temperatures in °C. The dataset is a 4*4 pixel cutout centered at FVA provided by the Agricultural meteorology Department of the DWD.

Format

netCDF

Details

The dataset can be loaded using load_test("SpatRaster_hour").

Spatial resolution: 1 km x 1 km Projection: DHDN / 3-degree Gauss-Kruger zone 3 (EPSG:31467) Parameter: air temperature at 2 m

The dataset is a list with three SpatRaster as objects.

The list objects are:


Remove FALSE

Description

Set values in SpatRaster or SpatRaster list to -999 if y is FALSE

Usage

remove_false(x, y)

Arguments

x

SpatRaster/SpatRaster list - numeric - with time attribute

y

SpatRaster - logical - with time attribute

See Also

Other Helper: call_function(), check_data_with_params(), check_dimension_and_time(), convert_dwd_to_phenthau(), get_date(), get_formalArgs(), get_time(), load_test(), set_attributes(), subset_time(), timename()


Set attributes for SpatRaster

Description

Set attributes for SpatRaster

Usage

set_attributes(x, type)

Arguments

x

SpatRaster - to assign attributes to

type

character - type of attributes i.e. "stages"

See Also

Other Helper: call_function(), check_data_with_params(), check_dimension_and_time(), convert_dwd_to_phenthau(), get_date(), get_formalArgs(), get_time(), load_test(), remove_false(), subset_time(), timename()


Subset data.frame/SpatRaster/List within from and end time

Description

Subset data.frame/SpatRaster/List within from and end time

Usage

subset_time(x, from, to)

Arguments

x

data.frame with time column, SpatRaster with time attribute or List of SpatRasters with same time attributes

from

first day of subset

to

last day of subset

See Also

Other Helper: call_function(), check_data_with_params(), check_dimension_and_time(), convert_dwd_to_phenthau(), get_date(), get_formalArgs(), get_time(), load_test(), remove_false(), set_attributes(), timename()


Create a name with time stamp

Description

Create a name with time stamp

Usage

timename(x, model, desc = NULL)

Arguments

x

SpatRaster with time attribute

model

character - name of model

desc

character - additional description (optional)

See Also

Other Helper: call_function(), check_data_with_params(), check_dimension_and_time(), convert_dwd_to_phenthau(), get_date(), get_formalArgs(), get_time(), load_test(), remove_false(), set_attributes(), subset_time()

mirror server hosted at Truenetwork, Russian Federation.