Title: | Functions for Calculating Daily Solar Radiation and Evapotranspiration |
---|---|
Description: | Calculating daily global solar radiation at horizontal surface using several well-known models (i.e. Angstrom-Prescott, Supit-Van Kappel, Hargreaves, Bristow and Campbell, and Mahmood-Hubbard), and model calibration based on ground-truth data, and (3) model auto-calibration. The FAO Penmann-Monteith equation to calculate evapotranspiration is also included. |
Authors: | Jedrzej S. Bojanowski |
Maintainer: | Jedrzej S. Bojanowski <[email protected]> |
License: | GPL-2 |
Version: | 2.3-3 |
Built: | 2024-11-11 06:15:53 UTC |
Source: | https://github.com/r-forge/sirad |
Calculates daily solar radiation at horizontal surface using several well-known models (Bristow-Campbell, Hargreaves, Supit-Van Kappel, Mahmood-Hubbard, Angrstrom-Prescott). It also includes functions for model calibration based on groud-truth data as well as a function for auto-calibration. The FAO Penmann-Monteith equation to calculate evapotranspiration is also included.
Package: | sirad |
Type: | Package |
Version: | 2.3-3 |
Date: | 2016-10-17 |
License: | GPL-2 |
LazyLoad: | yes |
Jedrzej S. Bojanowski
Maintainer: Jedrzej S. Bojanowski <[email protected]>
require(zoo) data(Metdata) A <- 0.21 B <- 0.57 sunshine <- Metdata$meteo$SUNSHINE days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE lon <- Metdata$LONGITUDE plot(zoo(ap(days=days,lat=lat,lon=lon,extraT=NULL, A=A,B=B,SSD=sunshine),order.by=days))
require(zoo) data(Metdata) A <- 0.21 B <- 0.57 sunshine <- Metdata$meteo$SUNSHINE days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE lon <- Metdata$LONGITUDE plot(zoo(ap(days=days,lat=lat,lon=lon,extraT=NULL, A=A,B=B,SSD=sunshine),order.by=days))
Angstrom-Prescott model is used to calculate daily global irradiance for a horizontal surface based on sunshine duration.
ap(days, lat, lon, extraT=NULL, A=NA, B=NA, SSD)
ap(days, lat, lon, extraT=NULL, A=NA, B=NA, SSD)
days |
Vector of class 'Date' of length n. |
lat |
Latitude in decimal degrees. |
lon |
Longitude in decimal degrees. |
extraT |
Optional. Vector of length n of extraterrestrial solar radiation [MJm-2]. If 'NULL' then it is calculated by the function. Providing extraterrestrial solar radiation speeds up the computation |
A |
Angstrom-Prescott model 'A' coefficient. If 'NA' then A is derived from the map of interpolated coefficients estimated from Meteosat solar radiation data. See details. |
B |
Angstrom-Prescott model 'B' coefficient. If 'NA' then B is derived from the map of interpolated coefficients estimated from Meteosat solar radiation data. See details. |
SSD |
Vector of length n containing sunshine duration [in hours]. |
Model proposed by Angstrom (1924) and modified by Prescott (1940) assumed linear relationship between: (1) a proportion of bright sunshine hours and astronomical day length and (2) proportion of incoming daily global solar radiation and daily extra-terrestrial radiation. This linear relationship is described by empirical model coefficients: A - intercept, B - slope. Both astronomical day length and daily extra-terrestrial radiation are calculated within this function based on location and time. Model coefficients A and B (if not provided) are derived from interpolated Meteosat-based coefficients from Bojanowski et al. 2013.
Vector of length n of daily solar radiation [MJm-2].
SSD input can contain NA's, but length of vectors 'SSD' and 'days' has to be the identical.
Jedrzej S. Bojanowski
Bojanowski, J.S., Vrieling, A., Skidmore, A.K., 2013. Calibration of solar radiation models for Europe using Meteosat Second Generation and weather station data. Agricultural and Forest Meteorology 176:1-9.
Angstrom, A., 1924. Solar and terrestrial radiation. Quarterly Journal of the Royal Meteorological Society, 50:121-125.
Prescott, J.A., 1940. Evaporation from a water surface in relation to solar radiation. Transactions of the Royal Society of South Australia, 64:114-118.
'apcal' to calibrate the model
require(zoo) #A <- 0.21 #B <- 0.57 sunshine <- Metdata$meteo$SUNSHINE days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE lon <- Metdata$LONGITUDE plot(zoo(ap(days,lat,lon, extraT=NULL,A=NA,B=NA,sunshine),order.by=days))
require(zoo) #A <- 0.21 #B <- 0.57 sunshine <- Metdata$meteo$SUNSHINE days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE lon <- Metdata$LONGITUDE plot(zoo(ap(days,lat,lon, extraT=NULL,A=NA,B=NA,sunshine),order.by=days))
Function estimates Angstrom-Prescott model coefficients 'A' and 'B' based on reference data
apcal(lat, days, rad_mea,extraT=NULL, DL=NULL, SSD)
apcal(lat, days, rad_mea,extraT=NULL, DL=NULL, SSD)
lat |
Latitude in decimal degrees. |
days |
Vector of class 'Date' of length n. |
rad_mea |
Vector of length n containing reference (e.g. measured) solar radiation [MJm-2]. |
extraT |
Optional. Vector of length n of extraterrestrial solar radiation [MJm-2]. If 'NULL' then it is calculated by the function. Providing extraterrestrial solar radiation speeds up the computation |
DL |
Optional. Vector of length n of day length [h]. If 'NULL' then it is calculated by the function. Providing day length speeds up the computation |
SSD |
Vector of length n containing sunshine duration [in hours]. |
Function estimates Angstrom-Prescott model coefficients 'A' and 'B' based on reference (e.g. measured) solar radiation data. It performs a linear regression in which 'rad_mea' is dependent variable and a proporsion of 'SSD' and astronomical day length is an independent variable.
Vector containing:
APa |
Angstom-Prescott 'A' coefficient |
APb |
Angstom-Prescott 'B' coefficient |
APr2 |
Coefficient of determination of performed linear regression |
Jedrzej S. Bojanowski
Angstrom, A., 1924. Solar and terrestrial radiation. Quarterly Journal of the Royal Meteorological Society, 50:121-125.
Prescott, J.A., 1940. Evaporation from a water surface in relation to solar radiation. Transactions of the Royal Society of South Australia, 64:114-118.
'ap' to use Angstrom-Prescott model
## Calibrate the model based on measured data data(Metdata) sunshine <- Metdata$meteo$SUNSHINE days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE rad_mea <- Metdata$meteo$RAD_MEA apcal(lat=lat,days=days,rad_mea,extraT=NULL,DL=NULL,SSD=sunshine)
## Calibrate the model based on measured data data(Metdata) sunshine <- Metdata$meteo$SUNSHINE days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE rad_mea <- Metdata$meteo$RAD_MEA apcal(lat=lat,days=days,rad_mea,extraT=NULL,DL=NULL,SSD=sunshine)
'bc' calculates daily solar radiation based on daily temperature range using Bristow-Campbell model.
bc(days, lat, BCb,extraT=NULL, Tmax, Tmin, BCc = 2, tal)
bc(days, lat, BCb,extraT=NULL, Tmax, Tmin, BCc = 2, tal)
days |
Vector of class 'Date' of length n. |
lat |
Latitude in decimal degrees. |
BCb |
Bristow-Campbell model coefficient 'B'. |
extraT |
Optional. Vector of length n of extraterrestrial solar radiation [MJm-2]. If 'NULL' then it is calculated by the function. Providing extraterrestrial solar radiation speeds up the computation |
Tmax |
Vector of length n containing daily maximum temperature [C]. |
Tmin |
Vector of length n containing daily minumum temperature [C]. |
BCc |
Bristow-Campbell model coefficient 'C' usually equaled to 2. |
tal |
Clear sky transmissivity. |
Bristow and Campbell proposed a method for estimating solar radiation from air temperature measurements. They developed an empirical relationship to express the daily total atmospheric transmittance as a function of daily range in air temperature.
Vector of length n of daily solar radiation [MJm-2].
'Tmax', 'Tmin' can contain NA's, but length of vectors 'Tmax', 'Tmin' and 'days' has to be the same.
Jedrzej S. Bojanowski
Bristow, K.L., Campbell, G.S. 1984. On the relationship between incoming solar radiation and daily maximum and minimum temperature. Agriculture and Forest Meteorology, 31:159-166.
'bccal' to calibrate model using reference data, 'bcauto' to perform auto-calibration, and 'ha' to use Hargreaves model to calculate solar radiation based on temperature range.
require(zoo) data(Metdata) B <- 0.11 tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE plot(zoo(bc(days, lat, BCb=B,extraT=NULL, tmax, tmin, BCc=2, tal=0.76),order.by=days))
require(zoo) data(Metdata) B <- 0.11 tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE plot(zoo(bc(days, lat, BCb=B,extraT=NULL, tmax, tmin, BCc=2, tal=0.76),order.by=days))
Function estimates Bristow-Campbell model coefficient 'B' based on auto-calibration procedure
bcauto(lat,lon,days,extraT=NULL,Tmax,Tmin,tal,BCc=2, BCb_guess=0.13,epsilon=0.5,perce=NA,dcoast=NA)
bcauto(lat,lon,days,extraT=NULL,Tmax,Tmin,tal,BCc=2, BCb_guess=0.13,epsilon=0.5,perce=NA,dcoast=NA)
lat |
Latitude in decimal degrees. |
lon |
Longitude in decimal degrees. |
days |
Vector of class 'Date' of length n. |
extraT |
Optional. Vector of length n of extraterrestrial solar radiation [MJm-2]. If 'NULL' then it is calculated by the function. Providing extraterrestrial solar radiation speeds up the computation |
Tmax |
Vector of length n containing daily maximum temperature [C]. |
Tmin |
Vector of length n containing daily minumum temperature [C]. |
tal |
Clear sky transmissivity. |
BCc |
Bristow-Campbell model coefficient 'C' usually equaled to 2. |
BCb_guess |
Assumption of Bristow-Campbell coefficient. Default set to 0.13. |
epsilon |
A value of which potential radiation is decreased. See "details". |
perce |
Percent of clear days. In 'NA' then perce is estimated based on the Cloud Fraction Cover map. |
dcoast |
Distance to the coast [km]. |
The auto-calibration method bases on the assumption that on the clear-sky days model should not overpredict potential values. To define those clear-sky days, we estimate daily solar radiation using Bristow and Campbell model with default values of B = 0.13 and tal = 0.72 and we select those days for which estimated daily solar radiation is the closest to the potential values (extraterrestrial*tal). The number of clear-sky days is estimated based on the mean Cloud Fraction Cover map. Next, based on selected clear-sky days, we perform a non-linear least squares regression to derive B coefficient treating potential values decreased by 'epsilon' as a reference solar radiation values. The analysis of auto-calibration results showed clear correlation between optimal 'epsilon' and distance to the coast. We proposed simplified method in which 'epsilon' is equal to 0.1 MJm-2 or to 0.5 MJm-2 when distance to the coast is smaller or bigger than 15 km respectively.
BCb |
Bristow-Campbell 'B' coefficient |
Jedrzej S. Bojanowski
Bojanowski, J.S., Donatelli, M., Skidmore, A.K., Vrieling, A., 2013. An auto-calibration procedure for empirical solar radiation models Environmental Modelling and Software 49, 118-128.
'bc' to use Bristow-Campbell model, and 'bccal' to perform calibration based on reference data.
data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE lon <- Metdata$LONGITUDE rad_mea <- Metdata$meteo$RAD_MEA dcoast <- Metdata$DCOAST bcauto(lat,lon,days,extraT=NULL,tmax,tmin,perce=NA,dcoast)
data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE lon <- Metdata$LONGITUDE rad_mea <- Metdata$meteo$RAD_MEA dcoast <- Metdata$DCOAST bcauto(lat,lon,days,extraT=NULL,tmax,tmin,perce=NA,dcoast)
Function estimates Bristow-Campbell model coefficient 'B' based on reference data
bccal(lat, days, rad_mea,extraT=NULL,BCc=2,Tmax, Tmin, tal)
bccal(lat, days, rad_mea,extraT=NULL,BCc=2,Tmax, Tmin, tal)
lat |
Latitude in decimal degrees. |
days |
Vector of class 'Date' of length n. |
rad_mea |
Vector of length n containing reference (e.g. measured) solar radiation [MJm-2]. |
extraT |
Optional. Vector of length n of extraterrestrial solar radiation [MJm-2]. If 'NULL' then it is calculated by the function. Providing extraterrestrial solar radiation speeds up the computation |
BCc |
Bristow-Campbell model coefficient 'C' usually equaled to 2. |
Tmax |
Vector of length n containing daily maximum temperature [C]. |
Tmin |
Vector of length n containing daily minumum temperature [C]. |
tal |
Clear sky transmissivity. |
Function estimates Bristow-Campbell model coefficient 'B' based on reference (e.g. measured) solar radiation data. It performs a non-linear least squeres regression.
BCb |
Bristow-Campbell 'B' coefficient |
Jedrzej S. Bojanowski
Bristow, K.L., and G.S. Campbell. 1984. On the relationship between incoming solar radiation and daily maximum and minimum temperature. Agriculture and Forest Meteorology, 31:159-166.
'bc', and 'bcauto' to perform auto-calibration
data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE rad_mea <- Metdata$meteo$RAD_MEA bccal(lat,days,rad_mea,extraT=NULL,BCc=2,tmax,tmin, tal=0.76)
data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE rad_mea <- Metdata$meteo$RAD_MEA bccal(lat,days,rad_mea,extraT=NULL,BCc=2,tmax,tmin, tal=0.76)
Function estimates a clear sky transmissivity based on reference data (e.g. measured)
cst(RefRad, days, lat, extraT=NULL, perce = 3, sepYear = FALSE, stat='median')
cst(RefRad, days, lat, extraT=NULL, perce = 3, sepYear = FALSE, stat='median')
RefRad |
Vector of length n of reference solar radiation data [MJm-2] |
days |
Vector of class 'Date' of length n. |
lat |
Latitude in radians |
extraT |
Optional. Vector of length n of extraterrestrial solar radiation [MJm-2]. If 'NULL' then it is calculated by the function. Providing extraterrestrial solar radiation speeds up the computation |
perce |
Percent of days to be chosen as clear days |
sepYear |
Logical value. If 'TRUE' percent of days given by 'perce' of every single year are taken for calculation. If 'FALSE' percent of days given by 'perce' of all years are taken for calculation |
stat |
Method used to estimate final value of the clear sky transmissivity from the values derived from selected clear-sky days. Default is 'median' which is more conservative, while alternative 'max' is sensitive to outliers. If 'max' is used the value of 'perce' is not important. If 'stat' is numeric then (instead of 'median' or 'max') 'quantile' is used. 'Stat' is sent as quantile's 'probs' parameter. See ?quantile for details |
Numeric. Clear sky transmissivity.
Jedrzej S. Bojanowski
cstRead
data(Metdata) ref <- Metdata$meteo$RAD_MEA i <- dayOfYear(Metdata$meteo$DAY) latr <- radians(Metdata$LATITUDE) cst(ref,i,latr)
data(Metdata) ref <- Metdata$meteo$RAD_MEA i <- dayOfYear(Metdata$meteo$DAY) latr <- radians(Metdata$LATITUDE) cst(ref,i,latr)
Read values of clear sky transmissivity map for a given locations (in lat/lon)
cstRead(lat,lon)
cstRead(lat,lon)
lat |
Latitude in decimal degrees. |
lon |
Longitude in decimal degrees. |
Clear sky transmissivity
Jedrzej S. Bojanowski
'cst'
cstRead(50,16)
cstRead(50,16)
Function gives a day number of the year (julian day of the year) based on the date in class 'Date'.
dayOfYear(dat)
dayOfYear(dat)
dat |
Date in class 'Date'. |
Numeric number of day in a year.
Jedrzej S. Bojanowski
dayOfYear(as.Date("2009-01-11"))
dayOfYear(as.Date("2009-01-11"))
Converts radians to degrees
degrees(radians)
degrees(radians)
radians |
numeric |
Degrees.
Jedrzej S. Bojanowski
'radians'
degrees(0.95)
degrees(0.95)
'deltaVP' estimates the slope of saturation vapour pressure curve
deltaVP(Tmax,Tmin)
deltaVP(Tmax,Tmin)
Tmax |
Vector of length n containing daily maximum temperature [C]. |
Tmin |
Vector of length n containing daily minumum temperature [C]. |
Slope of saturation vapour pressure curve [kPaC-1]
Jedrzej S. Bojanowski
Allen, R.G., L.S. Pereira, D. Raes, and M. Smith. 1998. Crop Evapotranspiration: Guidelines for computing crop water requirements. Irrigation and Drainage Paper 56, Food and Agriculture Organization of the United Nations, Rome, pp. 300.
deltaVP(Tmax=17,Tmin=16)
deltaVP(Tmax=17,Tmin=16)
'es' calculates mean saturation vapour pressure based on air temperature.
es(Tmax,Tmin)
es(Tmax,Tmin)
Tmax |
Vector of length n containing daily maximum temperature [C]. |
Tmin |
Vector of length n containing daily minumum temperature [C]. |
Vector of length n of mean saturation vapour pressure [kPa]
Jedrzej S. Bojanowski
Allen, R.G., L.S. Pereira, D. Raes, and M. Smith. 1998. Crop Evapotranspiration: Guidelines for computing crop water requirements. Irrigation and Drainage Paper 56, Food and Agriculture Organization of the United Nations, Rome, pp. 300.
es(Tmax=25.1,Tmin=19.1)
es(Tmax=25.1,Tmin=19.1)
'et0' estimates evapotranspiration based on FAO Penman-Monteith equation
et0(Tmax,Tmin, vap_pres,sol_rad,tal,z,uz,meah=10,extraT=NA,days=NA,lat=NA)
et0(Tmax,Tmin, vap_pres,sol_rad,tal,z,uz,meah=10,extraT=NA,days=NA,lat=NA)
Tmax |
Vector of length n containing daily maximum temperature [C]. |
Tmin |
Vector of length n containing daily minumum temperature [C]. |
vap_pres |
Vector of length n of mean daily vapour pressure [kPa]. |
sol_rad |
Vector of length n of daily solar radiation [MJm-2d-1]. |
tal |
Clear sky transmissivity [0-1]. |
z |
Altitude above the sea level [m]. |
uz |
Wind speed measured at heith 'meah' [ms-1]. |
meah |
The height (above the ground level) of the wind speed measurement [m]. |
extraT |
Optional. Vector of length n of extraterrestrial solar radiation [MJm-2d-1]. If 'NA' then it is calculated by the function. Providing extraterrestrial solar radiation speeds up the computation. |
days |
Required only if extraT=NA. Vector of class 'Date' of length n. |
lat |
Required only if extraT=NA. Latitude in decimal degrees. |
Vector of length n of daily reference evapotranspiration. [mmd-1]
Jedrzej S. Bojanowski
Allen, R.G., L.S. Pereira, D. Raes, and M. Smith. 1998. Crop Evapotranspiration: Guidelines for computing crop water requirements. Irrigation and Drainage Paper 56, Food and Agriculture Organization of the United Nations, Rome, pp. 300.
data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN vpres <- Metdata$meteo$VAP_PRES days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE rad_mea <- Metdata$meteo$RAD_MEA z <- Metdata$ALTITUDE wind <- Metdata$meteo$WIND_10 tal <- cst(rad_mea,dayOfYear(Metdata$meteo$DAY),radians(Metdata$LATITUDE)) et0(Tmax=tmax,Tmin=tmin, vap_pres=vpres,sol_rad=rad_mea,tal=tal,z=Metdata$ALTITUDE, uz=wind,meah=10,extraT=NA,days=days,lat=lat)
data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN vpres <- Metdata$meteo$VAP_PRES days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE rad_mea <- Metdata$meteo$RAD_MEA z <- Metdata$ALTITUDE wind <- Metdata$meteo$WIND_10 tal <- cst(rad_mea,dayOfYear(Metdata$meteo$DAY),radians(Metdata$LATITUDE)) et0(Tmax=tmax,Tmin=tmin, vap_pres=vpres,sol_rad=rad_mea,tal=tal,z=Metdata$ALTITUDE, uz=wind,meah=10,extraT=NA,days=days,lat=lat)
'extrat' calculates hourly and daily extraterrestrial solar radiation for a given time and location.
extrat(i, lat)
extrat(i, lat)
i |
day number in the year (julian day) |
lat |
latitude in radians |
Solar radiation outside of the earth's atmosphere is called extraterrestrial solar radiation. It can be calculated based on solar geometry.
List of 3 elements:
ExtraTerrestrialSolarRadiationDaily |
daily sum of extraterrestrial radiation [MJm-2] |
TerrestrialSolarRadiationHourly |
vector of length 24 of hourly sums of extraterrestrial radiation [MJm-2] |
DayLength |
day length in hours |
Jedrzej S. Bojanowski
## extraterrestrial radiation and daylength for 1 January and latitude 55 degrees extrat(dayOfYear("2011-01-01"), radians(55))
## extraterrestrial radiation and daylength for 1 January and latitude 55 degrees extrat(dayOfYear("2011-01-01"), radians(55))
'ha()' calculates daily solar radiation based on daily temperature range using Hargreaves model.
ha(days, lat, lon, extraT=NULL, A=NA, B=NA, Tmax, Tmin)
ha(days, lat, lon, extraT=NULL, A=NA, B=NA, Tmax, Tmin)
days |
Vector of class 'Date' of length n. |
lat |
Latitude in decimal degrees. |
lon |
Longitude in decimal degrees. |
extraT |
Optional. Vector of length n of extraterrestrial solar radiation [MJm-2]. If 'NULL' then it is calculated by the function. Providing extraterrestrial solar radiation speeds up the computation |
A |
Hargreaves model coefficient 'A'. If 'NA' then A is derived from the map of interpolated coefficients estimated from Meteosat solar radiation data. See details. |
B |
Hargreaves model coefficient 'B'. If 'NA' then B is derived from the map of interpolated coefficients estimated from Meteosat solar radiation data. See details. |
Tmax |
Vector of length n containing daily maximum temperature [C]. |
Tmin |
Vector of length n containing daily minumum temperature [C]. |
Hargreaves proposed a method for estimating solar radiation from air temperature measurements. Model coefficients A and B (if not provided) are derived from interpolated Meteosat-based coefficients from Bojanowski et al. 2013.
Vector of length n of daily solar radiation [MJm-2].
'Tmax', 'Tmin' can contain NA's, but length of vectors 'Tmax', 'Tmin' and 'days' has to be the same.
Jedrzej S. Bojanowski
Bojanowski, J.S., Vrieling, A., Skidmore, A.K., 2013. Calibration of solar radiation models for Europe using Meteosat Second Generation and weather station data. Agricultural and Forest Meteorology 176:1-9.
Hargreaves, G.H., Samini, Z.A.. 1892. Estimating potential evapotranspiration. J. Irrig. Darin. Eng., ASCE 108 (3), 225-230.
'hacal' to calibrate model using reference data, 'bc' to use Bristow-Campbell model to calculate solar radiation based on temperature range.
require(zoo) data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE lon <- Metdata$LONGITUDE plot(zoo(ha(days, lat, lon, extraT=NULL, A=NA, B=NA, Tmax=tmax, Tmin=tmin),order.by=days))
require(zoo) data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE lon <- Metdata$LONGITUDE plot(zoo(ha(days, lat, lon, extraT=NULL, A=NA, B=NA, Tmax=tmax, Tmin=tmin),order.by=days))
Function estimates Hargreaves model coefficients 'A' and 'B' based on reference data
hacal(lat, days, rad_mea, extraT=NULL,tmax, tmin)
hacal(lat, days, rad_mea, extraT=NULL,tmax, tmin)
lat |
Latitude in decimal degrees. |
days |
Vector of class 'Date' of length n. |
rad_mea |
Vector of length n containing reference (e.g. measured) solar radiation [MJm-2]. |
extraT |
Optional. Vector of length n of extraterrestrial solar radiation [MJm-2]. If 'NULL' then it is calculated by the function. Providing extraterrestrial solar radiation speeds up the computation |
tmax |
Vector of length n containing daily maximum temperature [C]. |
tmin |
Vector of length n containing daily minumum temperature [C]. |
Function estimates Hargreaves model coefficients 'A' and 'B' based on reference (e.g. measured) solar radiation data. It performs a linear regression.
Vector of length 3 containing:
Ha |
Hargreaves 'A' coefficient |
Hb |
Hargreaves 'B' coefficient |
Hr2 |
Coefficient of determination of performed linear regression |
Jedrzej S. Bojanowski
Hargreaves, G.H., Samini, Z.A. 1892. Estimating potential evapotranspiration. J. Irrig. Darin. Eng., ASCE 108 (3), 225-230.
'ha'
data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE rad_mea <- Metdata$meteo$RAD_MEA hacal(lat=lat,days=days,rad_mea,extraT=NULL,tmax=tmax, tmin=tmin)
data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE rad_mea <- Metdata$meteo$RAD_MEA hacal(lat=lat,days=days,rad_mea,extraT=NULL,tmax=tmax, tmin=tmin)
Function estimates Hargreaves model coefficients 'A' and 'B' based on autocalibration procedure
hauto(lat, lon, days,extraT = NULL, Tmax, Tmin, tal, Ha_guess = 0.16, Hb_guess = 0.1, epsilon=0.5, perce = NA)
hauto(lat, lon, days,extraT = NULL, Tmax, Tmin, tal, Ha_guess = 0.16, Hb_guess = 0.1, epsilon=0.5, perce = NA)
lat |
Latitude in decimal degrees. |
lon |
Longitude in decimal degrees. |
days |
Vector of class 'Date' of length n. |
extraT |
Optional. Vector of length n of extraterrestrial solar radiation [MJm-2]. If 'NULL' then it is calculated by the function. Providing extraterrestrial solar radiation speeds up the computation |
Tmax |
Vector of length n containing daily maximum temperature [C]. |
Tmin |
Vector of length n containing daily minumum temperature [C]. |
tal |
Clear sky transmissivity. |
Ha_guess |
Assumption of Hargreaves Ha coefficient. Default set to 0.16. |
Hb_guess |
Assumption of Hargreaves Hb coefficient. Default set to 0.1. |
epsilon |
A value of which potential radiation is decreased. See "details". |
perce |
Percent of clear days. Default set to 1. |
The auto-calibration method bases on the assumption that on the clear-sky days model should not overpredict potential values. To define those clear-sky days, we estimate daily solar radiation using Hargreaves model with default values of A = 0.16, B = 0.1 and tal = 0.72 and we select those days for which estimated daily solar radiation is the closest to the potential values (extra-terrestrial*tal). The number of clear-sky days is estimated based on the mean Cloud Fraction Cover map. Next, based on selected clear-sky days, we perform a non-linear least squares regression to derive A and B coefficients treating potential values decreased by 'epsilon' as a reference solar radiation values. The analysis of auto-calibration results showed clear correlation between optimal 'epsilon' and distance to the coast. We proposed simplified method in which 'epsilon' is equal to 0.1 MJm-2 or to 0.5 MJm-2 when distance to the coast is smaller or bigger than 15 km respectively.
Vector of length 3 containing:
Ha |
Hargreaves 'A' coefficient |
Hb |
Hargreaves 'B' coefficient |
Hr2 |
Coefficient of determination of performed linear regression |
Jedrzej S. Bojanowski
Hargreaves, G.H., Samani, Z.A. 1892. Estimating potential evapotranspiration. J. Irrig. Darin. Eng., ASCE 108 (3), 225-230. Bojanowski, J.S., Donatelli, M., Skidmore, A.K., Vrieling, A., 2013. An auto-calibration procedure for empirical solar radiation models Environmental Modelling and Software 49, 118-128.
'hacal'
data(Metdata) Tmax <- Metdata$meteo$TEMP_MAX Tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE lon <- Metdata$LONGITUDE hauto(lat,lon,days,extraT=NULL,Tmax,Tmin,tal=0.76)
data(Metdata) Tmax <- Metdata$meteo$TEMP_MAX Tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE lon <- Metdata$LONGITUDE hauto(lat,lon,days,extraT=NULL,Tmax,Tmin,tal=0.76)
This dataset contains two years of daily data of sunshine hours, solar radiation, minimum temperature, maximum temperature, cloud coverage, vapour pressure, and wind speed.
data(Metdata)
data(Metdata)
NAME | chr | Name | |
LATITUDE | numeric | Latitude (decimal degree) | |
LONGITUDE | numeric | Longitude (decimal degree) | |
DCOAST | numeric | Distance to the coast (km) | |
ALTITUDE | numeric | Altitude above the sea level (m) | |
DAY | Date | Date | |
SUNSHINE | numeric | Sunshine (hours) | |
RAD_MEA | numeric | Solar radiation (MJm-2) | |
TEMP_MIN | numeric | Minimum temperature (degrees C) | |
TEMP_MAX | numeric | Maximum temperature (degrees C) | |
CLOUD_DAYTIME_TOTAL | numeric | Cloud coverage (octas) | |
VAP_PRES | numeric | Vapour pressure (kPa) | |
WIND_10 | numeric | Wind speed at 10 m height (ms-1) |
data(Metdata) str(Metdata)
data(Metdata) str(Metdata)
'mh()' calculates daily solar radiation based on daily temperature range using Mahmood-Hubbard model.
mh(days, lat, Tmax, Tmin)
mh(days, lat, Tmax, Tmin)
days |
Vector of class 'Date' of length n. |
lat |
Latitude in decimal degrees. |
Tmax |
Vector of length n containing daily maximum temperature [C]. |
Tmin |
Vector of length n containing daily minumum temperature [C]. |
Mahmood and Hubbard proposed a method for estimating solar radiation from air temperature measurements without a need of calibraing empirical coefficients.
Vector of length n of daily solar radiation [MJm-2].
Jedrzej S. Bojanowski
Mahmood, R., and K.G. Hubbard. 2002. Effect of time of temperature observation and estimation of daily solar radiation for the Northern Great Plains, USA. Agron. J., 94:723-733.
'bc' and 'ha' to calculate solar radiation based on temperature range using different models.
require(zoo) data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE plot(zoo(mh(days=days, lat=lat, Tmax=tmax, Tmin=tmin),order.by=days))
require(zoo) data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE plot(zoo(mh(days=days, lat=lat, Tmax=tmax, Tmin=tmin),order.by=days))
Function estimates several statistics comparing modelled and reference (measured) values.
modeval(calculated,measured, stat=c("N","pearson","MBE","RMBE","MAE","RMAE","RMSE","RRMSE","R2","slope", "intercept","EF","SD","CRM","MPE","AC","ACu","ACs"),minlength=4)
modeval(calculated,measured, stat=c("N","pearson","MBE","RMBE","MAE","RMAE","RMSE","RRMSE","R2","slope", "intercept","EF","SD","CRM","MPE","AC","ACu","ACs"),minlength=4)
calculated |
Vector of length n of the calculated (modelled) values. |
measured |
Vector of length n of the reference (measured) values. |
stat |
Statistics which are going to be calculated. By default all possible. |
minlength |
Minimum number of non-NA data pairs. If below this value, the NA's are produced. |
The two input vectors can include NA's. Only non-NA calculated-mesured pairs are used. See 'na.omit' for details.
List of 13 statistics:
N |
number of observations |
person |
Pearson's Correlation Coefficient |
MBE |
Mean (Bias) Error |
RMBE |
Relative Mean (Bias) Error |
MAE |
Mean Absolute Error |
RMAE |
Relative Mean Absolute Error |
RMSE |
Root Mean Square Error |
RRMSE |
Relative Root Mean Square Error |
R2 |
Coefficient of determination from linear model |
slope |
Slope from linear model |
intercept |
Intercept from linear model |
EF |
Modelling Efficiency |
SD |
Standard deviation of differences |
CRM |
Coefficient of Residual Mass |
MPE |
Mean Percentage Error |
AC |
Agreement Coefficient |
ACu |
Unsystematic Agreement Coefficient |
ACs |
Systematic Agreement Coefficient |
Jedrzej S. Bojanowski
Bellocchi, G., Acutis, M., Fila, G., Donatelli, M., 2002. An indicator of solar radiation model performance based on a fuzzy expert system. Agronomy Journal 94, 1222-1233.
Ji, L., Gallo, K., 2006. An Agreement Coefficient for image comparison. Photogrammetric Engineering & Remote Sensing 72(7), 823-833.
data(Metdata) B <- 0.11 tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE solrad_measured <- Metdata$meteo$RAD_MEA solrad_BC <- bc(days, lat, extraT=NULL, BCb=B, tmax, tmin, BCc=2, tal=0.76) modeval(solrad_BC,solrad_measured) modeval(solrad_BC,solrad_measured,stat="EF")
data(Metdata) B <- 0.11 tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE solrad_measured <- Metdata$meteo$RAD_MEA solrad_BC <- bc(days, lat, extraT=NULL, BCb=B, tmax, tmin, BCc=2, tal=0.76) modeval(solrad_BC,solrad_measured) modeval(solrad_BC,solrad_measured,stat="EF")
'psychC' estimates the psychrometric constant.
psychC(Tmax,Tmin,z)
psychC(Tmax,Tmin,z)
Tmax |
Vector of length n containing daily maximum temperature [C]. |
Tmin |
Vector of length n containing daily minumum temperature [C]. |
z |
Altitude above the sea level [m]. |
Psychrometric constant [kPaC-1]
Jedrzej S. Bojanowski
Allen, R.G., L.S. Pereira, D. Raes, and M. Smith. 1998. Crop Evapotranspiration: Guidelines for computing crop water requirements. Irrigation and Drainage Paper 56, Food and Agriculture Organization of the United Nations, Rome, pp. 300.
psychC(17,16,1800)
psychC(17,16,1800)
Converts degrees to radians
radians(degrees)
radians(degrees)
degrees |
numeric |
Radians.
Jedrzej S. Bojanowski
'degrees'
radians(55)
radians(55)
'rnl' computes daily net energy flux emitted by the Earth's surface.
rnl(Tmax,Tmin,sol_rad,vap_pres,extraT,tal)
rnl(Tmax,Tmin,sol_rad,vap_pres,extraT,tal)
Tmax |
Vector of length n containing daily maximum temperature [C]. |
Tmin |
Vector of length n containing daily minumum temperature [C]. |
sol_rad |
Vector of length n of daily solar radiation [MJm-2d-1]. |
vap_pres |
Vector of length n of mean daily vapour pressure [kPa]. |
extraT |
Vector of length n of extraterrestrial solar radiation [MJm-2d-1]. |
tal |
Clear sky transmissivity. |
According to the Stefan-Boltzmann law, the longwave energy emission is proportional to the absolute temperature of the surface raised to the fourth power. This longwave energy is corrected by two factors: humidity ('ea') and cloudiness (estimated based on relation of actual and potential solar radiation. See Allen et al. (1998) for details.
Vector of length n of daily net longwave radiation. [MJm-2d-1]
Jedrzej S. Bojanowski
Allen, R.G., L.S. Pereira, D. Raes, and M. Smith. 1998. Crop Evapotranspiration: Guidelines for computing crop water requirements. Irrigation and Drainage Paper 56, Food and Agriculture Organization of the United Nations, Rome, pp. 300.
See 'ea', 'extrat' and 'cst' to calculate necessary input data.
rnl(Tmax=25.1,Tmin=19.1,sol_rad=14.5,vap_pres=2.1,extraT=23.5,tal=0.8)
rnl(Tmax=25.1,Tmin=19.1,sol_rad=14.5,vap_pres=2.1,extraT=23.5,tal=0.8)
'rns' computes daily the net shortwave radiation. resulting from the balance between incoming and reflected solar radiation.
rns(sol_rad,albedo=0.23)
rns(sol_rad,albedo=0.23)
sol_rad |
Vector of length n of daily solar radiation [MJm-2d-1]. |
albedo |
Albedo or canopy reflection coefficient, which is 0.23 for the hypothetical grass reference crop [dimensionless]. |
Daily net shortwave radiation results from the balance between incoming and reflected solar radiation.
Vector of length n of daily net shortwave radiation. [MJm-2d-1]
Jedrzej S. Bojanowski
Allen, R.G., L.S. Pereira, D. Raes, and M. Smith. 1998. Crop Evapotranspiration: Guidelines for computing crop water requirements. Irrigation and Drainage Paper 56, Food and Agriculture Organization of the United Nations, Rome, pp. 300.
rns(sol_rad=14.5)
rns(sol_rad=14.5)
'su()' calculates daily solar radiation based on daily cloud coverage and temperature range using Supit-Van Kappel model.
su(days, lat, lon, extraT=NULL, A=NA, B=NA, C=NA, tmax, tmin, CC)
su(days, lat, lon, extraT=NULL, A=NA, B=NA, C=NA, tmax, tmin, CC)
days |
Vector of class 'Date' of length n. |
lat |
Latitude in decimal degrees. |
lon |
Longitude in decimal degrees. |
extraT |
Optional. Vector of length n of extraterrestrial solar radiation [MJm-2]. If 'NULL' then it is calculated by the function. Providing extraterrestrial solar radiation speeds up the computation |
A |
Supit-Van Kappel model coefficient 'A'. If 'NA' then A is derived from the map of interpolated coefficients estimated from Meteosat solar radiation data. See details. |
B |
Supit-Van Kappel model coefficient 'B'. If 'NA' then B is derived from the map of interpolated coefficients estimated from Meteosat solar radiation data. See details. |
C |
Supit-Van Kappel model coefficient 'C'. If 'NA' then C is derived from the map of interpolated coefficients estimated from Meteosat solar radiation data. See details. |
tmax |
Vector of length n containing daily maximum temperature [C]. |
tmin |
Vector of length n containing daily minumum temperature [C]. |
CC |
Vector of length n containing daily cloud coverage [octas]. |
Supit and Van Kappel proposed a method for estimating solar radiation from daily cloud coverage and temperature range. Model coefficients A, B and C (if not provided) are derived from interpolated Meteosat-based coefficients from Bojanowski et al. 2013.
Vector of length n of daily solar radiation [MJm-2].
'CC', 'Tmax', 'Tmin' can contain NA's, but length of vectors 'CC', 'Tmax', 'Tmin' and 'days' has to be the identical.
Jedrzej S. Bojanowski
Bojanowski, J.S., Vrieling, A., Skidmore, A.K., 2013. Calibration of solar radiation models for Europe using Meteosat Second Generation and weather station data. Agricultural and Forest Meteorology 176:1-9.
Supit, I. 1994. Global radiation. Publication EUR 15745 EN of the Office for Official Publications of the EU, Luxembourg.
Supit, I., Kappel, R.R. van, 1998. A simple method to estimate global radiation. Solar Energy, 63:147-160.
'sucal' to calibrate the model.
require(zoo) data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN cc <- Metdata$meteo$CLOUD_DAYTIME_TOTAL days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE lon <- Metdata$LONGITUDE plot(zoo(su(days=days, lat=lat, lon=lon, extraT=NULL, A=NA, B=NA, C=-NA, tmax=tmax, tmin=tmin, CC=cc),order.by=days))
require(zoo) data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN cc <- Metdata$meteo$CLOUD_DAYTIME_TOTAL days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE lon <- Metdata$LONGITUDE plot(zoo(su(days=days, lat=lat, lon=lon, extraT=NULL, A=NA, B=NA, C=-NA, tmax=tmax, tmin=tmin, CC=cc),order.by=days))
Function estimates Supit-Van Kappel model coefficients 'A', 'B' and 'C' based on reference data
sucal(days, lat, rad_mea, extraT=NULL, tmax, tmin, cc)
sucal(days, lat, rad_mea, extraT=NULL, tmax, tmin, cc)
days |
Vector of class 'Date' of length n. |
lat |
Latitude in decimal degrees. |
rad_mea |
Vector of length n containing reference (e.g. measured) solar radiation [MJm-2]. |
extraT |
Optional. Vector of length n of extraterrestrial solar radiation [MJm-2]. If 'NULL' then it is calculated by the function. Providing extraterrestrial solar radiation speeds up the computation |
tmax |
Vector of length n containing daily maximum temperature [C]. |
tmin |
Vector of length n containing daily minumum temperature [C]. |
cc |
Vector of length n containing daily cloud coverage [octas]. |
Function estimates Supit-Van Kappel model coefficients 'A', 'B' and 'C' based on reference (e.g. measured) solar radiation data. It performs a linear regression.
Vector of length 3:
Sa |
Supit-Van Kappel 'A' coefficient |
Sb |
Supit-Van Kappel 'B' coefficient |
Sc |
Supit-Van Kappel 'C' coefficient |
Sr2 |
Coefficient of determination of performed linear regression |
Jedrzej S. Bojanowski
Supit, I. 1994. Global radiation. Publication EUR 15745 EN of the Office for Official Publications of the EU, Luxembourg.
Supit, I., Kappel, R.R. van, 1998. A simple method to estimate global radiation. Solar Energy, 63:147-160.
'su'.
data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE rad_mea <- Metdata$meteo$RAD_MEA CC <- Metdata$meteo$CLOUD_DAYTIME_TOTAL sucal(lat=lat,days=days,rad_mea, extraT=NULL,tmax=tmax, tmin=tmin,cc=CC)
data(Metdata) tmax <- Metdata$meteo$TEMP_MAX tmin <- Metdata$meteo$TEMP_MIN days <- Metdata$meteo$DAY lat <- Metdata$LATITUDE rad_mea <- Metdata$meteo$RAD_MEA CC <- Metdata$meteo$CLOUD_DAYTIME_TOTAL sucal(lat=lat,days=days,rad_mea, extraT=NULL,tmax=tmax, tmin=tmin,cc=CC)
'wind2' converts a wind speed measured at a certain height 'z' above the ground level to the wind speed at the standard height (2 meters)
wind2(uz,meah)
wind2(uz,meah)
uz |
Wind speed measured at heith 'z' [ms-1]. |
meah |
The height (above the ground level) of the wind speed measurement [m]. |
Wind speed is slowest at the surface and increases with height. The measurements taken at different heights avove the ground level must be standardized to 2 meters (default in agrometeorology).
Wind speed at standard 2 meters. [ms-1]
Jedrzej S. Bojanowski
Allen, R.G., L.S. Pereira, D. Raes, and M. Smith. 1998. Crop Evapotranspiration: Guidelines for computing crop water requirements. Irrigation and Drainage Paper 56, Food and Agriculture Organization of the United Nations, Rome, pp. 300.
wind2(uz=5,meah=10)
wind2(uz=5,meah=10)