Description Usage Arguments Details Value Author(s) See Also Examples
Each MOD35_L2 cloud mask product file requires a corresponding MOD03 geolocation file to be successfully processed with the MRTSwath tool.
1 2 3 | check_for_matching_geolocation_files(moddir = getwd(),
modtxt = "MOD35_L2", geoloctxt = "MOD03",
return_geoloc = FALSE, return_product = FALSE)
|
moddir |
the string describing the directory containing the MOD35_L2 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 cloud product (or hypothetically, other product). Default: MOD35_L2 (MODIS cloud mask 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 or MYD03) |
return_product |
if TRUE, return the list of unmatched product files (e.g. MOD35_L2 or MYD35_L2 or MOD06_L2 or MYD06_L2) |
MRTSwath is the MRT (MODIS Reprojection Tool) for the MODIS level 1 and level 2 products (cloud mask is level 2, I think).
E.g. this cloud mask file:
MOD35_L2.A2012001.0420.005.2012001131638.hdf
...goes with this corresponding geolocation file:
MOD03.A2012001.0420.005.2012001104706.hdf
...which is a large file (~30 MB) containing detailed information on the position, tilt, etc. of the MODIS satellite.
For whatever reason, even a search done at the same time at http://reverb.echo.nasa.gov/reverb/#utf8= will not necessarily return the same number of MOD35_L2 and MOD03 files. MRTSwath tool needs one of each, however.
data.frame of matching files; or a list of non-matching
files, if return_geoloc
or return_product
are TRUE.
Nicholas J. Matzke matzke@berkeley.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | # Check your working directory
moddir = getwd()
# Here are some example MODIS files in modiscloud/extdata/
# Code excluded from CRAN check because it depends on modiscdata
## Not run:
library(devtools)
# The modiscdata (MODIS c=cloud data=data) package is too big for CRAN (60 MB); so it is available on github:
# https://github.com/nmatzke/modiscdata
# If we can't get install_github() to work, try install_url():
# install_github(repo="modiscdata", username="nnmatzke")
install_url(url="https://github.com/nmatzke/modiscdata/archive/master.zip")
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)
# (*won't* work with the default files stored in modiscloud/extdata/2002raw/)
list.files(path=moddir, pattern="MOD")
# This directory actually has MYD files (from the MODIS-AQUA platform)
# (*will* work with the default files stored in modiscloud/extdata/2002raw/)
list.files(path=moddir, pattern="MYD")
# Check for matches (for MODIS-TERRA platform)
# (*won't* work with the default files stored in modiscloud/extdata/2002raw/)
check_for_matching_geolocation_files(moddir=moddir, modtxt="MOD35_L2", geoloctxt="MOD03", return_geoloc=FALSE, return_product=FALSE)
# Check for matches (for MODIS-AQUA platform)
# (*will* work with the default files stored in modiscloud/extdata/2002raw/)
check_for_matching_geolocation_files(moddir=moddir, modtxt="MYD35_L2", geoloctxt="MYD03", return_geoloc=FALSE, return_product=FALSE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.