Title: | Climate Crop Zoning Based in Air Temperature for Brazil |
---|---|
Description: | Climate crop zoning based in minimum and maximum air temperature. The data used in the package are from 'TerraClimate' dataset (<https://www.climatologylab.org/terraclimate.html>), but, it have been calibrated with automatic weather stations of National Meteorological Institute of Brazil. The climate crop zoning of this package can be run for all the Brazilian territory. |
Authors: | Roberto Filgueiras [aut, cre] |
Maintainer: | Roberto Filgueiras <[email protected]> |
License: | CC BY 4.0 |
Version: | 1.0.3 |
Built: | 2025-02-14 20:21:48 UTC |
Source: | https://github.com/filgueirasr/cropzoning |
This function will calculate the climate crop zoning for the range of air temperature informed. The result will be a raster image with five possible values (values of 1 to 5) according to what is explained below.
Pixel values = 1, correspond to suitable air temperature (ST);
Pixel values = 2, correspond to restricted due to low temperature (RLT);
Pixel values = 3, correspond to restricted due to high temperature (RHT);
Pixel values = 4, correspond to unsuitable due to low temperature (ULT);
Pixel values = 5, correspond to unsuitable due to high temperature (UHT).
The thermal suitability ranges established were as follows:
ST - Temperature range (range of temp2 to temp3) considered optimal for the growth, development and production of the crop;
RLT - Temperature range (range of temp2 to temp1) which the crop is able to develop, however, below its potential due to the air temperature values being slightly lower than those of the suitable range;
RHT - Temperature range (range of temp3 to temp4) which the crop is able to develop, however, below its potential due to the temperature values being slightly higher than those of the suitable range;
ULT - When temperature values are not suitable for commercial exploitation of the crop due to low air temperature (air temperature below the temp1);
UHT - When temperature values are not suitable for commercial exploitation of the crop due to high air temperature (air temperature above the temp4);
ccrop_zoning(temp_per_month, temp1, temp2, temp3, temp4)
ccrop_zoning(temp_per_month, temp1, temp2, temp3, temp4)
temp_per_month |
Rasterstack object with a monthly mean air temperature from a period of time |
temp1 |
unsuitable due to low temperature (numeric) |
temp2 |
minimum suitable temperature (numeric) |
temp3 |
maximum suitable temperature (numeric) |
temp4 |
unsuitable due to high temperature (numeric) |
Returns a SpatRaster object of climate crop zoning based in air temperature.
## Not run: ### Example with Brazil states see_brazil_states() image_tmin<-loadROI(variable = "tmin", region = "brazil", sub_region = 13) # sub_regions 1:27 image_tmax<-loadROI(variable = "tmax", region = "brazil", sub_region = 13) image_tmean <- tmean(tmax_stack = image_tmax, tmin_stack = image_tmin) start_date <- c('2000-01-01') end_date <- c('2017-12-01') tmean_monthly <- tmean_monthly_stack(tmean_stack = img_tmean, start_date = start_date, end_date = end_date) zoning <- ccrop_zoning(temp_per_month = tmean_monthly, temp1 = 10 , temp2 = 20, temp3 = 30, temp4 = 40) ## End(Not run)
## Not run: ### Example with Brazil states see_brazil_states() image_tmin<-loadROI(variable = "tmin", region = "brazil", sub_region = 13) # sub_regions 1:27 image_tmax<-loadROI(variable = "tmax", region = "brazil", sub_region = 13) image_tmean <- tmean(tmax_stack = image_tmax, tmin_stack = image_tmin) start_date <- c('2000-01-01') end_date <- c('2017-12-01') tmean_monthly <- tmean_monthly_stack(tmean_stack = img_tmean, start_date = start_date, end_date = end_date) zoning <- ccrop_zoning(temp_per_month = tmean_monthly, temp1 = 10 , temp2 = 20, temp3 = 30, temp4 = 40) ## End(Not run)
This function will download the tmax and tmin images and will load a rasterstack according to the the region of interest (Region and sub_region). The images downloaded by this function are intended to be used for calculating the climatic zoning of crops. To calculate the climatic zoning of the crops, you first have to calculate the mean air temperature (function tmean) and the monthly air temperature (function tmean_monthly).
download_terraclimate(dir_out, variable, years, region, sub_region)
download_terraclimate(dir_out, variable, years, region, sub_region)
dir_out |
Directory where you want to save the raster images that you are goind to download. Each variable should be locate in one folder. |
variable |
Variable to download. The variables can be the minimum (tmin) or maximum (tmax) air temperature of 'TerraClimate' (Rasterstack). |
years |
The period in years that the function should download. |
region |
Use the "brazil" shapefile to extract the Rasterstack (variable) for one state (Brazilian state), or use the "biomes_brazil" to extract the Rasterstack (variable) for one biome of Brazil. |
sub_region |
You have two options in this section, if you choice the brazil (in region parameter) you need to choice the Brazilian states, but if you choice the biomes_brazil (in region parameter) you must choice one of Brazilian biomes. Another option is to select "all" to download images for the entire territory of Brazil. |
Returns a Rasterstack of tmin (minimum air temperature) or tmax (maximum air temperature).
The images used in this package can be found in the paper: Abatzoglou, J.T., S.Z. Dobrowski, S.A. Parks, K.C. Hegewisch, 2018, Terraclimate, a high-resolution global dataset of monthly climate and climatic water balance from 1958-2015, Scientific Data.
## Not run: ### Downloading the minimum air temperature and maximum air temperature based on Brazil states. see_brazil_states() img <- download_terraclimate( dir_out = "C:/teste/tmin/state", variable = "tmin", years = c(2018:2019), region = "brazil", sub_region = 13 ) ### Downloading the minimum air temperature and maximum air temperature based on Brazil states. see_brazil_biomes() img <- download_terraclimate( dir_out = "C:/teste/tmin/biome", variable = "tmin", years = c(2018:2019), region = "biomes_brazil", sub_region = 6 ) ## End(Not run)
## Not run: ### Downloading the minimum air temperature and maximum air temperature based on Brazil states. see_brazil_states() img <- download_terraclimate( dir_out = "C:/teste/tmin/state", variable = "tmin", years = c(2018:2019), region = "brazil", sub_region = 13 ) ### Downloading the minimum air temperature and maximum air temperature based on Brazil states. see_brazil_biomes() img <- download_terraclimate( dir_out = "C:/teste/tmin/biome", variable = "tmin", years = c(2018:2019), region = "biomes_brazil", sub_region = 6 ) ## End(Not run)
This function will load the air temperature data (SpatRaster) for the region of interest (ROI). The images loaded by this function are intended to be used, as example, for calculating the climatic zoning of crops. To calculate the climatic zoning of the crops, you first have to calculate the mean air temperature (function tmean) and the monthly air temperature (function tmean_monthly).
loadROI(variable, region, sub_region)
loadROI(variable, region, sub_region)
variable |
Stack of minimum (tmin) or maximum (tmax) air temperature (SpatRaster). |
region |
Use the "brazil" shapefile to extract the SpatRaster (variable) for one state (Brazilian state), or use the "biomes_brazil" to extract the Rasterstack (variable) for one biome of Brazil. |
sub_region |
You have two options in this section, if you choice the brazil (in region parameter) you need to choice the Brazilian states, but if you choice the biomes_brazil (in region parameter) you must choice one of Brazilian biomes. |
Load the tmin image example (minimum air temperature) or tmax image example (maximum air temperature) rasterstack
The images used in this package can be found in the paper: Abatzoglou, J.T., S.Z. Dobrowski, S.A. Parks, K.C. Hegewisch, 2018, Terraclimate, a high-resolution global dataset of monthly climate and climatic water balance from 1958-2015, Scientific Data.
## Not run: ### Loading minimum air temperature and maximum air temperature based on Brazil states. see_brazil_states() image_tmin <-loadROI(variable = "tmin", region = "brazil", sub_region = 13) # sub_regions 1:27 image_tmax <-loadROI(variable = "tmax", region = "brazil", sub_region = 13) ### Loading minimum air temperature and maximum air temperature based on Brazil biomes. see_brazil_biomes() image_tmin <- loadROI(variable = tmin, region = "biomes_brazil", sub_region = 5)# sub regions: 1:6 (biomes) image_tmax <-loadROI(variable = "tmax", region = "biomes_brazil", sub_region = 5) ## End(Not run)
## Not run: ### Loading minimum air temperature and maximum air temperature based on Brazil states. see_brazil_states() image_tmin <-loadROI(variable = "tmin", region = "brazil", sub_region = 13) # sub_regions 1:27 image_tmax <-loadROI(variable = "tmax", region = "brazil", sub_region = 13) ### Loading minimum air temperature and maximum air temperature based on Brazil biomes. see_brazil_biomes() image_tmin <- loadROI(variable = tmin, region = "biomes_brazil", sub_region = 5)# sub regions: 1:6 (biomes) image_tmax <-loadROI(variable = "tmax", region = "biomes_brazil", sub_region = 5) ## End(Not run)
This function will plot the ccrop_zoning output. The result of the plotting will generate a plot with the following classes.
Climatic zoning classes:
ST: Suitable air temperature
RLT: Restricted due to low temperature
RHT: Restricted due to high temperature
ULT: Unsuitable due to low temperature
UHT: Unsuitable due to high temperature
plot_ccrop_zoning(zoning)
plot_ccrop_zoning(zoning)
zoning |
A stack generated in ccrop_zoning |
Returns a plot (ggplot object) with the monthly climate crop zoning based in air temperature.
### Data preparation ## Not run: ###ploting the cropzoning: zoning_plot <- plot_ccrop_zoning(zoning) ## End(Not run)
### Data preparation ## Not run: ###ploting the cropzoning: zoning_plot <- plot_ccrop_zoning(zoning) ## End(Not run)
This fuction will show the biomes available in the package and how we can call each biome polygon.
see_brazil_biomes()
see_brazil_biomes()
Returns a character strings listing the biomes available to run the cropZoning package.
## Not run: see_brazil_biomes() ## End(Not run)
## Not run: see_brazil_biomes() ## End(Not run)
This function will show the Brazilian state available in the package and how we can call each state polygon.
see_brazil_states()
see_brazil_states()
Returns a character strings listing the the Brazilian states available to run the cropZoning package.
## Not run: see_brazil_states() ## End(Not run)
## Not run: see_brazil_states() ## End(Not run)
This function will calibrate the maximum air temperature from TerraClimate dataset based in the relationship with observed weather stations data.The values of slope and intercept informed in example correspond a calibration performed between 'Terraclimate' images and INMET automatic weather stations realized for all the brazilian territory.
tmax_calibration(slope, intercept, tmax_stack)
tmax_calibration(slope, intercept, tmax_stack)
slope |
the slope of the linear regression (numeric) |
intercept |
the intercept of the linear regression (numeric) |
tmax_stack |
stack of maximum air temperature |
Returns a SpatRaster object of calibrated maximum air temperature.
## Not run: tmax_cal<- tmax_calibration(slope = 0.874787, intercept = 4.612894 , tmax_stack = tmax); ## End(Not run)
## Not run: tmax_cal<- tmax_calibration(slope = 0.874787, intercept = 4.612894 , tmax_stack = tmax); ## End(Not run)
This fuction will calculate the mean air temperature from minimum and maximum air temperature data.
tmean(tmax_stack, tmin_stack)
tmean(tmax_stack, tmin_stack)
tmax_stack |
stack of maximum air temperature |
tmin_stack |
stack of minimum air temperature |
Returns a SpatRaster object of mean air temperature.
## Not run: image_tmean <- tmean(tmax_stack = image_tmax, tmin_stack = image_tmin) ## End(Not run)
## Not run: image_tmean <- tmean(tmax_stack = image_tmax, tmin_stack = image_tmin) ## End(Not run)
This function will calculate the mean monthly air temperature based on the period of time selected (start_date and end_date).
tmean_monthly_stack(tmean_stack, start_date, end_date)
tmean_monthly_stack(tmean_stack, start_date, end_date)
tmean_stack |
Stack of mean air temperature based on minimum and maximum air temperature Rasterstack |
start_date |
Date that start the investigation, should be in the following format (1958-01-01 /Year-Month-Day) |
end_date |
Date that end the investigation, should be in the following format (2017-12-31 /Year-Month-Day) |
Returns a Rasterstack object with a monthly mean air temperature from a period of time.
## Not run: start_date <- c('2000-01-01') end_date <- c('2017-12-01') tmean_monthly <- tmean_monthly_stack(tmean_stack = img_tmean, start_date = start_date, end_date = end_date) ## End(Not run)
## Not run: start_date <- c('2000-01-01') end_date <- c('2017-12-01') tmean_monthly <- tmean_monthly_stack(tmean_stack = img_tmean, start_date = start_date, end_date = end_date) ## End(Not run)
This function will calibrate the minimum air temperature from TerraClimate dataset based in the relationship with observed weather stations data. The values of slope and intercept informed in example correspond a calibration performed between 'Terraclimate' images and INMET automatic weather stations realized for all the brazilian territory.
tmin_calibration(slope, intercept, tmin_stack)
tmin_calibration(slope, intercept, tmin_stack)
slope |
the slope of the linear regression (numeric) |
intercept |
the intercept of the linear regression (numeric) |
tmin_stack |
stack of maximum air temperature |
Returns a SpatRaster of calibrated minimum air temperature.
## Not run: tmin_cal<- tmin_calibrated(slope = 0.830652, intercept = 4.187840, tmin_stack = tmin); ## End(Not run)
## Not run: tmin_cal<- tmin_calibrated(slope = 0.830652, intercept = 4.187840, tmin_stack = tmin); ## End(Not run)