Set or retrieve persistant MODIS package options (per user or systemwide). Changes here will persist through sessions and updates.
MODISoptions(localArcPath, outDirPath, pixelSize, outProj, resamplingType,
dataFormat, gdalPath, MODISserverOrder, dlmethod, stubbornness,
systemwide = FALSE, quiet = FALSE, save = TRUE, checkTools = TRUE)
character
, defaults to "~/MODIS_ARC"
.
Target folder for downloaded MODIS HDF files.
Defaults to "NN"
(Nearest Neightbour). MRT and
GDAL both support c('NN', 'CC', 'BIL')
. In addition, GDAL supports
cubicspline
and lanczos
and, from GDAL >= 1.10.0
onwards,
also mode
and average
.
character
, defaults to "GTiff"
. One of
getOption("MODIS_gdalOutDriver")
(column 'name').
character
. Path to gdal bin directory and more
relevant for Windows users. Use MODIS:::checkTools("GDAL")
to try to
detect it automatically.
character
. Possible options are "LAADS"
(default) and "LPDAAC"
(see 'dlmethod' and 'Details'). If only one
server is selected, all efforts to download data from the second server
available are inhibited.
character
, defaults to auto
. See 'method' in
download.file
. On Unix (also Mac?), it is suggested to use
"wget"
or, if installed, "aria2"
. In order to download MODIS
files from LPDAAC, please note that either wget (default) or curl must be
installed and made available through the PATH environmental variable.
numeric
. The number of retries after the target
server has refused a connection. Higher values increase the chance of getting
the file, but also lead to hanging functions if the server is down.
logical
. If FALSE
(default), 'user'-wide
settings are 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='')
.
logical
. If FALSE
(default), options are printed
to the console.
logical
. If TRUE
(default), settings are permanent.
logical
, defaults to TRUE
. Check if external
tools (i.e., GDAL and MRT) are installed and reachable through R.
These settings are permanent, easy to change and take effect immediately!
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 coordinate reference system that is not applicable globally as default for '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 OS, as '~/MODIS_ARC/...' is normally on the 'C:/...' drive. You may also specify a shared network drive if you have a central MODIS data server.
On Windows, you have to set 'gdalPath' to the location of GDAL executables (i.e., 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 it
is a reliable tool and, after the change of the 'LP DAAC' datapool from FTP
to HTTP (May 2013), dlmethod = 'auto'
seems not to work properly. On
Windows, on the other hand, dlmethod = 'auto'
seems to work fine.
Please note that in order to download MODIS files from LPDAAC, you are
required to register for an Earthdata Login Profile
(https://urs.earthdata.nasa.gov/users/new) and create a read-only
.netrc file in your home directory containing the Earthdata server address as
well as your login credentials. An automated solution for the creation of a
workable .netrc file is provided through lpdaacLogin
.
## get options
MODISoptions()
## set options
MODISoptions(localArcPath="/another/path/than/default")
Run the code above in your browser using DataCamp Workspace