Learn R Programming

satin (version 1.1.0)

climatology: Climatology of a satin object

Description

This function calculates the percent coverage, mean, standard deviation, minimum and maximum for every pixel in a set of images stored in a single satin data object.

Usage

climatology(X, depth = NULL)

Value

An object of class "satin" (see satin-class for details) where the third dimension in the data array accomodates coverage, mean, standard deviation, minimum and maximum. Also, an extra element (label) is included in the slot attribs to summarize the start and end times used for the climatology.

Arguments

X

a satin object as returned by read.nasaoc, read.ghrsst, read.osunpp, or read.cmems.

depth

an integer referring to a given depth level. Only meaningful for Copernicus data that includes variables at different depths.

Author

Héctor Villalobos and Eduardo González-Rodríguez

Details

For Copernicus data files containing more than one variable, the read.cmems function returns a named list, with elements corresponding to each variable. In order to use these objects with climatology the appropriate indexing should be applied (see examples below).

Examples

Run this code
if(interactive()){
csst <- climatology(sst) # sst is a satin object with 12 monthly images 
                         # of sea surface temperature

# -- plots --

# coverage
plot(csst, period = 1)

# mean
plot(csst, period = 2)

# standard deviation
plot(csst, period = 3)

# minimum
plot(csst, period = 4)

# maximum
plot(csst, period = 5)
}
# For Copernicus data
# \donttest{
data(dcmems) # load sample data
names(dcmems) # available variables 

# mean potential temperature (thetao) at 0.49 m
# using labels stored in slot period
cthetao1 <- climatology(dcmems$thetao, depth = 1)
plot(cthetao1, period = 2, main = cthetao1@period$label[2])

# standard deviation of thetao at 318 m
cthetao2 <- climatology(dcmems$thetao, depth = 5)
plot(cthetao2, period = 3, main = cthetao1@period$label[3])
# }

Run the code above in your browser using DataLab