MODIS (version 1.1.7)

orgStruc: Reorganise MODIS Files in Local Data Archive

Description

Re-organise the storage structure of your MODIS archive according to the settings in options("MODIS_arcStructure"). Depending on the specified 'source' , you can also use this function to gather all MODIS grid files on you computer and reorganise them. The main purpose is to organise the archive, but it is also possible to copy a subset of files to a desidered location!

Usage

orgStruc(from, to, structure, pattern, move = FALSE, quiet = FALSE)

Arguments

from

character. Local path to look for MODIS files, defaults to options("MODIS_localArcPath") (see MODISoptions).

to

character. Target folder to move (or copy) MODIS files to, defaults to options("MODIS_localArcPath").

structure

character. Storage structure, defaults to options("MODIS_arcStructure") (see Examples).

pattern

Regular expression passed to list.files. Insert a pattern if you want to extract specific files from your archiv.

move

logical. If TRUE, files are moved and duplicated files are deleted. If FALSE (default), files are just copied and thus remain in the origin folder. Note that the copying process performs rather slowly when dealing with large files, e.g. 250-m 'MOD13Q1'.

quiet

logical, defaults to FALSE.

Value

If quiet = FALSE, information on how many files have been moved (or copied) and deleted is printed to the console.

Examples

Run this code
# NOT RUN {
# MOVE all MODIS grid data to the directory and structure as defined in 
# options("MODIS_localArcPath", "MODIS_arcStructure")
orgStruc(move = TRUE)

# COPY all MOD13Q1 from 2001 to folder "MyFiles/MOD13Q1.collection/"
orgStruc(pattern="MOD13Q1.A2001*.",to="MyFiles",structure="PRODUCT.CCC")

# COPY all MOD13Q1 to folder "MyFiles/"
orgStruc(pattern="MOD13Q1.*.",to="MyFiles",structure="") 
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace