SmoothStack: Run MODIS-R Whittaker smoothing over pre-processed raster...

Description Usage Arguments Details Value See Also Examples

View source: R/RS_get.R

Description

SmoothStack takes a raster stack of RS images and outputs a smoothed raster brick over the same time period.

Usage

1
2
3
4
SmoothStack(inStack, w = NULL, t = NULL, lambda = 5000, nIter = 3,
  outputAs = "one", collapse = FALSE, outDirPath = "./",
  removeOutlier = FALSE, outlierThreshold = NULL,
  mergeDoyFun = "max", ...)

Arguments

inStack

The name of the raster stack to smooth.

w

FROM whittaker.raster: In case of MODIS composite the 'VI_Quality' raster-Brick, Stack or filenames. Use preStack functionality to ensure the right input.

t

FROM whittaker.raster: In case of MODIS composite the 'composite_day_of_the_year' raster-Brick, Stack or filenames. Use preStack functionality to ensure the right input.

lambda

FROM whittaker.raster: _Yearly_ lambda value passed to ?ptw:::wit2. If set as character (i.e. lambda="600"), it is not adapted to the time serie length but used as a fixed value (see details). High values = stiff/rigid spline

nIter

FROM whittaker.raster: Number of iteration for the upper envelope fitting.

outputAs

FROM whittaker.raster: Character. Organisation of output files: single each date one RasterLayer, yearly a RasterBrick for each year, one one RasterBrick for the entire time-serie.

collapse

FROM whittaker.raster: logical, if TRUE the input data is treated as _1_single_Year_ collapsing the data using the Julian date information without the year.

outDirPath

FROM whittaker.raster: Output path default is the current directory.

removeOutlier

FROM whittaker.raster: Logical. See details

outlierThreshold

FROM whittaker.raster: Numerical in the same unit as vi, used for outliers removal. See details

mergeDoyFun

FROM whittaker.raster: Especially when using argument collapse=TRUE, multiple measurements for one day can be present, here you can choose how those values are merged to one single value: "max" use the highest value, "mean" or "weighted.mean" use the mean if no weighting "w" is available and weighted.mean if it is.

...

nFROM whittaker.raster: Arguments passed to ?writeRaster (except filename is automatic), NAflag, datatype, overwrite,...

Details

SmoothStack converts a raster stack of RS images (as processed through ConvertRS2Stack) and calls the MODIS-R whittaker.raster smoothing function to generate a smoothed raster brick over the same time series as the input. All function parameters are per the whittaker.raster function except we force the timeInfo to be derived from the input raster stack so the names match and the smoothed brick can be used in other tools. The whittaker.raster tool also exports a set of smoothed TIFs, so also specify an output file directory.

Value

raster brick of smoothed images

See Also

Other MODIS: CalcStatsRS, ConvertRS2Stack, ConvertStack2NC, GapFillRS, GetMODIS, InsertRS

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Take the raster stack of LAI images created through ConvertRS2Stack and 
## apply a smoothing filter that also removes outliers, which we specify to 
## be more than 0.5 LAI from the smoothed value.
## Not run: 
lai.b.sm <- SmoothStack(lai.b, 
         outDirPath="/Volumes/d1/adugger/RS/MODIS_ARC/PROCESSED/FRNTRNG_LAI_SMOOTHED", 
         outputAs="one", removeOutlier=TRUE, outlierThreshold=0.5, lambda=1000, 
         overwrite=TRUE)

## End(Not run)

NCAR/rwrfhydro documentation built on Feb. 28, 2021, 12:47 p.m.