Learn R Programming

mod09nrt (version 0.14)

check_for_matching_geolocation_files_mod09nrt: Checks that every MODIS surface reflectance project HDF has a matching MOD03 file

Description

Each MOD09 surface reflectance product file requires a corresponding MOD03 geolocation file to be successfully processed with the MRTSwath tool.

Usage

check_for_matching_geolocation_files_mod09nrt(moddir = getwd(), modtxt = "MOD09", geoloctxt = "MOD03", return_geoloc = FALSE, return_product = FALSE)

Arguments

moddir
the string describing the directory containing the MOD09 and MOD03 files; both must be in the same directory. Default: getwd(), which gives the present working directory.
modtxt
the text string indicating which HDF files are the MODIS surface reflectance product (or hypothetically, other product). Default: MOD09 (MODIS surface reflectance product)
geoloctxt
the text string indicating which HDF files are the MODIS geolocation files (or hypothetically, another set of files). Default: MOD03
return_geoloc
if TRUE, return the list of unmatched geolocation files (e.g. MOD03 )
return_product
if TRUE, return the list of unmatched product files (e.g. MOD09)

Value

data.frame of matching files; or a list of non-matching files, if return_geoloc or return_product are TRUE.

Details

MRTSwath is the MRT (MODIS Reprojection Tool) for the MODIS

E.g. this surface reflectance file:

MOD09.A2016204.0500.005.2016204062219.NRT.hdf

...goes with this corresponding geolocation file:

MOD03.A2016204.0500.005.2016204060250.NRT.hdf

...which is a large file (~30 MB) containing detailed information on the position, tilt, etc. of the MODIS satellite. MRTSwath tool needs one of each, however.

Examples

Run this code
# Check your working directory
moddir = getwd()

# Here are some example MODIS files in mod09nrt/extdata/
# Code excluded from CRAN check because it depends on modiscdata
## Not run: 
# library(devtools)
# library(modiscdata)
# moddir = system.file("extdata/2002raw/", package="modiscdata")
# 
# # You need to have some e.g. MOD files in it (from the MODIS-TERRA platform)
# list.files(path=moddir, pattern="MOD")
# list.files(path=moddir, pattern="MOD")
# 
# # Check for matches (for MODIS-TERRA platform)
# check_for_matching_geolocation_files_mod09nrt(moddir=moddir, modtxt="MOD09", geoloctxt="MOD03", 
# return_geoloc=FALSE, return_product=FALSE)
# ## End(Not run)

Run the code above in your browser using DataLab