| Title: | Crop-Specific Functions and Parameters for APSIM Next Generation Canola Model |
| Version: | 0.1.0 |
| Description: | Provides canola-specific functions, processes and parameter sets used by canola model in the Agricultural Production Systems sIMulator ('APSIM') Next Generation. Includes tools for crop process calculations, parameter management and customisation, enabling users to explore, modify and apply canola model components. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| Depends: | R (≥ 4.1.0) |
| Imports: | optree, tidyweather |
| Suggests: | testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| URL: | https://canola.rapsimng.bangyou.me/, https://github.com/byzheng/rapsimng.canola |
| BugReports: | https://github.com/byzheng/rapsimng.canola/issues |
| Config/roxygen2/version: | 8.1.0 |
| NeedsCompilation: | no |
| Packaged: | 2026-09-14 05:26:29 UTC; zhe00a |
| Author: | Bangyou Zheng [aut, cre] |
| Maintainer: | Bangyou Zheng <zheng.bangyou@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-09-24 05:00:25 UTC |
Canola model options manager
Description
An options manager for configuring canola model parameters. This object provides methods to get and set canola related parameters.
Usage
canola
Value
An option manager object for configuring canola model parameters.
Available Options
- phenology.thermal_time.x
Cardinal temperatures for thermal time calculation. Default: c(2, 30, 35)
- phenology.thermal_time.y
Effective thermal time at corresponding cardinal temperatures. Default: c(0, 28, 0)
- phenology.thermal_time.method
Method used for thermal time calculation. Supported values: "3hr" and "HourlySinPpAdjusted". Default: "3hr"
- phenology.vernalisation_time.x
Cardinal temperatures for vernalisation time calculation. Default: c(0, 2, 8, 15)
- phenology.vernalisation_time.y
Effective vernalisation time at corresponding cardinal temperatures. Default: c(0, 1, 0.5, 0.0)
Methods
- get(key)
Retrieve the value of an option by its key (e.g., "phenology.thermal_time.x")
- set(key, value)
Set the value of an option by its key
- reset()
Reset all options to their default values
Examples
# Get default thermal time cardinal temperatures
canola$get("phenology.thermal_time.x")
# Get default vernalisation time parameters
canola$get("phenology.vernalisation_time.x")
canola$get("phenology.vernalisation_time.y")
# Set custom values
canola$set("phenology.thermal_time.x" = c(0, 25, 40))
canola$set("phenology.thermal_time.y" = c(0, 25, 0))
# Reset to defaults
canola$reset()
Calculate thermal time using cardinal temperatures
Description
Calculate thermal time using cardinal temperatures
Usage
thermal_time(
mint,
maxt,
x_temp = canola$get("phenology.thermal_time.x"),
y_temp = canola$get("phenology.thermal_time.y"),
method = canola$get("phenology.thermal_time.method")
)
Arguments
mint |
The minimum temperature |
maxt |
The maximum temperature |
x_temp |
The cardinal temperatures using to calculate thermal time. The default values are c(2, 30, 35) defined in canola$get("phenology.thermal_time.x"). |
y_temp |
The effective thermal time at the corresponding cardinal temperatures. The default values are c(0, 28, 0) defined in canola$get("phenology.thermal_time.y"). |
method |
The method to calculate thermal time. Supported values are "3hr", which uses the three hour temperature method, and "HourlySinPpAdjusted", which uses an hourly sinusoidal photoperiod-adjusted method. The default is "3hr". |
Details
The daily thermal time is calculated by interpolating the effective thermal time at three hour intervals between the daily minimum and maximum temperatures, and then averaging these values to get the daily thermal time. For more information about the canola phenology model, see the APSIM Next Generation Canola Documentation.
Value
The thermal time.
Examples
mint <- c(0, 10)
maxt <- c(30, 40)
thermal_time(mint, maxt)
Calculate vernalisation time using cardinal temperatures
Description
Calculate vernalisation time using cardinal temperatures
Usage
vernalisation_days(
mint,
maxt,
x_temp = canola$get("phenology.vernalisation_time.x"),
y_temp = canola$get("phenology.vernalisation_time.y")
)
Arguments
mint |
The minimum temperature |
maxt |
The maximum temperature |
x_temp |
The cardinal temperatures used to calculate vernalisation time. The default values are defined in canola$get("phenology.vernalisation_time.x"). |
y_temp |
The effective vernalisation time at the corresponding cardinal temperatures. The default values are defined in canola$get("phenology.vernalisation_time.y"). |
Details
The daily vernalisation time is calculated by interpolating the effective vernalisation time at three hour intervals between the daily minimum and maximum temperatures, and then averaging these values to get the daily vernalisation time.
For more information about the canola phenology model, see the APSIM Next Generation Canola Documentation.
Value
The vernalisation time (days).
Examples
mint <- c(0, 10)
maxt <- c(30, 40)
vernalisation_days(mint, maxt)