plot.satin: Visualise ocean data

View source: R/plot.satin.R

plot.satinR Documentation

Visualise ocean data

Description

Visual representation of ocean data from satellite images (MODIS, AVHRR, etc.) or derived from models (ocean productivity; CMEMS).

Usage

## S3 method for class 'satin'
plot(x, period = 1, depth = 1, xlim = NULL, ylim = NULL, zlim = NULL, 
           map = NULL, map.col = "grey", map.outline = "black", scheme = "default",
           col.sep = 0.1, colbar = TRUE, main = NULL, main.pos = "topright",
           log = FALSE, units = NULL,  xaxt = "s", yaxt = "s", atx = NULL, aty = NULL,
		   restore.par = TRUE, ...)

Arguments

x

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

period

an integer referring to the image number to plot.

depth

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

xlim

minimum and maximum longitude values for the map.

ylim

minimum and maximum latitude values for the map.

zlim

minimum and maximum ocean data values.

map

a user defined map of class "SpatialPolygons".

map.col

color for the map.

map.outline

color for the map outline.

scheme

color scheme for the ocean data, either: "default" or a vector of valid color names.

col.sep

separation between colors in data units.

colbar

logical. If TRUE a color bar is added to the map.

main

title for the map, defaults to the corresponding selected image period$tmStart in x.

main.pos

position for the title: "topright", "topleft", "bottomright" or "bottomleft".

log

logical. If TRUE, the ocean variable is log transformed (base 10). This is useful for chlorophyll concentration data.

units

color bar label, defaults to units in x.

xaxt, yaxt

"n" to supress axis.

atx, aty

specify tick-mark locations for fine tuning axes annotations.

restore.par

logical. If TRUE (the default), the graphical device is restored to its original state.

...

further arguments to pass to plot.

Details

The only mandatory argument for this function to produce a map is an object of class "satin" (x in this case). All the other arguments are optional and can be used to customize the plot. For chlorophyll concentration data, when log = TRUE, the color scale is fixed to a maximum value of 20, which implies that values above it are set to this maximum before applying logarithms. Using restore.par = FALSE to annotate plot, e.g. add isolines.

Value

A plot including a map, of the corresponding parameter is produced.

Author(s)

Héctor Villalobos

See Also

read.nasaoc, read.ghrsst, read.osunpp, and read.cmems

Examples

# SST data (Aqua Modis)
library(sp)
data(dsst, dmap) #load sample data and map

# default plot
plot(dsst)

# adding a custom map
plot(dsst, map = dmap)

# Chl-a concentration data (Aqua Modis) in actual units and in logarithmic scale
data(dchl)
plot(dchl, map = dmap, xlim = c(-120, -105), ylim = c(20, 35))
dev.new()
plot(dchl, map = dmap, xlim = c(-120, -105), ylim = c(20, 35), log = TRUE)  

# Copernicus data
data(dcmems)
plot(dcmems$thetao, map = dmap, period = 2, depth = 5)

satin documentation built on Sept. 23, 2022, 1:06 a.m.