Package `satellite`

Package ‘satellite’
August 29, 2016
Type Package
Title Various Functions for Handling and Manipulating Remote Sensing
Data
Version 0.2.0
Date 2015-09-10
Author Thomas Nauss, Hanna Meyer, Florian Detsch, Tim Appelhans
Maintainer Tim Appelhans
<[email protected]>
Description This smorgasbord provides a variety of functions which are useful
for handling, manipulating and visualizing remote sensing data.
Depends R (>= 2.10), raster, Rcpp (>= 0.10.3), methods, utils, stats,
grDevices, graphics
Imports plyr, tools, stats4
License GPL-3
Suggests devtools, knitr, rgdal, testthat
LazyData true
VignetteBuilder knitr
LinkingTo Rcpp
NeedsCompilation yes
Repository CRAN
Date/Publication 2015-09-10 16:34:53
R topics documented:
satellite-package
alignGeometry .
brick . . . . . . .
calcAtmosCorr .
calcDODN . . .
calcEarthSunDist
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2
3
4
5
7
8
2
satellite-package
calcHistMatch . . . . .
calcPathRadDOS . . .
calcTOAIrradModel . .
calcTOAIrradRadRef .
calcTOAIrradTable . .
calcTopoCorr . . . . .
compFilePathLandsat .
compMetaLandsat . . .
convDN2RU . . . . . .
convRad2BT . . . . .
convRad2Ref . . . . .
convRef2RadLinear . .
convSC2Rad . . . . .
convSC2Ref . . . . . .
crop . . . . . . . . . .
demTools . . . . . . .
deprecated . . . . . . .
l7 . . . . . . . . . . .
l8 . . . . . . . . . . .
lutInfo . . . . . . . . .
maskInvarFeatures . .
names . . . . . . . . .
panSharp . . . . . . .
pck_data . . . . . . . .
pck_lut . . . . . . . .
plot . . . . . . . . . .
projectSatellite . . . .
satellite . . . . . . . .
Satellite-class . . . . .
SatelliteInfo-class . . .
SatelliteLayers-class .
SatelliteLog-class . . .
SatelliteMetaData-class
satInfo . . . . . . . . .
stack . . . . . . . . . .
subset . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Index
satellite-package
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
9
11
14
15
17
18
19
20
21
23
24
25
26
27
28
30
31
32
32
33
35
36
37
39
39
39
40
41
42
42
43
43
43
44
49
50
51
Smorgasboard for remote sensing functions.
Description
Smorgasboard for remote sensing functions
alignGeometry
3
Details
The package provides a variety of functions which are useful for handling, manipulating and visualizing remote sensing data.
Author(s)
Thomas Nauss, Hanna Meyer, Florian Detsch, Tim Appelhans
Maintainer: Environmental Informatics <[email protected]>
References
Some functions are taken and/or adopted from Sarah C. Goslee (2011). Analyzing Remote Sensing
Data in R: The landsat Package. Journal of Statistical Software, 43(4), 1-25. Online available at
http://www.jstatsoft.org/v43/i04/.
alignGeometry
Align raster geometry between two data sets
Description
Align raster data by bringing it in the same geometry and extent. If the data set is not in the same
projection as the template, the alignment will be computed by reprojection. If the data has already
the same projection, the data set will be cropped and aggregated prior to resampling in order to
reduce computation time.
Usage
## S4 method for signature 'Satellite'
alignGeometry(x, template, band_codes, type,
method = c("bilinear", "ngb"))
## S4 method for signature 'RasterStack'
alignGeometry(x, template, method = c("bilinear",
"ngb"))
## S4 method for signature 'RasterLayer'
alignGeometry(x, template, method = c("bilinear",
"ngb"))
Arguments
x
Satellite or Raster* object to be resampled.
template
Raster* or spatial data set from which geometry can be extracted.
band_codes
Band ID(s) to be resampled. If not supplied and type is not given, too, all bands
will be considered for resampling.
4
brick
type
Type of bands (e.g. VIS, NIR) which should be considered. If not supplied, all
types will be processed depending and bands to be processed can be defined by
band_codes.
method
Method for resampling; "bilinear" for bilinear interpolation (default) or "ngb"
for nearest neighbor interpolation. See e.g. resample, projectRaster.
Value
Satellite object with alligned geometries.
raster::RasterStack object with alligned layers
raster::RasterLayer object with alligned layer
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
alignGeometry(sat, template = getSatDataLayer(sat, "B008n"),
band_codes = "B001n")
brick
convert selected layers of a Satellite object to a RasterBrick
Description
Convert selected layers of a Satellite object to a RasterBrick
Usage
## S4 method for signature 'Satellite'
brick(x, layer = names(x), ...)
Arguments
x
an object of class ’Satellite’
layer
character vector (bcde codes) or integer vector (index) of the layers to be stacked
...
additional arguments passed on to brick
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
brck <- brick(sat, c("B001n", "B002n", "B003n"))
brck
calcAtmosCorr
calcAtmosCorr
5
Atmospheric correction of remote sensing data
Description
The function computes an atmospheric scattering correction and converts the sensors digital numbers to reflectances using
• absolute radiance correction
• DOS2: a dark object substraction model by Chavez (1996)
• DOS4: a dark object substratcion model by Moran et al. (1992)
Usage
## S4 method for signature 'Satellite'
calcAtmosCorr(x, model = c("DOS2", "DOS4"),
esun_method = "RadRef")
## S4 method for signature 'RasterStack'
calcAtmosCorr(x, path_rad, esun, szen,
model = c("DOS2", "DOS4"))
## S4 method for signature 'RasterLayer'
calcAtmosCorr(x, path_rad, esun, szen,
model = c("DOS2", "DOS4"))
Arguments
x
Satellite or Raster* object providing the radiance at the sensor.
model
Model to be used to correct for 1% scattering (DOS2, DOS4).
esun_method
If x is a Satellite object, name of the method to be used to compute esun using one of calcTOAIrradRadRef ("RadRef"), calcTOAIrradTable ("Table")
or calcTOAIrradModel ("Model").
path_rad
Path radiance, e.g. returned from calcPathRadDOS.
esun
Actual (i.e. non-normalized) TOA solar irradiance, e.g. returned from calcTOAIrradRadRef,
calcTOAIrradTable or calcTOAIrradModel.
szen
Sun zenith angle.
Details
If a Satellite object is passed to the function, and if the required pre-processing has not been performed already, the path radiance is computed based on a dark object’s scaled count value using
calcPathRadDOS which will also take care of the TOA solar irradiance by calling calcTOAIrradModel,
calcTOAIrradRadRef or calcTOAIrradTable (depending on esun_method) if necessary. The
bands’ scaled counts are converted to radiance using convSC2Rad.
6
calcAtmosCorr
The radiometric correction is based on a dark object approach using either the DOS2 (Chavez 1996)
or DOS4 (Moran et al. 1992) model.
The minimum reflectance values for the dark object are identified using the approximation of
Chavez (1988, see calcPathRadDOS for details).
The estimated values of the solar irradiance required for the path radiance can be computed by one
of calcTOAIrradTable which is used to get readily published values of ESun, calcTOAIrradRadRef
which computes ESun based on the actual radiance and reflectance in the scene, or calcTOAIrradModel
which computes ESun based on look-up tables for the sensor’s relative spectral response and solar
irradiation spectral data.
The atmospheric transmittance towards the sensor (Tv) is approximated by 1.0 (DOS2, Chavez
1996) or Rayleigh scattering (DOS4, Moran et al. 1992).
The atmospheric transmittance from the sun (Tz) is approximated by the cosine of the sun zenith
angle (DOS2, Chavez 1996) or again using Rayleigh scattering (DOS4, Moran et al. 1992).
The downwelling diffuse irradiance is approximated by 0.0 (DOS2, Chavez 1996) or the hemispherical integral of the path radiance (DOS4, Moran et al. 1992).
Equations are taken from Song et al. (2001).
Value
Satellite object with added atmospheric corrected layers
raster::RasterStack object with atmospheric corrected layers
raster::RasterLayer object with atmospheric corrected layer
References
Chavez Jr PS (1988) An improved dark-object subtraction technique for atmospheric scattering correction of multispectral data. Remote Sensing of Environment 24/3, doi:10.1016/0034-4257(88)900193, available online at http://www.sciencedirect.com/science/article/pii/0034425788900193
Chavez Jr PS (1996) Image-based atmospheric corrections revisited and improved. Photogrammetric Engineering and Remote Sensing 62/9, available online at http://www.asprs.org/PE-RS-Journals-1996/
PE-RS-September-1996.html
Goslee SC (2011) Analyzing Remote Sensing Data in R: The landsat Package. Journal of Statistical
Software,43/4, 1-25. URL http://www.jstatsoft.org/v43/i04/.
Moran MS, Jackson RD, Slater PN, Teillet PM (1992) Evaluation of simplified procedures for
retrieval of land surface reflectance factors from satellite sensor output.Remote Sensing of Environment 41/2-3, 169-184, doi:10.1016/0034-4257(92)90076-V, URL http://www.sciencedirect.
com/science/article/pii/003442579290076V.
Song C, Woodcock CE, Seto KC, Lenney MP, Macomber SA (2001) Classification and Change Detection Using Landsat TM Data: When and How to Correct Atmospheric Effects? Remote Sensing
of Environment 75/2, doi:10.1016/S0034-4257(00)00169-3, URL http://www.sciencedirect.
com/science/article/pii/S0034425700001693
calcDODN
7
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
sat_atmos <- calcAtmosCorr(sat, model = "DOS2", esun_method = "RadRef")
bcde <- "B002n"
sat <- calcTOAIrradRadRef(sat, normalize = FALSE)
path_rad <- calcPathRadDOS(x = min(getValues(getSatDataLayer(sat, bcde))),
bnbr = getSatLNBR(sat, bcde),
band_wls =
data.frame(LMIN =
getSatLMIN(sat,
getSatBCDESolar(sat)),
LMAX =
getSatLMAX(sat,
getSatBCDESolar(sat))),
radm = getSatRADM(sat, getSatBCDESolar(sat)),
rada = getSatRADA(sat, getSatBCDESolar(sat)),
szen = getSatSZEN(sat, getSatBCDESolar(sat)),
esun = getSatESUN(sat, getSatBCDESolar(sat)),
model = "DOS2")
sensor_rad <- convSC2Rad(x = getSatDataLayer(sat, bcde),
mult = getSatRADM(sat, bcde),
add = getSatRADA(sat, bcde), getSatSZEN(sat, bcde))
ref_atmos <- calcAtmosCorr(x = sensor_rad,
path_rad = path_rad[names(path_rad) == bcde],
esun = getSatESUN(sat, bcde),
szen = getSatSZEN(sat, bcde),
model = "DOS2")
calcDODN
Compile dark object DN for given sensor band
Description
The function estimates the DN value of a "dark object" which is used for atmospheric correction
using the DOS2 and DOS4 model. Therefore, the frequency distribution of the smallest 1% of the
data values is analyzed and the value for which the first derivate has the absolute maximum is taken
as the DN for a dark object.
Usage
calcDODN(band)
8
calcEarthSunDist
Arguments
band
raster::RasterLayer with sensor band data, e.g. returned by getSatDataLayer.
Details
The DN for a dark object is extracted from a histogram similar to Chavez (1988).
Value
Numeric value of the DN for the dark object.
References
Chavez Jr PS (1988) An improved dark-object subtraction technique for atmospheric scattering correction of multispectral data. Remote Sensing of Environment 24/3, doi:10.1016/0034-4257(88)900193, available online at http://www.sciencedirect.com/science/article/pii/0034425788900193
See Also
The DN is used by calcPathRadDOS for computing the path radiance based on the dark object
method.
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
calcDODN(getSatDataLayer(sat, bcde = "B002n"))
calcEarthSunDist
Compute earth-sun distance based on day of the year
Description
The earth-sun distance for a particular day of the year is computed based on one of several empirical
formulas.
Usage
calcEarthSunDist(date, formula = c("Spencer", "Mather", "ESA"))
Arguments
date
Date of the sensor overpass; either a character string in a native date format (e.g.
"YYYY-MM-DD", see as.Date) or a POSIX* object (see as.POSIXct).
formula
Formula to be applied, specified through the name of the author, i.e. one of
"Spencer", "Mather" or "ESA".
calcHistMatch
9
Details
Computation of earth-sun distance using formulas provided by Spencer (1971), Mather (2005) or
ESA.
Value
Numeric earth-sun distance (in AU).
References
The formulas are taken from the following sources:
• Spencer: Spencer JW (1971) Fourier series representation of the position of the sun. Search
2/5. Taken from https://goo.gl/lhi9UI.
• Mather: Paul M. Mather (2005) Computer Processing of Remotely-Sensed Images: An Introduction. Wiley, ISBN: 978-0-470-02101-9, http://eu.wiley.com/WileyCDA/WileyTitle/
productCd-0470021012.html.
• ESA: ESA Earth Observation Quality Control: Landsat frequently asked questions.
See also: Bird R, Riordan C (1984) Simple solar spectral model for direct and diffuse irradiance on
horizontal and tilted planes at the Earth’s surface for cloudless atmospheres. http://www.nrel.
gov/docs/legosti/old/2436.pdf.
Examples
calcEarthSunDist(date = "2015-01-01", formula = "Spencer")
calcHistMatch
Illumination correction across scenes using histogram matching
Description
This function adjusts the illumination of individual bands across two scenes using a histogram
match.
Usage
## S4 method for signature 'Satellite'
calcHistMatch(x, target, bcde = NULL, minv = 0L,
maxv = 1023L, use_cpp = TRUE)
## S4 method for signature 'RasterStack'
calcHistMatch(x, target, minv = 0L, maxv = 1023L,
use_cpp = TRUE)
## S4 method for signature 'RasterLayer'
calcHistMatch(x, target, minv = 0L, maxv = 1023L,
use_cpp = TRUE)
10
calcHistMatch
Arguments
x
Satellite or raster::Raster* object providing the source band(s) to be adjusted.
target
The target band as raster::RasterLayer.
bcde
Band code which should be alligned
minv
Lower limit of the possible range for transformation (if not provided, defaults to
the minimum of both layers).
maxv
Upper limit of the possible range for transformation (if not provided, defaults to
the maximum of both layers).
use_cpp
Logical. If TRUE, C++ functionality (via Rcpp) is enabled, which leads to a
considerable reduction of both computation time and memory usage.
Details
The function is based on a histogram matching technique described by Morovic et al. (2002).
Value
Satellite object with added atmospheric corrected layers
raster::RasterStack object with atmospheric corrected layers
raster::RasterLayer object with atmospheric corrected layer
References
Morovic J, Shaw J, Sun P-L (2002) A fast, non-iterative and exact histogram matching algorithm.
Pattern Recognition Letters 23/1-3: 127-135, doi:10.1016/S0167-8655(01)00107-6.
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
target <- getSatDataLayer(sat, "B003n")
## Not run:
## histogram matching
calcHistMatch(sat, target, bcde = "B002n")
## End(Not run)
calcPathRadDOS
calcPathRadDOS
11
Compute path radiance based on the dark object method
Description
Compute an estimated path radiance for all sensor bands, which can then be used to roughly correct
the radiance values for atmospheric scattering. Path radiance estimation is based on a dark object
method.
Usage
## S4 method for signature 'Satellite'
calcPathRadDOS(x, model = c("DOS2", "DOS4"),
esun_method = "RadRef", use_cpp = TRUE)
## S4 method for signature 'numeric'
calcPathRadDOS(x, bnbr, band_wls, radm, rada, szen, esun,
model = c("DOS2", "DOS4"), scat_coef = c(-4, -2, -1, -0.7, -0.5),
dos_adjust = 0.01, use_cpp = TRUE)
Arguments
x
A Satellite object or the value (scaled count) of a dark object in bnbr (e.g. minimum raw count of selected raster bnbr). If x is a Satellite object, the value is
computed using calcDODN.
model
Model to be used to correct for 1% scattering (DOS2, DOS4; must be the same
as used by calcAtmosCorr).
esun_method
If x is a Satellite object, name of the method to be used to compute esun using one of calcTOAIrradRadRef ("RadRef"), calcTOAIrradTable ("Table")
or calcTOAIrradModel ("Model")
use_cpp
Logical. If TRUE, C++ functionality (via Rcpp) is enabled, which leads to a
considerable reduction of both computation time and memory usage.
bnbr
Band number for which DNmin is valid.
band_wls
Band wavelengths to be corrected; data.frame with min (max) in first (second)
column, see details.
radm
Multiplicative coefficient for radiance transformation (i.e. slope).
rada
Additive coefficient for radiance transformation (i.e. offset).
szen
Sun zenith angle.
esun
Actual (i.e. non-normalized) TOA solar irradiance, e.g. returned by calcTOAIrradRadRef,
calcTOAIrradTable or calcTOAIrradModel.
scat_coef
Scattering coefficient; defaults to -4.0.
dos_adjust
Assumed reflection for dark object adjustment; defaults to 0.01.
12
calcPathRadDOS
Details
If x is a Satellite object, the minimum raw count value (x) is computed using calcDODN. If the TOA
solar irradiance is not part of the Satellite object’s metadata, it is computed using calcTOAIrradRadRef,
calcTOAIrradTable or calcTOAIrradModel.
The dark object subtraction approach is based on an approximation of the atmospheric path radiance
(i.e. upwelling radiation which is scattered into the sensors field of view, aka haze) using the
reflectance of a dark object (i.e. reflectance ~1%).
Chavez (1988) proposed a method which uses the dark object reflectance in one band to predict the
corresponding path radiances in all other band_wls. This is done using a relative radiance model
which depends on the wavelength and overall atmospheric optical thickness (which is estimated
based on the dark object’s DN value). This has the advantage that the path radiance is actually
correlated across different sensor band_wls and not computed individually for each band using
independent dark objects. He proposed a relative radiance model which follows a wavelength dependent scattering that ranges from a power of -4 over -2, -1, -0.7 to -0.5 for very clear over clear,
moderate, hazy to very hazy conditions. The relative factors are computed individually for each
1/1000 wavelength within each band range and subsequently averaged over the band as proposed
by Goslee (2011).
The atmospheric transmittance towards the sensor (Tv) is approximated by 1.0 (DOS2, Chavez
1996) or Rayleigh scattering (DOS4, Moran et al. 1992)
The atmospheric transmittance from the sun (Tz) is approximated by the cosine of the sun zenith
angle (DOS2, Chavez 1996) or again using Rayleigh scattering (DOS4, Moran et al. 1992).
The downwelling diffuse irradiance is approximated by 0.0 (DOS2, Chavez 1996) or the hemispherical integral of the path radiance (DOS4, Moran et al. 1992).
Equations for the path radiance are taken from Song et al. (2001).
For some sensors, the band wavelengths are already included. See lutInfo()[grepl("_BANDS", names(lutInfo()$META))
if your sensor is included. To retrieve a sensor, use lutInfo()$<Sensor ID>_BANDS.
Value
Satellite object with path radiance for each band in the metadata (W m-2 micrometer-1)
Vector object with path radiance values for each band (W m-2 micrometer-1)
References
Chavez Jr PS (1988) An improved dark-object subtraction technique for atmospheric scattering correction of multispectral data. Remote Sensing of Environment 24/3, doi:10.1016/0034-4257(88)900193, available online at http://www.sciencedirect.com/science/article/pii/0034425788900193.
Chavez Jr PS (1996) Image-based atmospheric corrections revisited and improved. Photogrammetric Engineering and Remote Sensing 62/9, available online at http://www.asprs.org/PE-RS-Journals-1996/
PE-RS-September-1996.html.
Goslee SC (2011) Analyzing Remote Sensing Data in R: The landsat Package. Journal of Statistical
Software,43/4, 1-25, available online at http://www.jstatsoft.org/v43/i04/.
Moran MS, Jackson RD, Slater PN, Teillet PM (1992) Evlauation of simplified procedures for
rretrieval of land surface reflectane factors from satellite sensor output.Remote Sensing of Environment 41/2-3, 169-184, doi:10.1016/0034-4257(92)90076-V, available online at http://www.
sciencedirect.com/science/article/pii/003442579290076V.
calcPathRadDOS
13
Song C, Woodcock CE, Seto KC, Lenney MP, Macomber SA (2001) Classification and Change
Detection Using Landsat TM Data: When and How to Correct Atmospheric Effects? Remote
Sensing of Environment 75/2, doi:10.1016/S0034-4257(00)00169-3, available online at http://
www.sciencedirect.com/science/article/pii/S0034425700001693
If you refer to Sawyer and Stephen 2014, please note that eq. 5 is wrong.
See Also
This function is used by calcAtmosCorr to compute the path radiance.
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
sat <- calcTOAIrradModel(sat)
bcde <- "B002n"
sat <- calcTOAIrradRadRef(sat, normalize = FALSE)
## performance of base-R
system.time(
val1 <- calcPathRadDOS(x = min(getValues(getSatDataLayer(sat, bcde))),
bnbr = getSatLNBR(sat, bcde),
band_wls = data.frame(LMIN = getSatLMIN(sat, getSatBCDESolar(sat)),
LMAX = getSatLMAX(sat, getSatBCDESolar(sat))),
radm = getSatRADM(sat, getSatBCDESolar(sat)),
rada = getSatRADA(sat, getSatBCDESolar(sat)),
szen = getSatSZEN(sat, getSatBCDESolar(sat)),
esun = getSatESUN(sat, getSatBCDESolar(sat)),
model = "DOS2",
scat_coef = -4, use_cpp = FALSE)
)
## and Rcpp version
system.time(
val2 <- calcPathRadDOS(x = min(getValues(getSatDataLayer(sat, bcde))),
bnbr = getSatLNBR(sat, bcde),
band_wls = data.frame(LMIN = getSatLMIN(sat, getSatBCDESolar(sat)),
LMAX = getSatLMAX(sat, getSatBCDESolar(sat))),
radm = getSatRADM(sat, getSatBCDESolar(sat)),
rada = getSatRADA(sat, getSatBCDESolar(sat)),
szen = getSatSZEN(sat, getSatBCDESolar(sat)),
esun = getSatESUN(sat, getSatBCDESolar(sat)),
model = "DOS2",
scat_coef = -4, use_cpp = TRUE)
)
14
calcTOAIrradModel
calcTOAIrradModel
Compute top of atmosphere solar irradiance for sensor bands using
LUTs
Description
Compute mean extraterrestrial solar irradiance (ESun) using tabulated mean solar spectral data and
the band specific relative spectral response (rsr) functions.
Usage
## S4 method for signature 'Satellite'
calcTOAIrradModel(x, model = "MNewKur",
normalize = TRUE, esd)
## S4 method for signature 'data.frame'
calcTOAIrradModel(x, model = "MNewKur",
normalize = TRUE, esd)
Arguments
x
A Satellite object or the relative spectral response function for the respective
band as data.frame (see details for structure).
model
Tabulated solar radiation model to be used (one of MCebKur_MChKur, MNewKur,
MthKur, MoldKur, MODWherli_WMO, NN, see reference on tabulated solar irradiance below).
normalize
Logical; if TRUE, ESun is normalized to mean earth-sun distance.
esd
Earth-sun distance (AU, can be estimated using calcEarthSunDist). If x is
a Satellite object and esd is not supplied and necessary for normalization, it is
tried to take it from the metadata, otherwise it is estimated by the day of the year
using calcEarthSunDist.
Details
Computation of ESun is taken from Updike and Comp (2011).
Tabulated values for mean earth-sun distance are taken from the data sources mentioned in the
references.
If results should not be normalized to a mean earth-sun distance, the actual earth-sun distance is
approximated by the day of the year using calcEarthSunDist.
Relative spectral response values have to be supplied as a data.frame which has at least the following three columns: (i) a column "Band" for the sensor band number (i.e. 1, 2, etc.), (ii) a column
"WAVELENGTH" for the WAVELENGTH data in full nm steps, and (iii) a column "RSR" for the
response information [0...1].
calcTOAIrradRadRef
15
Value
If x is a satellite object, a Satellite object with ESun information added to the metadata; if x is a
data.frame, a vector containing ESun for the respective band(s).
References
Updike T, Comp C (2011) Radiometric use of WorldView-2 imagery. Technical Note, available
online at https://goo.gl/np4Bwm.
Tabulated relative spectral response functions (nm-1) are taken from taken from the spectral viewer
of the USGS Landsat FAQ.
Tabulated solar irradiance (W m-2 nm-1) is taken from the National Renewable Energy Laboratory.
See Also
calcTOAIrradTable for tabulated solar irradiance values from the literature or calcTOAIrradRadRef
for the computation of the solar irradiance based on maximum radiation and reflection values of the
dataset.
See calcEarthSunDist for calculating the earth-sun distance based on the day of the year which is
called by this function if ESun should be corrected for actual earth-sun distance.
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
sat <- calcTOAIrradModel(sat)
getSatESUN(sat)
lut <- lutInfo()
calcTOAIrradModel(lut$L8_RSR, model = "MNewKur", normalize = FALSE,
esd = calcEarthSunDist("2015-01-01"))
calcTOAIrradRadRef
Compute top of atmosphere solar irradiance using radiation vs. reflection
Description
Compute extraterrestrial solar irradiance (ESun) using the actual maximum radiation and reflection
values within each band.
Usage
## S4 method for signature 'Satellite'
calcTOAIrradRadRef(x, normalize = TRUE, esd)
## S4 method for signature 'numeric'
calcTOAIrradRadRef(x, ref_max, normalize = TRUE, esd)
16
calcTOAIrradRadRef
Arguments
x
A Satellite object or the maximum radiance of satellite band(s) as numeric object.
normalize
Logical; if TRUE, ESun is normalized to mean earth-sun distance.
esd
Earth-sun distance (AU, can be estimated using calcEarthSunDist). If x is
a Satellite object and esd is not supplied and necessary for normalization, it is
tried to take it from the metadata, otherwise it is estimated by the day of the year
using calcEarthSunDist.
ref_max
Maximum reflextance of satellite band(s).
Details
The actual solar irradiance is computed using the following formula taken from the GRASS GIS
i.landsat.toar module
ESun = (pid2 )RADIAN CEM AXIM U M/REF LECT AN CEM AXIM U M
where d is the earth-sun distance (in AU) and RADIANCE_MAXIMUM and REFLECTANCE_MAXIMUM
are the maximum radiance and reflection values of the respective band. All these parameters are
taken from the scene’s metadata file if a Satellite object is passed to the function.
By default, the resulting actual ESun will be normalized to a mean earth-sun distance to be compatible with other default results from calcTOAIrradTable or calcTOAIrradModel.
Value
If x is a Satellite object, a Satellite object with ESun information added to the metadata; if x is
numeric, a vector containing ESun for the respective band(s).
See Also
calcTOAIrradTable for tabulated solar irradiance values from the literature or calcTOAIrradModel
for the computation of the solar irradiance based on look-up tables for the sensor’s relative spectral
response and solar irradiation spectral data.
See calcEarthSunDist for calculating the earth-sun distance based on the day of the year which is
called by this function if ESun should be corrected for actual earth-sun distance.
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
sat <- calcTOAIrradModel(sat)
getSatESUN(sat)
calcTOAIrradRadRef(x = getSatRadMax(sat, getSatBCDESolar(sat)),
ref_max = getSatRefMax(sat, getSatBCDESolar(sat)),
normalize = FALSE,
esd = calcEarthSunDist("2015-01-01"))
calcTOAIrradTable
calcTOAIrradTable
17
Get top of atmosphere solar irradiance using readily tabulated values
Description
Get mean extraterrestrial solar irradiance (ESun) using published values.
Usage
## S4 method for signature 'Satellite'
calcTOAIrradTable(x, normalize = TRUE, esd)
## S4 method for signature 'factor'
calcTOAIrradTable(x, normalize = TRUE, esd)
## S4 method for signature 'character'
calcTOAIrradTable(x, normalize = TRUE, esd)
Arguments
x
normalize
esd
A Satellite object or sensor id ("LC4/5/7") as character.
Logical; if TRUE, ESun is normalized to mean earth-sun distance.
Earth-sun distance (AU, can be estimated using calcEarthSunDist). If x is
a Satellite object and esd is not supplied and necessary for normalization, it is
tried to take it from the metadata, otherwise it is estimated by the day of the year
using calcEarthSunDist.
Details
Currently implemented sensors are Landsat 4, 5 and 7.
If results should not be normalized to a mean earth-sun distance, the actual earth-sun distance is
approximated by the day of the year using calcEarthSunDist.
Value
Satellite object with ESun information added to the metadata
Vector object containing ESun for the respective band(s)
Vector object containing ESun for the respective band(s)
References
Tabulated values of the solar irradiance for Landsat 4 and 5 are taken from Chander G, Markham
B (2003) Revised Landsat-5 TM radiometric calibration procedures and postcalibration dynamic
ranges. IEEE Transactions on Geoscience and Remote Sensing 41/11, doi:10.1109/LGRS.2007.898285,
online available at http://landsathandbook.gsfc.nasa.gov/pdfs/L5TMLUTIEEE2003.pdf.
Tabulated values of the solar irradiance for Landsat 7 are taken from NASA’s Landsat7 handbook,
tab 11.3 (Thuillier spectrum).
18
calcTopoCorr
See Also
calcTOAIrradRadRef for the computation of the solar irradiance based on maximum radiation and
reflection values of the dataset or calcTOAIrradModel for the computation of the solar irradiance
based on look-up tables for the sensor’s relative spectral response and solar irradiation spectral data.
See calcEarthSunDist for calculating the earth-sun distance based on the day of the year which is
called by this function if ESun should be corrected for actual earth-sun distance.
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LE7*.tif"), full.names = TRUE)
sat <- satellite(files)
calcTOAIrradTable(sat)
calcTOAIrradTable(x = "LE7", normalize = FALSE,
calcEarthSunDist("2015-01-01"))
calcTopoCorr
Correct for topographic effects.
Description
Correct for topographic effects.
Usage
## S4 method for signature 'Satellite'
calcTopoCorr(x, mask = TRUE)
## S4 method for signature 'RasterStack'
calcTopoCorr(x, hillsh, cloudmask = NULL)
## S4 method for signature 'RasterLayer'
calcTopoCorr(x, hillsh, cloudmask = NULL)
Arguments
x
Satellite object.
mask
Logical. If TRUE, the cloudmask from the Satellite object (if available) will be
considered in the regression model.
hillsh
A raster::RasterLayer created with raster::hillShade.
cloudmask
A raster::RasterLayer in which clouds are masked with NA values.
compFilePathLandsat
19
Details
The method of Civco (1989) is applied on atmospherically corrected bands (if not already available
in the Satellite object, calcAtmosCorr is performed with its default settings.): First, an analytical
hillshade image is created based on a DEM and sun elevation and sun zenith information from
the metadata. A regression between the hillshade (independent variable) and each channel is then
calculated with consideration of a cloudmask (if available). The regression coefficents are used to
calibrate the hillshade raster (for each channel individually). Finally, the calibrated hillshade image
is subtracted from the corresponding channel and the mean value of the channel is added.
Value
If x is a Satellite object, a Satellite object with added, topographic corrected layers; if x is a
raster::Raster* object, a raster::Raster* object with converted layer(s).
References
CIVCO, D.L. (1989): Topographic normalization of Landsat Thematic Mapper digitalimagery.
Photogrammetric Engineering & Remote Sensing, 55, 1303-1309.
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
## dem
files_dem <- list.files(path, pattern = "DEM", full.names = TRUE)
DEM <- raster(files_dem)
sat <- addSatDataLayer(sat, data = DEM, info = NULL, bcde = "DEM", in_bcde="DEM")
## Not run:
sat <- calcTopoCorr(sat)
## End(Not run)
compFilePathLandsat
Get filename, bands and metadata file for Landsat 7 and 8 standard
1B/T format
Description
The function compiles the sensor, band, filename and metadata filename information for standard
level 1B/T Landsat files.
Usage
compFilePathLandsat(files)
20
compMetaLandsat
Arguments
files
Path and filename(s) of one or more Landsat band files or, alternatively, one or
more Landsat metadata files.
Value
data.frame containing filepaths, band numbers and metadata filepaths.
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
compFilePathLandsat(files)
compMetaLandsat
Get calibration information from Landsat 8 standard level 1B/T filename
Description
The function scans a Lansat metadata file for various calibration and orbit coefficients as well as
some sensor specific data.
Usage
compMetaLandsat(files)
Arguments
files
Path and filename of the Landsat metadata file.
Value
data.frame containing the following information for each band/layer:
• DATE date (e.g. 2013-07-07)
• SID sensor id (e.g. LC8)
• SENSOR sensor name (e.g. Landsat 8)
• SGRP sensor group (e.g. Landast)
• BID band id (e.g. 7)
• BCDE band code (5 digit standard name, e.g B001n)
• SRES spatial resolution of the sensor band (e.g. 30 for 30 m x 30m)
• TYPE type of the sensor band regarding wavelength (e.g. VIS)
• SPECTRUM spectral range regarding radiation source (e.g. solar)
• CALIB type of applied calibration (e.g. SC for scaled counts)
convDN2RU
21
• RADA addtition coefficient for radiance conversion
• RADM multiplication coefficient for radiance conversion
• REFA addtition coefficient for reflectance conversion
• REFM multiplication coefficient for reflectance conversion
• BTK1 brightness temperature correction parameter
• BTK2 brightness temperature correction parameter
• SZEN sun zenith angle
• SAZM sun azimuth angle
• SELV sun elevation angle
• ESD earth-sun distance (AU)
• LMIN Minimum wavelength of the band (micrometer)
• LMAX Maximum wavelength of the band (micrometer)
• RADMIN Minimum radiance recorded by the band
• RADMAX Maximum radiance recorded by the band
• REFMIN Minimum reflectance recorded by the band
• REFMAX Maximum reflectance recorded by the band
• LNBR Layer number from 1 to n layers
• LAYER Layer name
• FILE Filepath of the data file
• METAFILE Filepath of the metadata file
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
compMetaLandsat(files)
convDN2RU
Convert a band’s scaled counts to radiance, reflectance and/or temperature
Description
Convert a band’s scaled counts to radiance, reflectance and/or brightness temperature using a simple
linear conversion without any kind of atmospheric correction etc.
22
convDN2RU
Usage
## S4 method for signature 'Satellite'
convDN2RU(x, convert = "all",
szen_correction = "TRUE")
## S4 method for signature 'RasterStack'
convDN2RU(x, mult, add, szen, k1, k2)
## S4 method for signature 'RasterLayer'
convDN2RU(x, mult, add, szen, k1, k2)
Arguments
x
An object of class Satellite, raster::RasterStack or raster::RasterLayer.
convert
Type of physical output; one of "rad", "ref", "bt" or "all".
szen_correction
Logical; if TRUE, sun zenith correction is being applied.
mult
Multiplicative coefficient for value transformation (i.e. slope).
add
Additive coefficient for value transformation (i.e. offset).
szen
Cosine of solar zenith angle.
k1,k2
Temperature correction parameters.
Details
The conversion functions are taken from USGS’ Landsat 8 manual which is available online at
http://landsat.usgs.gov/Landsat8_Using_Product.php.
Value
If x is a Satellite object, a Satellite object with added converted layers;
if x is a raster::Raster* object, a raster::Raster* object with converted layer(s).
See Also
calcAtmosCorr for conversions of scaled counts to physical units including a scene-based atmospheric correction.
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
sat <- convDN2RU(sat)
# If you use a raster layer, supply required meta information
bcde <- "B002n"
convDN2RU(x = getSatDataLayer(sat, bcde),
mult = getSatRADM(sat, bcde),
add = getSatRADA(sat, bcde))
convRad2BT
convRad2BT
23
Convert a band’s scaled counts to brightness temperature
Description
Convert a band’s radiance values to brightness temperature without any kind of atmospheric correction etc.
Usage
## S4 method for signature 'Satellite'
convRad2BT(x)
## S4 method for signature 'RasterStack'
convRad2BT(x, k1, k2)
## S4 method for signature 'RasterLayer'
convRad2BT(x, k1, k2)
Arguments
x
An object of class Satellite, raster::RasterStack or raster::RasterLayer providing
radiance values.
k1,k2
Temperature correction parameters.
Details
The conversion functions are taken from USGS’ Landsat 8 manual which is available online at
http://landsat.usgs.gov/Landsat8_Using_Product.php.
Value
If x is a Satellite object, a Satellite object with added converted layers;
if x is a raster::Raster* object, a raster::Raster* object with converted layer(s).
See Also
calcAtmosCorr for converions of scaled counts to physical units including a scene-based atmospheric correction.
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
sat <- convRad2BT(sat)
24
convRad2Ref
convRad2Ref
Convert a band’s scaled counts or radiance values to reflectance
Description
Convert a band’s scaled counts to reflectance using a simple linear conversion without any kind of
atmospheric correction etc.
Usage
## S4 method for signature 'Satellite'
convRad2Ref(x, szen_correction = "TRUE")
## S4 method for signature 'RasterStack'
convRad2Ref(x, mult, add, szen)
## S4 method for signature 'RasterLayer'
convRad2Ref(x, mult, add, szen)
Arguments
x
szen_correction
An object of class Satellite, raster::RasterStack or raster::RasterLayer providing
radiance values.
Logical; if TRUE, sun zenith correction is being applied.
mult
Multiplicative coefficient for value transformation (i.e. slope).
add
Additive coefficient for value transformation (i.e. offset)
szen
Cosine of solar zenith angle.
Details
The conversion functions are taken from USGS’ Landsat 8 manual which is available online at
http://landsat.usgs.gov/Landsat8_Using_Product.php.
If the sensor does not provide linear conversion coefficients for reflectance computation, the reflectance is calculated using the solar irradiance following the functions taken from USGS’ Landsat
7 manual, chapter 11.3.2, which is available online at http://landsathandbook.gsfc.nasa.gov/
data_prod/prog_sect11_3.html.
Value
If x is a Satellite object, a Satellite object with added converted layers;
if x is a raster::Raster* object, a raster::Raster* object with converted layer(s).
See Also
calcAtmosCorr for conversions of scaled counts to physical units including a scene-based atmospheric correction.
convRef2RadLinear
25
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
sat <- convRad2Ref(sat)
# If you use a raster layer, supply required meta information
bcde <- "B002n"
convRad2Ref(x = getSatDataLayer(sat, bcde),
mult = getSatRADM(sat, bcde),
add = getSatRADA(sat, bcde))
convRef2RadLinear
Convert reflectance to radiance using linear function coefficients
Description
The function converts the reflectance (ref) back to radiance (rad) given that linear conversion coefficients for both radiance and reflectance are available.
Usage
convRef2RadLinear(band, refm, refa, radm, rada, szen)
Arguments
band
raster::RasterStack or raster::RasterLayer containing reflectance.
refm
Multiplication coefficient for reflectance conversion.
refa
Addtition coefficient for reflectance conversion.
radm
Multiplication coefficient for radiance conversion.
rada
Addition coefficient for radiance conversion.
szen
Sun zenith angle.
Details
The conversion functions are taken from USGS’ Landsat 8 manual which is available online at
http://landsat.usgs.gov/Landsat8_Using_Product.php.
Value
raster::Raster* object with converted values.
26
convSC2Rad
convSC2Rad
Convert a band’s scaled counts to radiance
Description
Convert a band’s scaled counts to radiance using a simple linear conversion without any kind of
atmospheric correction etc.
Usage
## S4 method for signature 'Satellite'
convSC2Rad(x, szen_correction = "TRUE")
## S4 method for signature 'RasterStack'
convSC2Rad(x, mult, add, szen)
## S4 method for signature 'RasterLayer'
convSC2Rad(x, mult, add, szen)
Arguments
x
An object of class Satellite, raster::RasterStack or raster::RasterLayer providing
scaled counts (DNs).
szen_correction
Logical; if TRUE, sun zenith correction is being applied.
mult
Multiplicative coefficient for value transformation (i.e. slope).
add
Additive coefficient for value transformation (i.e. offset).
szen
Cosine of solar zenith angle.
Details
The conversion functions are taken from USGS’ Landsat 8 manual which is available online at
http://landsat.usgs.gov/Landsat8_Using_Product.php.
Value
If x is a Satellite object, a Satellite object with added converted layers;
if x is a raster::Raster* object, a raster::Raster* object with converted layer(s).
See Also
calcAtmosCorr for conversions of scaled counts to physical units including a scene-based atmospheric correction.
convSC2Ref
27
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
sat <- convSC2Rad(sat)
# If you use a raster layer, supply required meta information
bcde <- "B002n"
convSC2Rad(x = getSatDataLayer(sat, bcde),
mult = getSatRADM(sat, bcde),
add = getSatRADA(sat, bcde))
convSC2Ref
Convert a band’s scaled counts or radiance values to reflectance
Description
Convert a band’s scaled counts to reflectance using a simple linear conversion without any kind of
atmospheric correction etc.
Usage
## S4 method for signature 'Satellite'
convSC2Ref(x, szen_correction = "TRUE")
## S4 method for signature 'RasterStack'
convSC2Ref(x, mult, add, szen)
## S4 method for signature 'RasterLayer'
convSC2Ref(x, mult, add, szen)
Arguments
x
An object of class Satellite, raster::RasterStack or raster::RasterLayer providing
scaled counts (DNs).
szen_correction
Logical; if TRUE, sun zenith correction is being applied.
mult
Multiplicative coefficient for value transformation (i.e. slope).
add
Additive coefficient for value transformation (i.e. offset).
szen
Cosine of solar zenith angle.
28
crop
Details
The conversion functions are taken from USGS’ Landsat 8 manual which is available online at
http://landsat.usgs.gov/Landsat8_Using_Product.php.
If the sensor does not provide linear conversion coefficients for reflectance computation, the reflectance is calculated using the solar irradiance following the functions taken from USGS’ Landsat
7 manual, chapter 11.3.2, which is available online at http://landsathandbook.gsfc.nasa.gov/
data_prod/prog_sect11_3.html.
Value
If x is a Satellite object, a Satellite object with added converted layers;
if x is a raster::Raster* object, a raster::Raster* object with converted layer(s).
See Also
calcAtmosCorr for conversions of scaled counts to physical units including a scene-based atmospheric correction.
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
sat <- convSC2Ref(sat)
# If you use a raster layer, supply required meta information
bcde <- "B002n"
convSC2Ref(x = getSatDataLayer(sat, bcde),
mult = getSatRADM(sat, bcde),
add = getSatRADA(sat, bcde))
crop
Crop satellite object
Description
The function is a wrapper around the crop function to easily crop a Satellite object by an extent
object.
Usage
## S4 method for signature 'Satellite'
crop(x, y, subset = TRUE)
crop
29
Arguments
x
Satellite object.
y
extent object.
subset
Logical; if TRUE (default), all layers but the cropped ones are being dropped; if
FALSE, cropped layers are appended to the Satellite object.
Details
Crop layers of a Satellite object to the size of a given raster::extent object.
Value
A Satellite object consisting of cropped layers only. If subset = FALSE, a Satellite object with the
cropped layers appended.
References
Please refer to the respective functions for references.
See Also
This function is a wrapper for raster::crop.
Examples
## Not run:
## sample data
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
## geographic extent of georg-gassmann-stadium (utm 32-n)
ext_ggs <- raster::extent(484015, 484143, 5627835, 5628020)
## crop satellite object by specified extent
sat_ggs <- crop(sat, ext_ggs)
plot(sat)
plot(sat_ggs)
## End(Not run)
30
demTools
demTools
Compute terrain characteristics from digital elevation models
Description
Compute terrain characteristics from digital elevation models (DEM) using raster::terrain or
raster::hillShade.
Usage
## S4 method for signature 'Satellite'
demTools(x, method = "hillShade", bcde = "DEM")
## S4 method for signature 'RasterLayer'
demTools(x, sunElev, sunAzim, method = "hillShade")
Arguments
x
method
bcde
sunElev
sunAzim
A DEM provided as an object of class Satellite or RasterLayer.
Currently "slope", "aspect" and "hillshade" are implemented.
The name of the DEM layer in the satellite object.
If method = "hillShade", the elevation angle of the sun in degrees. See
parameter angle in hillShade.
If method = "hillShade", the sun azimuth angle in degree. See parameter
direction in hillShade.
Value
If x is a Satellite object, a Satellite object with added layer containing calculated terrain information;
if x is a raster::RasterLayer object, a raster::RasterLayer object with calculated terrain
information.
See Also
raster::terrain, raster::hillShade.
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
## dem
files_dem <- list.files(path, pattern = "DEM", full.names = TRUE)
DEM <- raster(files_dem)
sat <- addSatDataLayer(sat, data = DEM, info = NULL, bcde = "DEM", in_bcde="DEM")
sat <- demTools(sat)
deprecated
31
deprecated
Deprecated functions
Description
The functions have been implemented in the very beginning of the package development, mainly
to be used within the scope of a remote sensing course at Marburg University. To ensure that the
scripts developed within this course will still work after the next major revision, they are still part of
this package, but they will mainly just foreward the respective call to the more up-to-date function.
Usage
satCalib(x, convert = "all", szen_correction = "TRUE")
calibLinear(band, mult, add, szen, k1, k2)
satTOAIrrad(x, method = "Table", model = "MNewKur", normalize = TRUE, esd)
satPathRadDOS(x, atmos_model = "DOS2", esun_mode = "RadRef")
satAtmosCorr(x, atmos_model = "DOS2", esun_mode = "RadRef")
calibLinearInverse(band, ref_mult, ref_add, rad_mult, rad_add, szen)
satInvarFeatures(x)
Arguments
x
Satellite object
convert
Convert dataset to radiance/reflectance/temperature
szen_correction
Compute sun zenith correction
band
Band of the sensor
mult
Multiplicative calibration coefficient
add
Additive multiplication coefficient
szen
Sun zenith angle
k1
BTT calibration coefficient
k2
BTT calibration coefficient
method
Method used for computation
model
Model used for computation
normalize
Normalize earth-sun distance
esd
Earth sun distance
atmos_model
Atmospheric model to be used
32
l8
esun_mode
Earth sun distance computation method to be used
ref_mult
Multiplicative reflection calibration coefficient
ref_add
Additive reflection calibration coefficient
rad_mult
Multiplicative radiance calibration coefficient
rad_add
Additive radiance calibration coefficient
l7
Landsat 7 sample data
Description
This dataset comes from the USGS. It contains part of the Landsat scene LE71950252001211EDC00
from 2001-07-30 over Maburg, Germany.
Format
raster::RasterStack with 8 bands of 41 by 41 pixels.
Details
Use of this data requires your agreement to the USGS regulations on using Landsat data.
Source
http://earthexplorer.usgs.gov/
l8
Landsat 8 sample data
Description
This dataset comes from the USGS. It contains part of the Landsat scene LC81950252013188LGN00
from 2013-07-07 over Maburg, Germany.
Format
raster::RasterStack with 10 bands of 41 by 41 pixels.
Details
Use of this data requires your agreement to the USGS regulations on using Landsat data.
Source
http://earthexplorer.usgs.gov/
lutInfo
33
lutInfo
Get or access internal LUT values used by various functions
Description
Get internal look-up table (LUT) values from sysdata.rda which have been compiled using dataraw/lut_data.R. Metadata is stored in lut$meta.
Usage
lutInfo()
lutInfoBandsFromSID(sid)
lutInfoSensorFromSID(sid)
lutInfoBCDEFromBID(sid, bid)
lutInfoBIDFromBCDE(bcde, sid)
lutInfoRSRromSID(sid)
lutInfoSIDfromFilename(files)
lutInfoSGRPfromFilename(file)
Arguments
sid
Sensor id as returned e.g. from lutInfoSensorFromSID.
bid
Band id as returned e.g. from lutInfoBIDFromBCDE.
bcde
Band code as returned e.g. from lutInfoBCDEFromBID.
files
Filename (or filepath) of one or more remote sensing data filenames
file
Filename of a remote sensing data file
Details
The functions above return the following information:
• lutInfoBandsFromSID returns the band info block.
• lutInfoBCDEFromBID returns the band code.
• lutInfoBIDFromBCDE returns the band ids.
• lutInfoRSRromSID returns the relative spectral response (rsr) for the sensor.
• lutInfoSensorFromSID returns the sensor name.
The LUT contains the following information:
34
lutInfo
l4_band_wl Minimum/maximum wavelength for Landsat 4 bands taken from the band info of the
USGS Landsat FAQ.
l5_band_wl Minimum/maximum wavelength for Landsat 5 bands taken from the band info of the
USGS Landsat FAQ.
l7_band_wl Minimum/maximum wavelength for Landsat 7 bands taken from the band info of the
USGS Landsat FAQ.
l8_band_wl Minimum/maximum wavelength for Landsat 8 bands taken from the band info of the
USGS Landsat FAQ.
l7_rsr Landat 7 rsr (nm-1) taken from taken from the spectral viewer of the USGS Landsat FAQ.
l8_rsr Landat 8 rsr (nm-1) taken from taken from the spectral viewer of the USGS Landsat FAQ.
solar Solar irradiance (W m-2 nm-1) taken from the National Renewable Energy Laboratory.
l7_esun Tabulated ESun values from tab 11.3 (Thuillier spectrum) of the Landsat7 handbook.
l5_esun Tabulated ESun values from Chander G, Markham B (2003) Revised Landsat-5 TM radiometric calibration procedures and postcalibration dynamic ranges. IEEE Transaction on
Geoscience and Remote Sensing 41/11, doi:10.1109/LGRS.2007.898285.
l4_esun Tabulated ESun values from Chander G, Markham B (2003) Revised Landsat-5 TM radiometric calibration procedures and postcalibration dynamic ranges. IEEE Transaction on
Geoscience and Remote Sensing 41/11, doi:10.1109/LGRS.2007.898285.
Value
List containing several data.frame objects with LUT values.
Functions
• lutInfoBandsFromSID:
• lutInfoSensorFromSID:
• lutInfoBCDEFromBID:
• lutInfoBIDFromBCDE:
• lutInfoRSRromSID:
• lutInfoSIDfromFilename:
• lutInfoSGRPfromFilename:
Examples
ls_li <- lutInfo()
str(ls_li)
maskInvarFeatures
maskInvarFeatures
35
Identify pseudo-invariant features from a satellite scene
Description
Identify pseudo-invariant features from a satellite scene based on a vis, near infravis and short-wave
infravis band.
Usage
## S4 method for signature 'Satellite'
maskInvarFeatures(x)
## S4 method for signature 'RasterStack'
maskInvarFeatures(x, quant = 0.01, id_vis = 1L,
id_nir = 2L, id_swir = 3L)
## S4 method for signature 'RasterLayer'
maskInvarFeatures(x, nir, swir, quant = 0.01)
Arguments
x
A Satellite object or a raster::RasterLayer providing the sensor’s vis band.
quant
A value v = [0...1] which is used to define the percentage threshold values (thv)
for invariant features (nir/vis ratio < thv, swir band values > 1-thv).
id_vis
Index of the visible band.
id_nir
Index of the near infravis band.
id_swir
Index of the short-wave infravis band.
nir
A raster::RasterLayer containing the sensor’s nir band.
swir
A raster::RasterLayer containing the sensor’s swir band.
Details
Invariant features are identified as pixels which belong to the group of (i) the n lowest VIS/NIR
ratios and of (ii) the highest n SWIR values. The value of n is given by the parameter quant =
[0...1].
Value
If x is a Satellite object, a Satellite object with added layer;
if x is a raster::RasterLayer object, a a raster::RasterLayer object with added layers (1
indicates invariant pixels, 0 otherwise).
36
names
References
This function is taken and only slightly modified from the PIF function by Sarah C. Goslee (2011).
Analyzing Remote Sensing Data in R: The landsat Package. Journal of Statistical Software,43(4),
1-25. URL http://www.jstatsoft.org/v43/i04/.
The underlying theory has been published by Schott RJ, Salvaggio C and Volchok WJ (1988) Radiometric scene normalization using pseudoinvariant features. Remote Sensing of Environment
26/1, doi:10.1016/0034-4257(88)90116-2, available online at http://www.sciencedirect.com/
science/article/pii/0034425788901162.
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
sat <- maskInvarFeatures(sat)
maskInvarFeatures(x = getSatDataLayer(sat, "B004n"),
nir = getSatDataLayer(sat, "B005n"),
swir = getSatDataLayer(sat, "B007n"))
## when dealing with a 'RasterStack'
rst <- stack(files[c(6, 7, 9)])
maskInvarFeatures(rst)
names
Get/set Satellite data layer names
Description
Get/set Satellite data layer names, i.e. the BCDE id.
Usage
## S4 method for signature 'Satellite'
names(x)
## S4 replacement method for signature 'Satellite'
names(x) <- value
Arguments
x
A Satellite object.
value
Band codes of the individual data layers.
Value
Satellite data layer names as character vector.
panSharp
37
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
names(sat)
new_names <- paste0(names(sat), "_test")
names(sat) <- new_names
panSharp
Pan sharpen low resolution satellite channels by using the high resolution panchromatic channel.
Description
The function PAN sharpens the low resolution channels with the panchromatic channel. This is
done by multiplying the normlized XS channel with the PAN channel (see Details).
Usage
## S4 method for signature 'Satellite'
panSharp(x, filter = c("mean", "Gauss", "median"),
winsize = 1, subset = FALSE)
## S4 method for signature 'RasterStack'
panSharp(x, pan, filter = c("mean", "Gauss",
"median"), winsize = 1)
## S4 method for signature 'RasterLayer'
panSharp(x, pan, pan_lp, filter = c("mean", "Gauss",
"median"), winsize = 1)
Arguments
x
Satellite or raster::Raster* object.
filter
Type of filter to be used for smoothing the PAN raster; one of mean (default),
Gauss, median.
winsize
Size of the filter window in x and y direction; defaults to 3.
subset
Logical; if TRUE, all layers except for the cropped ones are being dropped; if
FALSE, the cropped layers are being appended to the Satellite object.
pan
A raster::RasterLayer object of the panchromatic channel
pan_lp
A raster::RasterLayer object containing a lowpass filtering of pan
38
panSharp
Details
Pan sharpen low resolution satellite channels by using the high resolution panchromatic channel.
This function uses the same algorithm as the OTB Toolbox where "The idea is to apply a low pass
filter to the panchromatic band to give it a spectral content (in the Fourier domain) equivalent to the
XS data. Then we normalize the XS data with this low-pass panchromatic and multiplythe result
with the original panchromatic band." (see https://www.orfeo-toolbox.org/SoftwareGuide/
SoftwareGuidech13.html#x41-2140011).
Value
If x is a Satellite object, a Satellite object (with added pansharpened layers); if x is a raster::Raster*
object, a raster::Raster* with pansharpened layer(s).
References
Al-amri, Salem Saleh, Namdeo V. Kalyankar, and Santosh D. Khamitkar. "A comparative study of
removal noise from remote sensing image." http://ijcsi.org/articles/A-Comparative-Study-of-Removal-Noise-f
php
Bhattacharya, Amit K., P. K. Srivastava, and Anil Bhagat. "A modified texture filtering technique
for satellite images." Paper presented at the 22nd Asian Conference on Remote Sensing. Vol. 5.
2001. http://a-a-r-s.org/aars/proceeding/ACRS2001/Papers/DPA3-08.pdf
Randen, Trygve, and John Hakon Husoy. "Filtering for texture classification: A comparative study."
Pattern Analysis and Machine Intelligence, IEEE Transactions on 21.4 (1999): 291-310. http:
//dx.doi.org/10.1109/34.761261.
PAN sharpening articles
- http://remotesensing.spiedigitallibrary.org/article.aspx?articleid=1726558
- http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=1368950&url=http%3A%2F%2Fieeexplore.
ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D1368950
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
## Not run:
## using 'satellite' object
sat_ps <- panSharp(sat)
par(mfrow = c(1, 2))
plot(getSatDataLayer(sat_ps, "B002n"), main = "raw", legend = TRUE)
plot(getSatDataLayer(sat_ps, "B002n_PAN_sharpend"),
main = "pan-sharpened", legend = TRUE)
dev.off()
## End(Not run)
## using 'RasterLayer' object
rst_b001n <- getSatDataLayer(sat, "B001n")
pck_data
39
rst_panch <- getSatDataLayer(sat, getSatBCDEFromType(sat, type = "PCM"))
rst_b001n_ps <- panSharp(rst_b001n, rst_panch)
par(mfrow = c(1, 2))
plot(rst_b001n, main = "raw", legend = FALSE)
plot(rst_b001n_ps, main = "pan-sharpened", legend = FALSE)
dev.off()
pck_data
Package methods used to build datasets
Description
Functions which have been used to create dataset of this package.
pck_lut
Function used to create sysdata.rda (i.e. LUT)
Description
Function which has been used to create the LUT data of this package.
plot
Plot a ’Satellite’ object
Description
This is the standard plotting routine for the ’Satellite’ class. Layers are drawn either from the start
(default; limited to a maximum of 16 sub-plots) or according to the speficied band codes.
Usage
## S4 method for signature 'Satellite,ANY'
plot(x, bcde = NULL,
col = grDevices::grey.colors(100), ...)
Arguments
x
A ’Satellite’ object, usually returned by satellite.
bcde
Band codes to be visualized, e.g. returned by getSatBCDE. If not supplied, the
initial (up to) 16 layers are being visualized.
col
Color scheme.
...
Further arguments passed on to plot.default.
40
projectSatellite
See Also
plot.default, par.
Examples
## sample data
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
## Not run:
## pan-sharpening
sat_ps <- panSharp(sat)
## draw initial 16 layers (raw and pan-sharpened)
library(RColorBrewer)
plot(sat_ps, col = brewer.pal(9, "Reds"))
## draw first and second band incl. pan-sharpened versions only
plot(sat_ps, bcde = c("B001n", "B001_PAN_sharpend",
"B002n", "B002_PAN_sharpend"))
## End(Not run)
projectSatellite
Reproject a ’Satellite’ object
Description
Reproject a satellite object. Either a template or crs must be supplied. If crs is not supplied,
alignGeometry is called.
Usage
## S4 method for signature 'Satellite'
projectSatellite(x, template, band_codes, type, crs,
method = c("bilinear", "ngb"))
Arguments
x
Satellite or Raster* object to be resampled.
template
Raster* or spatial data set from which geometry can be extracted.
band_codes
Band ID(s) to be resampled. If not supplied and type is not given, too, all bands
will be considered for resampling.
type
Type of bands (e.g. VIS, NIR) which should be considered. If not supplied, all
types will be processed depending and bands to be processed can be defined by
band_codes.
satellite
41
crs
character or object of class ’CRS’. PROJ.4 description of the coordinate reference system. See projectRaster for details.
method
Method for resampling; "bilinear" for bilinear interpolation (default) or "ngb"
for nearest neighbor interpolation. See e.g. resample, projectRaster.
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
projectSatellite(sat, crs = "+init=epsg:4326", band_codes = "B001n")
satellite
Create a Satellite object
Description
Method to create a Satellite object.
Usage
## S4 method for signature 'character'
satellite(x, meta, log)
## S4 method for signature 'RasterStack'
satellite(x, meta, log)
## S4 method for signature 'list'
satellite(x, meta, log)
Arguments
x
A vector of filenames (see raster::raster) or a raster::RasterStack.
meta
Optional metadata object (e.g. returned from compMetaLandsat). If x is a satellite dataset and recognised as "Landsat", then the metadata is automatically extracted from the respective meta information file if both the satellite data and the
metadata file follow the USGS Earth Explorer’s naming convention.
log
Optionally supply a log entry.
Details
A satellite object consists of three data sections: (i) a raster data section which holds the actual data
values of the respective sensor bands, (ii) a metadata grid which holds meta information for each
sensor band (e.g. calibration coefficients, type of sensor band etc.) and (iii) a list of log information
which records the processing history of the entire dataset.
42
SatelliteInfo-class
Value
Satellite object
See Also
compMetaLandsat to get more information about the structure of the metadata component.
Examples
## 'character' input (i.e. filenames)
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
satellite(files)
## raster::RasterStack input
satellite(l8)
Satellite-class
An S4 class to represent a complete satellite dataset
Description
An S4 class to represent a complete satellite dataset
SatelliteInfo-class
An S4 class to represent a satellite data file
Description
An S4 class to represent a satellite data file
Slots
name name of the data file without extension
filepath full path and file of the data file
path path to the data file
file filename incl. extension of the data file
extension extension of the data file
SatelliteLayers-class
43
SatelliteLayers-class An S4 class to represent satellite data
Description
An S4 class to represent satellite data
Slots
layers a list object containing individual RasterLayer objects
SatelliteLog-class
An S4 class to represent satellite log data
Description
An S4 class to represent satellite log data
Slots
log a list object containing information on individual processing steps
SatelliteMetaData-class
An S4 class to represent satellite metadata
Description
An S4 class to represent satellite metadata
Slots
meta a data frame object containing the data
44
satInfo
satInfo
Get or access Satellite object information used by various functions
Description
Get information from class Satellite.
Usage
getSatDataLayers(sat, bcde = NULL)
getSatDataLayer(sat, bcde)
getSatMeta(sat, bcde)
getSatMetaBCDETemplate(sat, bcde)
getSatLog(sat)
setSatBCDE(sat, bcde)
createSatBCDE(sat, width = 3, flag = 0, prefix = "B", postfix = "n")
addSatMetaParam(sat, meta_param)
addSatMetaEntry(sat, meta_param)
addSatLog(sat, info = NA_character_, in_bcde = NA_character_,
out_bcde = NA_character_)
addSatDataLayer(sat, bcde, data, meta_param, info, in_bcde)
addRasterMeta2Sat(sat)
createRasterMetaData(rst)
updateRasterMetaData(sat, bcde)
countSatDataLayers(sat)
getSatParam(sat, param, bcde, return_bcde = TRUE)
getSatBCDE(sat, lnbr)
getSatBID(sat, bcde)
getSatSID(sat)
satInfo
getSatSensor(sat)
getSatSensorGroup(sat)
getSatSensorInfo(sat)
getSatSpectrum(sat, bcde)
getSatBCDESolar(sat)
getSatBCDEThermal(sat)
getSatXRes(sat, bcde)
getSatYRes(sat, bcde)
getSatRes(sat, bcde)
getSatType(sat, bcde)
getSatCalib(sat, bcde)
getSatBCDEType(sat, bcde, type)
getSatBCDEFromType(sat, type = "VIS")
getSatBCDEFromSpectrum(sat, spectrum = "solar")
getSatBCDESres(sat, bcde, type)
getSatBCDECalib(sat, bcde, calib)
getSatBCDESolarCalib(sat, bcde, calib)
getSatBCDEThermalCalib(sat, bcde, calib)
getSatBandInfo(sat, bcde, return_calib = TRUE)
getSatRadMax(sat, bcde)
getSatRadMin(sat, bcde)
getSatRefMax(sat, bcde)
getSatRefMin(sat, bcde)
getSatESD(sat)
45
46
satInfo
getSatESUN(sat, bcde)
getSatSZEN(sat, bcde)
getSatSAZM(sat, bcde)
getSatSELV(sat, bcde)
getSatMetaLayer(sat, bcde)
getSatLayerfromData(sat, bcde, nbr)
getSatLNBR(sat, bcde)
getSatLMIN(sat, bcde)
getSatLMAX(sat, bcde)
getSatRADA(sat, bcde)
getSatRADM(sat, bcde)
getSatREFA(sat, bcde)
getSatREFM(sat, bcde)
getSatBTK1(sat, bcde)
getSatBTK2(sat, bcde)
getSatPRAD(sat, bcde)
getSatDATE(sat, bcde)
getSatProjection(sat, bcde)
Arguments
sat
Satellite object (see satellite).
bcde
Band code.
width,flag
Field width and format modifier for automated creation of BCDE information,
defaults to ’3’ and ’0’, respectively. See formatC for further details.
prefix,postfix Prefix and postfix to be added to the created BCDE information.
meta_param
Metadata parameters used to document new data layer
info
Log information added to metadata
in_bcde
BCDE of layer used as input dataset
satInfo
47
out_bcde
BCDE of layer used as output dataset
data
Data layer of a satellite object
rst
Input raster::Raster* object from which to extract metadata.
param
Parameter of the metadata set (i.e. colname)
return_bcde
Return bcde as attribute (TRUE/FALSE)
lnbr
Layer number
type
Type of the sensor band
spectrum
Spectral region, e.g. "solar" or "thermal".
calib
Calibration information.
return_calib
Return calibration information (TRUE/FALSE)
nbr
Return specific data layer selected by number
Details
The functions are generally self-explaining in that sence that get* returns the respective information
and set* sets the respective information from/in the Satellite object.
addSatLog adds a log entry to the Satellite object.
Value
Objects of respective type (see satellite).
Functions
• getSatDataLayers: Return Satellite data layers
• getSatDataLayer: Return Satellite data layer i
• getSatMeta: Return Satellite object metadata
• getSatMetaBCDETemplate: Return template for Satellite object metadata which is based on
existing band
• getSatLog: Return Satellite object log info
• setSatBCDE: Set BCDE/data layer names of a Satellite object
• createSatBCDE: If not supplied, automatically create BCDE names of a Satellite object
• addSatMetaParam: Add additional or overwrite metainformation parameter to Satellite object
• addSatMetaEntry: Add metainformation for an additional layer to Satellite object
• addSatLog: Add new log entry to Satellite object
• addSatDataLayer: Add new Satellite data layer
• addRasterMeta2Sat: Add raster meta data to Satellite object meta data
• createRasterMetaData: Create raster meta data
• updateRasterMetaData: Create raster meta data
• countSatDataLayers: Return number of Satellite data layers
48
satInfo
• getSatParam: Return parameter (general method implemented by the specific functions below)
• getSatBCDE: Return Band code
• getSatBID: Return Band IDs
• getSatSID: Return sensor ID
• getSatSensor: Return sensor
• getSatSensorGroup: Return sensor group
• getSatSensorInfo: Return sensor information
• getSatSpectrum: Return spectrum
• getSatBCDESolar: Return solar band codes
• getSatBCDEThermal: Return thermal band codes
• getSatXRes: Return sensor x resolution
• getSatYRes: Return sensor y resolution
• getSatRes: Return mean sensor resolution (mean of x and y res)
• getSatType: Return sensor type
• getSatCalib: Return calibration level
• getSatBCDEType: Return TYPE band codes
• getSatBCDEFromType: Return BCDE matching TYPE
• getSatBCDEFromSpectrum: Return BCDE matching TYPE
• getSatBCDESres: Return the mean of x and y resolution for band codes matching type
• getSatBCDECalib: Return calibration level for band codes matching type
• getSatBCDESolarCalib: Return calibration level for band codes machting type and are solar
bands
• getSatBCDEThermalCalib: Return calibration level for band codes machting type and are
thermal bands
• getSatBandInfo: Return band information
• getSatRadMax: Return maximum radiance for bcde
• getSatRadMin: Return minimum radiance for bcde
• getSatRefMax: Return maximum reflectance for bcde
• getSatRefMin: Return minimum reflectance for bcde
• getSatESD: Return earth-sun distance
• getSatESUN: Return actual solar TOA irradiance
• getSatSZEN: Return sun zenith angle
• getSatSAZM: Return sun azimuth angle
• getSatSELV: Return Sun elevation
• getSatMetaLayer: Return Layer name from metadata
• getSatLayerfromData: Return Layer name from data layer
• getSatLNBR: Return Layer number
stack
49
•
•
•
•
•
•
•
•
•
•
getSatLMIN: Return minimum wavelength of the sensor band
getSatLMAX: Return maximum wavelength of the sensor band
getSatRADA: Return addition coefficient for SC to radiance conversion
getSatRADM: Return multiplicative coefficient for SC to radiance conversion
getSatREFA: Return addition coefficient for SC to reflectance
getSatREFM: Return multiplicative coefficient for SC to reflectance
getSatBTK1: Return calibration coefficent to convert SC to brightness temperature
getSatBTK2: Return calibration coefficent to convert SC to brightness temperature
getSatDATE: Return DATE
getSatProjection: Return projection
Examples
# List of input files
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
# Raster stack l8
sat <- satellite(l8)
stack
convert selected layers of a Satellite object to a RasterStack
Description
Convert selected layers of a Satellite object to a RasterStack
Usage
## S4 method for signature 'Satellite'
stack(x, layer = names(x), ...)
Arguments
x
layer
...
an object of class ’Satellite’
character vector (bcde codes) or integer vector (index) of the layers to be stacked
additional arguments passed on to stack
Examples
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
stck <- stack(sat, c("B001n", "B002n", "B003n"))
stck
50
subset
subset
Subset Satellite object data layers
Description
This function subsets a Satellite object and returns the extracted dataset as Satellite object.
Usage
## S4 method for signature 'Satellite'
subset(x, sid, cid)
## S4 method for signature 'Satellite,ANY,ANY'
x[[i]]
Arguments
x
Satellite or raster::Raster* object providing the source band(s) to be adjusted.
sid
Band numbers or bcde which should be extracted
cid
Calibration information used for subsetting (only works if sid is not supplied to
the function)
i
Layer index(es) for subsetting.
Value
A Satellite object
A Satellite object
A Satellite object
Examples
## sample data
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
sat[[2:5]]
subset(sat, cid = "SC")
Index
calcPathRadDOS,numeric-method
(calcPathRadDOS), 11
calcPathRadDOS,Satellite-method
(calcPathRadDOS), 11
calcTOAIrradModel, 5, 6, 11, 12, 14, 16, 18
calcTOAIrradModel,data.frame-method
(calcTOAIrradModel), 14
calcTOAIrradModel,Satellite-method
(calcTOAIrradModel), 14
calcTOAIrradRadRef, 5, 6, 11, 12, 15, 15, 18
calcTOAIrradRadRef,numeric-method
(calcTOAIrradRadRef), 15
calcTOAIrradRadRef,Satellite-method
(calcTOAIrradRadRef), 15
calcTOAIrradTable, 5, 6, 11, 12, 15, 16, 17
calcTOAIrradTable,character-method
(calcTOAIrradTable), 17
calcTOAIrradTable,factor-method
(calcTOAIrradTable), 17
calcTOAIrradTable,Satellite-method
(calcTOAIrradTable), 17
calcTopoCorr, 18
calcTopoCorr,RasterLayer-method
(calcTopoCorr), 18
calcTopoCorr,RasterStack-method
(calcTopoCorr), 18
calcTopoCorr,Satellite-method
(calcTopoCorr), 18
calibLinear (deprecated), 31
calibLinearInverse (deprecated), 31
compFilePathLandsat, 19
compMetaLandsat, 20, 41, 42
convDN2RU, 21
convDN2RU,RasterLayer-method
(convDN2RU), 21
convDN2RU,RasterStack-method
(convDN2RU), 21
convDN2RU,Satellite-method (convDN2RU),
21
∗Topic package
satellite-package, 2
[[,Satellite,ANY,ANY-method (subset), 50
addRasterMeta2Sat (satInfo), 44
addSatDataLayer (satInfo), 44
addSatLog (satInfo), 44
addSatMetaEntry (satInfo), 44
addSatMetaParam (satInfo), 44
alignGeometry, 3, 40
alignGeometry,RasterLayer-method
(alignGeometry), 3
alignGeometry,RasterStack-method
(alignGeometry), 3
alignGeometry,Satellite-method
(alignGeometry), 3
as.Date, 8
as.POSIXct, 8
brick, 4, 4
brick,Satellite-method (brick), 4
calcAtmosCorr, 5, 11, 13, 19, 22–24, 26, 28
calcAtmosCorr,RasterLayer-method
(calcAtmosCorr), 5
calcAtmosCorr,RasterStack-method
(calcAtmosCorr), 5
calcAtmosCorr,Satellite-method
(calcAtmosCorr), 5
calcDODN, 7, 11, 12
calcEarthSunDist, 8, 14–18
calcHistMatch, 9
calcHistMatch,RasterLayer-method
(calcHistMatch), 9
calcHistMatch,RasterStack-method
(calcHistMatch), 9
calcHistMatch,Satellite-method
(calcHistMatch), 9
calcPathRadDOS, 5, 6, 8, 11
51
52
convRad2BT, 23
convRad2BT,RasterLayer-method
(convRad2BT), 23
convRad2BT,RasterStack-method
(convRad2BT), 23
convRad2BT,Satellite-method
(convRad2BT), 23
convRad2Ref, 24
convRad2Ref,RasterLayer-method
(convRad2Ref), 24
convRad2Ref,RasterStack-method
(convRad2Ref), 24
convRad2Ref,Satellite-method
(convRad2Ref), 24
convRef2RadLinear, 25
convSC2Rad, 5, 26
convSC2Rad,RasterLayer-method
(convSC2Rad), 26
convSC2Rad,RasterStack-method
(convSC2Rad), 26
convSC2Rad,Satellite-method
(convSC2Rad), 26
convSC2Ref, 27
convSC2Ref,RasterLayer-method
(convSC2Ref), 27
convSC2Ref,RasterStack-method
(convSC2Ref), 27
convSC2Ref,Satellite-method
(convSC2Ref), 27
countSatDataLayers (satInfo), 44
createRasterMetaData (satInfo), 44
createSatBCDE (satInfo), 44
crop, 28, 28
crop,Satellite-method (crop), 28
demTools, 30
demTools,RasterLayer-method (demTools),
30
demTools,Satellite-method (demTools), 30
deprecated, 31
extent, 28, 29
formatC, 46
getSatBandInfo (satInfo), 44
getSatBCDE, 39
getSatBCDE (satInfo), 44
getSatBCDECalib (satInfo), 44
INDEX
getSatBCDEFromSpectrum (satInfo), 44
getSatBCDEFromType (satInfo), 44
getSatBCDESolar (satInfo), 44
getSatBCDESolarCalib (satInfo), 44
getSatBCDESres (satInfo), 44
getSatBCDEThermal (satInfo), 44
getSatBCDEThermalCalib (satInfo), 44
getSatBCDEType (satInfo), 44
getSatBID (satInfo), 44
getSatBTK1 (satInfo), 44
getSatBTK2 (satInfo), 44
getSatCalib (satInfo), 44
getSatDataLayer, 8
getSatDataLayer (satInfo), 44
getSatDataLayers (satInfo), 44
getSatDATE (satInfo), 44
getSatESD (satInfo), 44
getSatESUN (satInfo), 44
getSatLayerfromData (satInfo), 44
getSatLMAX (satInfo), 44
getSatLMIN (satInfo), 44
getSatLNBR (satInfo), 44
getSatLog (satInfo), 44
getSatMeta (satInfo), 44
getSatMetaBCDETemplate (satInfo), 44
getSatMetaLayer (satInfo), 44
getSatParam (satInfo), 44
getSatPRAD (satInfo), 44
getSatProjection (satInfo), 44
getSatRADA (satInfo), 44
getSatRADM (satInfo), 44
getSatRadMax (satInfo), 44
getSatRadMin (satInfo), 44
getSatREFA (satInfo), 44
getSatREFM (satInfo), 44
getSatRefMax (satInfo), 44
getSatRefMin (satInfo), 44
getSatRes (satInfo), 44
getSatSAZM (satInfo), 44
getSatSELV (satInfo), 44
getSatSensor (satInfo), 44
getSatSensorGroup (satInfo), 44
getSatSensorInfo (satInfo), 44
getSatSID (satInfo), 44
getSatSpectrum (satInfo), 44
getSatSZEN (satInfo), 44
getSatType (satInfo), 44
getSatXRes (satInfo), 44
INDEX
getSatYRes (satInfo), 44
hillShade, 30
l7, 32
l8, 32
lutInfo, 33
lutInfoBandsFromSID (lutInfo), 33
lutInfoBCDEFromBID, 33
lutInfoBCDEFromBID (lutInfo), 33
lutInfoBIDFromBCDE, 33
lutInfoBIDFromBCDE (lutInfo), 33
lutInfoRSRromSID (lutInfo), 33
lutInfoSensorFromSID, 33
lutInfoSensorFromSID (lutInfo), 33
lutInfoSGRPfromFilename (lutInfo), 33
lutInfoSIDfromFilename (lutInfo), 33
maskInvarFeatures, 35
maskInvarFeatures,RasterLayer-method
(maskInvarFeatures), 35
maskInvarFeatures,RasterStack-method
(maskInvarFeatures), 35
maskInvarFeatures,Satellite-method
(maskInvarFeatures), 35
names, 36
names,Satellite-method (names), 36
names<-,Satellite-method (names), 36
panSharp, 37
panSharp,RasterLayer-method (panSharp),
37
panSharp,RasterStack-method (panSharp),
37
panSharp,Satellite-method (panSharp), 37
par, 40
pck_data, 39
pck_lut, 39
plot, 39
plot,Satellite,ANY-method (plot), 39
plot.default, 39, 40
projectRaster, 4, 41
projectSatellite, 40
projectSatellite,Satellite-method
(projectSatellite), 40
resample, 4, 41
satAtmosCorr (deprecated), 31
53
satCalib (deprecated), 31
satellite, 39, 41, 46, 47
satellite,character-method (satellite),
41
satellite,list-method (satellite), 41
satellite,RasterStack-method
(satellite), 41
Satellite-class, 42
satellite-package, 2
SatelliteInfo-class, 42
SatelliteLayers-class, 43
SatelliteLog-class, 43
SatelliteMetaData-class, 43
satellitepackage (satellite-package), 2
satInfo, 44
satInvarFeatures (deprecated), 31
satPathRadDOS (deprecated), 31
satTOAIrrad (deprecated), 31
setSatBCDE (satInfo), 44
stack, 49, 49
stack,Satellite-method (stack), 49
subset, 50
subset,Satellite-method (subset), 50
updateRasterMetaData (satInfo), 44