Description Usage Arguments Details Value References Examples
View source: R/topographic_corr.R
Performs topographic correction using code based on topocorr
from the
landsat
package by Sarah Goslee. The code in this package has been
modifed from topocorr
to allow using a subsample of the image for
Minnaert k calculations, and to provide the option of running the
topographic correction in parallel using foreach
.
1 2 3 |
x |
an image to correct |
slopeaspect |
a |
sunelev |
sun elevation in degrees |
sunazimuth |
sun azimuth in degrees |
method |
the topographic correction method to use. See the help for
|
sampleindices |
(optional) row-major indices of sample pixels to use in
regression models used for some topographic correction methods (like
Minnaert). Useful when handling very large images. See
|
scale_factor |
factor by which to multiply results. Useful if rounding
results to integers (see |
asinteger |
whether to round results to nearest integer. Can be used to
save space by saving results as, for example, an 'INT2S' |
DN_min |
minimum allowable pixel value after correction (values less
than |
DN_max |
maximum allowable pixel value after correction (values less
than |
... |
additional arguments to pass to |
This function will run in parallel if a parallel backend is registered with
foreach
.
The topographically corrected image as a RasterLayer
or
RasterStack
Sarah Goslee. Analyzing Remote Sensing Data in R: The landsat Package. Journal of Statistical Software, 2011, 43:4, pg 1–25. http://www.jstatsoft.org/v43/i04/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
# Mosaic the two ASTER DEM tiles needed to a Landsat image
DEM_mosaic <- mosaic(ASTER_V002_EAST, ASTER_V002_WEST, fun='mean')
# Crop and extend the DEM mosaic to match the Landsat image
matched_DEM <- match_rasters(L5TSR_1986, DEM_mosaic)
slopeaspect <- terrain(matched_DEM, opt=c('slope', 'aspect')
# Apply the topographic correction
sunelev <- 90 - 44.97 # From metadata file
sunazimuth <- 124.37 # From metadata file
L5TSR_1986_topocorr <- topographic_corr(L5TSR_1986, slopeaspect, sunelev,
sunazimuth, method='minslope')
plotRGB(L5TSR_1986, stretch='lin', r=3, g=2, b=1)
plotRGB(L5TSR_1986_topocorr, stretch='lin', r=3, g=2, b=1)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.