View source: R/ExtremeAnoMap.R
| ExtremeAnoMap | R Documentation |
Based on the annual reference frequency distribution of a vegetation index time series (e.g. a RasterStack of NDVI), calculates anomalies and how extreme these anomalies are (rfd position ranging from 0 to 100).
ExtremeAnoMap(s, dates, h, refp, anop, rge, output = "both", rfd = 0, nCluster, outname, format, datatype)
s |
Raster stack. A time series of a vegetation index (e.g. LAI, NDVI, EVI) or any other variable with seasonal behaviour. |
dates |
A date vector. The number of dates must be equal to the number of layers of RasterStack. |
h |
Numeric. Indicates the geographic hemisphere to define the starting date of the growing season. h=1 if the vegetation is in the Northern Hemisphere (season starting at January 1st), h=2 if it is in the Southern Hemisphere (season starting at July 1st). |
refp |
Numeric vector with the correlative number of dates to be used as reference period. For example, refp=c(1:393) for MODIS Vegetation Index 16-days composites (18/02/2000 – 06/06/2017) |
anop |
Numeric vector with the correlative number of dates for the period in which the anomalies will be calculated. For example refp=c(21:43) for the first complete year for MODIS Vegetation Index 16-days composites (01/01/2001 – 19/12/2001). anop y refp can be overlapped |
rge |
Numeric vector containing minimum and maximum values of the response variable used in the analysis. We suggest the use of theoretically based limits. For example in the case of MODIS NDVI or EVI, it ranges from 0 to 10,000, so rge =c(0,10000). |
output |
Character string. Defines the output values. *'both'* (default) returns both anomalies and rfd position together as a single RasterStack, *'anomalies'* returns only anomalies, *'rfd'* returns only rfd values (how extreme the anomalies are) and *'clean'* returns only extreme anomalies, i.e. anomalies at which a given rfd is overpass (e.g. 95%). This critical threshold is set by the users using the rfd argument. |
rfd |
Numeric. The reference frequency distribution, determines if an anomaly falls outside the 95% (default) of the reference frequency distribution. For example a value that fall in a RFD >= 0.95, indicates that the detected anomaly belongs to the 5% of lowest values and is a potential negative anomalie. |
nCluster |
Numeric. Number of CPU cores to be used for computational calculations |
outname |
Character vector with the output path and filename with extension or only the filename and extension if work directory was set. For example outname="output_phen.tif". See |
format |
Character. Output file type. See |
datatype |
Character. Output data type. See |
Similar to ExtremeAnom, it calculates phenological anomalies but using a raster stack instead of a numeric vector of vegetation canopy greenness values (e.g. Leaf Area Index, LAI) or satellite based greenness proxies such as the Normalized Difference Vegetation Index (NDVI) or Enhanced Vegetation Index (EVI). For this purpose, it divides the time series (raster stack) of vegetation greeness into 2: the reference period, from which the annual phenological cycle is calculated (same as the Phen function), and the observation period, for which we want to calculate anomalies with respect to the annual phenological cycle. Negative anomalies correspond to observed values lower than the reference and positive anomalies to values higher than the reference. This anomalies are filtered by de rfd value set by the user.
RasterStack
ExtremeAnom
## Not run:
##DEPENDING ON HARDWARE, THIS PROCESS CAN BE HIGHLY TIME CONSUMING##
## Testing raster data from Central Chile (NDVI), Extreme browning##
# Load data
#RasterStack
data("MegaDrought_stack")
#Dates
data("dates")
library(snow)
# Define the number of cores to be use. In this example we use 1
nc1<-1
ExtremeAnoMap(s=MegaDrought_stack,dates=dates,h=2,refp = c(1:423),
anop = c(884:929),rfd = 0,output = 'both',nCluster=nc1,outname="anomRFD_MD.tif",
format="GTiff", datatype="INT2S", rge=c(0,10000))
#map_an1<-stack("anomRFD_MD.tif")#run only for load anomaly brick
#plot(map_an1)
## Testing raster data from Blooming desert, Northern Chile (NDVI), Extreme greening##
# Load data
RasterStack
data("Bdesert_stack")
#Dates
data("dates")
# Define the number of cores to be use. In this example we use 1
nc1<-1
ExtremeAnoMap(s=Bdesert_stack,dates=dates,h=2,refp = c(1:423),
anop = c(723:768),rfd = 0,output = 'both',nCluster=nc1,outname="anomRFD_BD.tif",
format="GTiff", datatype="INT2S", rge=c(0,10000))
#map_an1<-stack("anomRFD_BD.tif")#run only for load anomaly brick
#plot(map_an1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.