anomaly | R Documentation |
This function returns ocean data anomalies of a satin object. Anomalies are calculated subtracting a conforming average satin object.
anomaly(X, Y)
X |
a satin object obtained with |
Y |
also a satin object returned by |
The anomalies of a satin object represent, for every pixel, the values above and below a reference average. A typical example can be monthly sea surface temperature anomalies for various years. These are calculated subtracting the corresponding average month for the whole period (see example below).
In principle, anomalies can be calculated for other ocean variables and time periods, but is up to the user to determine if that makes sense. For example, let say that Z
is a satin object with daily chlorophyll-a concentration data for several years. In order to calculate quarterly anomalies, we will need first to obtain X <- satinMean(Z, "%Y-%qtr")
and Y <- satinMean(Z, "%qtr")
.
An object of class "satin"
(see satin-class
for details) where the third dimension in the data array accomodates the calculated anomalies. An extra element (labels
) is included in the slot attribs
to identify the time period of the anomalies.
Héctor Villalobos and Eduardo González-Rodríguez
satinMean
for calculating ocean data averages needed, and climatology
for climatologies.
if(interactive()){ # Calculate monthly sea surface temperature from weekly data. # sst contains 240 weekly images for five years. # This will produce the 12 average months for the five years sst.m <- satinMean(sst, by="%m") # and here we have 60 monthly periods, 12 for each one of the five years sst.ym <- satinMean(sst, by="%Y-%m") # monthly sea surface temperature anomalies anom <- anomaly(X = sst.ym, Y = sst.m) # the dimensions of the data slots in sst.ym and anom are the same. dim(sst.ym@data); dim(anom@data) # plots of the first 24 months lab <- paste(month.name, rep(2014:2018, each=12)) for (m in 1:24){ plot(anom, period = m, zlim=c(-10, 10), col.sep = 0.2, main = lab[m], scheme = c("blue", "cyan", "white", "yellow", "red")) } }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.