Organise structure of the local MODIS data archive

Description

This function changes the storage structure (see details). Depending on the amount of files stored and how files are accessed, the folder structure can be changed. !Use this function with care!

Usage

1
orgSTRUC(LocalArcPath, deep = FALSE, HdfName, to, move = TRUE,quiet = FALSE)

Arguments

LocalArcPath

Character. Local path to look for MODIS files. If missing the default archive '~/MODIS_ARC/' (LINUX), 'C:/Documents and Settings/username/My Documents/MODIS_ARC/' (Windows XP) and 'C:/Users/username/Documents/MODIS_ARC' (Vista/Windows 7) is used.

deep

Logical. Default FALSE. !!! use with care !!! eventually put move=FALSE. if TRUE the functuion look in your entire home (UNIX-alikes) for MODI-GRID-HDF files! and removes them from the origin folder!!! Here a control of a more experienced peRson could spare myself from R-collgues curses!

HdfName

Character. Regular expression (passed to ?list.files) for file matching. If missing, all local MODIS grid data under LocalArcPath is considered.

to

Integer between 1 and 3

move

Logical. Default is TRUE, this means that files are moved and multiple files are deleted. If FALSE, files are just copied and remain in origin folder!

quiet

Logical. Default is FALSE

Details

If to is 1 than: /LocalArcPath/product.collection/hdf- and xml-files
If to is 2 than: /LocalArcPath/product.collection/year/hdf- and xml-files
If to is 3 than: /LocalArcPath/product.collection/date/hdf- and xml-files

Value

NONE, (or just an information about moved/copied files)

Author(s)

Matteo Mattiuzzi

See Also

getXML,getHDF

Examples

1
2
3
4
5
6
7
8
## Not run: 
# MOVE all MODIS grid data to a MODIS data online pool like structure
orgSTRUC(to=3,move=TRUE)

# COPY all MOD13Q1 to folder "/LocalArcPath/MOD13Q1.collection/"
orgSTRUC(HdfName="MOD13Q1",to=1,move=FALSE)

## End(Not run)