MODISoptions: Set or retrieve permanent MODIS package options

Description Usage Arguments Details Author(s) Examples

View source: R/MODISoptions.R

Description

With this function you can get or set _persistant_ MODIS package options (per user or systemwide). Changes here will persist sessions and updates.

Usage

1
2
3
MODISoptions(localArcPath, outDirPath, pixelSize, outProj, resamplingType, 
dataFormat, gdalPath, MODISserverOrder, dlmethod, stubbornness,
systemwide = FALSE, quiet = FALSE, save=TRUE, checkPackages=TRUE)

Arguments

localArcPath

File Path where to store downloaded MODIS-HDF files. Default is "~/MODIS_ARC".

outDirPath

The output path where to store results of runGdal or runMrt. Default is "~/MODIS_ARC/PROCESSED"

pixelSize

Default asIn. Output pixel size [target reference system units] of processing functions runGdal and runMrt.

outProj

Default asIn. Target reference system where to process data using runGdal or runMrt, must be a valid CRS for runGdal. For runMrt consult the manual of MRT. Since the two pocessing method do not have common methods, it is suggested to leave the default. See Details.

resamplingType

Default is NN (Neares Neightbour). In common for MRT and GDAL are NN', 'CC', 'BIL. GDAL supports also: cubicspline and lanczos, GDAL >= 1.10.0 also mode and average.

dataFormat

Default is GTiff. Or one of getOption("MODIS_gdalOutDriver") (column 'name').

gdalPath

Path to gdal _bin_ directory, relvand more for windows. Use MODIS:::checkTools("GDAL") to detect it automaticly

MODISserverOrder

Default "LPDAAC","LAADS", you may invert, or select only one server, inhibiting all efforts to download data from the second available server.

dlmethod

Default auto see argument method in ?download.file. On a Unixoid (also Mac?) it is suggested to use wget or if installed aria2.

stubbornness

The number of re-tries after that the HTTP/FTP server has refused the connection. Higher values increase the chance of getting the file but also leads to hanging functions if the server is down.

systemwide

Default FALSE. 'User' wide settings saved to path.expand("~/.MODIS_Opts.R"), if TRUE write settings to 'systemwide', presumed you have write access to paste(R.home(component="etc"), '/', '.MODIS_opts.R', sep='')

quiet

Logical. Print or not options to console.

save

Default TRUE make settings permanent.

checkPackages

Default TRUE check if suggested R packages, 'GDAL' and 'MRT' are installed.

Details

This Settings are _permanent_, easy to change and take effect immediatley! If you change default values consider that your settings have to be valid for any MODIS product, layer and area!

It is _not_ recommended to use a _not_ globally applicable georeference reference system as default outProj, or a fixed pixelSize for different products or a resamplingType that is not nn.

localArcPath and outDirPath should be changed, expecially on a Windows system as '~/MODIS_ARC/...' is normally on the 'c:/...' drive. You can set also a shared network drive if you have or want a central MODIS data server.

On Windows you have to set gdalPath to the location of GDAL executables (the '.../GDAL../bin' directory). On Unix-alikes this should not be required unless you want to specify a non default GDAL installation.

On an unixoid OS it is suggested to use dlmethod='wget' because its a reliable tool and, after the change of the 'LP DAAC' datapool from FTP to HTTP (May 2013) dlmethod='auto' seams not to work properly. On Windows it seams to work fine with dlmethod='auto'. Help and suggestions appreciated!

Author(s)

Matteo Mattiuzzi and Steven Mosher

Examples

1
2
3
4
5
## Not run: 
MODISoptions()
# MODISoptions(localArcPath="/another/path/than/default")

## End(Not run)

MODIS documentation built on May 2, 2019, 6:09 p.m.

Related to MODISoptions in MODIS...