getXML: Function that checks the integrity of MODIS-grid-hdf files in...

Description Usage Arguments Value Author(s) See Also Examples

Description

Each MODIS HDF file has a xml-metafile. This data contains usefull information about each MODIS-hdf file. Within that package, the xml-files are used to check the size of the downloaded hdf files, and correcting the so often broken downloads. 'getXML' checks locally for the presence of spezified xml files and if not available it retrieves them from the MODIS ftp server.

Usage

1
getXML(LocalArcPath,HdfName,checkSize=TRUE,wait=1,quiet=FALSE)

Arguments

LocalArcPath

Character. Is the path to look recursively for MODIS-HDF files. If left Blank, the standard argument list.files(path=".") is used. If HdfName is not set, all underlaying MODIS-HDF files are checked for the XML file presence. If not available locally the MODIS-XML file is downloaded.

HdfName

Character. Is a filename or a pattern (regular expression) to check for XML file presence. If HdfName is not set all found MODIS-XML files are gathered regarding the LocalArcPath setting.

checkSize

Logical. Defoult TRUE, The main purpose of getXML() is to control if MODIS HDF files have been downloaded properly. If FALSE the function only downloads missing XML files without "checksum" the HDF files.

wait

Numeric. Default 1. Inserts a break (in seconds) after every internal download.file() or getURL() call. It reduces the chance of FTP connection error that often occurs. Requires the 'audio' package. Recommended values 1 to 3 seconds (more files, higer value). (Hopefully wait is a temporary solution!)

quiet

Logical. Refers to all internal download.file() actions. Default FALSE

Value

An (invisible) integer code, 0 for success and non-zero for failure (see: ?download.file). Look in the directory where the HDF files are stored to check for XML files.

Author(s)

Matteo Mattiuzzi

See Also

getHDF

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# checks all HDF files under path="." for the XML-file and size
getXML()

# check all MODIS Terra Vegetation Indices 250 m (13Q1) under "."
getXML(HdfName="MOD13Q1*")

# check for a single file
getXML(HdfName="MYD09GA.A2011002.h19v05.005.2011007211429.hdf")

## End(Not run)

getMODIS documentation built on May 2, 2019, 4:51 p.m.