Description Usage Arguments Value Author(s) Examples
Convert raw Landsat or Aster satellite image values (the "digital number"), to radiance, reflectance or temperature.
1 2 3 |
x |
Satellite image object inherting from class 'Landsat' |
filename |
Optional. Filename for output file of radiance, reflectance or temperature values.
If not provided these may be stored in a temporary file. You can also provide |
... |
Additional arguments to writeRaster, such as the file format, and |
A calibrated Landsat object.
Alice Laborte, Yann Chemin, Robert Hijmans, Matteo Mattiuzzi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ## Not run:
metafile <- system.file("external/L71129046_04620080329_MTL.txt", package="RemoteSensing")
#Create Landsat object
img <- landsat(metafile)
# calculate reflectance
ref <- dn2ref(img)
## calculate reflectance and save output as a tmp RasterBrick;
require(rgdal)
# whith filename='default.XXX' name
ref <- dn2ref(img,filename='default.tif') # to current directory
ref <- dn2ref(img,filename='default.img') # to current directory
ref <- dn2ref(img,filename='/path/to/default.tif') # to specified directory
# with user specified name
ref <- dn2ref(img,"ref.img")
# unlink("ref.img")
# true color:
# plotRGB(ref, 3,2,1, scale=0.36)
# false color:
# plotRGB(ref, 4,3,2, scale=0.45)
# calculate temperature (LST) from thermal bands
# here you can also apply the filename='default.tif'
temp <- dn2temp(img)
# plot(temp@thermal)
# or for the generation of a fully calibrated image
ref <- dn2ref(img)
calib <- dn2temp(ref)
calib # reflectance bands
calib@thermal # LST bands
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.