Learn R Programming

oce (version 0.9-17)

plot.landsat: Plot landsat data

Description

Plot landsat data.

Usage

## S3 method for class 'landsat':
plot(x, band, which=1, decimate=TRUE, zlim, utm=FALSE,
    col=oce.colorsPalette, showBandName=TRUE,
    alpha.f=1, red.f=2, green.f=2, blue.f=4,
    offset=c(0, 0, 0, 0),
    transform=diag(c(red.f, green.f, blue.f, alpha.f)),
    debug=getOption("oceDebug"), ...)

Arguments

x
A landsat object, e.g. as read by read.landsat.
band
if given, the name of the band. For Landsat-8 data, this may be one of: "aerosol", "blue", "green", "red", "nir", "swir1", "swir2", "panchromatic
which
desired plot type; 1=image, 2=histogram.
decimate
decimation passed to imagep for image plots. The default yields faster plotting. Some decimation is sensible for full-size images, since no graphical displays can show 16 thousand pixels o
zlim
either a pair of numbers giving the limits for the colourscale, or "histogram" to have a flattened histogram (i.e. to maximally increase contrast throughout the domain.) If not given, the 1 and 99 percent quantiles are calc
utm
logical indicating whether to use UTS (easting and northing) instead of longitude and latitude on plot
col
either a function yielding colours, taking a single integer argument with the desired number of colours, or the string "natural", which combines the information in the red, green and blue
showBandName
if TRUE, the band name is plotted in the top margin, near the right-hand side.
alpha.f
argument used if col="natural", to adjust colours with adjustcolor
red.f
argument used if col="natural", to adjust colours with adjustcolor. Higher values of red.f cause red hues to be emphasized (e.g. dry land).
green.f
argument used if col="natural", to adjust colours with adjustcolor. Higher values of green.f emphasize green hues (e.g. forests).
blue.f
argument used if col="natural", to adjust colours with adjustcolor. Higher values of blue.f emphasize blue hues (e.g. ocean).
offset
argument used if col="natural", to adjust colours with adjustcolor
transform
argument used if col="natural", to adjust colours with adjustcolor
debug
set to a positive value to get debugging information during processing.
...
optional arguments passed to plotting functions.

Details

Since landsat images are very detailed, it is sensible to use a fast plotting device, e.g. x11, and to set values of decimate appropriate to the data and plotting device. Using zlim="histogram" is probably the fastest way to explore an image for detail, but it is important to bear in mind that it yields a nonlinear colourscale.

The histogram plot can be handy in setting scales, e.g. when an image has a fair bit of land, the histogram will be double-lobed, and so quick examination can help in setting a good value for zlim to emphasize the water or the land. If breaks is present in ... then its value is used in the call to hist; if not, 100 is used.

Setting band="temperature" plots an estimate of temperature, calculated as explained in the documentation for landsat-class.

Setting band="terralook" creates a colour scale that tends to make the ocean blue and forests green. This uses the USGS ``terralook'' method (reference 1) of combining the red, green and nir bands, producing new pseudo colors defined as R=red, G=2/3*green+1/3*nir and B=2/3*green-1/3*nir. For obvious reasons, this requires that the image contains these three channels. If band="terralook" the col argument is ignored, because an internal colour scheme is used. Still, this scheme may be altered through the use of the arguments red.f, etc.; their action is described in the documentation for adjustcolor but users can get good results just by altering the default values and seeing the results, e.g. increasing blue.f makes water bluer.

References

1. http://terralook.cr.usgs.gov/what_is_terralook.php

See Also

The documentation for landsat-class explains the structure of landsat objects, and also outlines the other functions dealing with them. The ocedata package provides a dataset named landsat.

Examples

Run this code
library(oce)
library(ocedata)
data(landsat)
plot(landsat, band="temperature")
plot(landsat, which=2, band="temperature", breaks=100)

Run the code above in your browser using DataLab