process_modis_swath | R Documentation |
This function will return a SpatRaster
object with
values of selected subdatasets. Swath data include curvilinear
grids, which require warping/rectifying the original curvilinear grids
into rectilinear grids. The function internally warps each of inputs
then mosaic the warped images into one large SpatRaster
object.
Users need to select a subdataset to process. The full path looks like
"HDF4_EOS:EOS_SWATH:{file_path}:mod06:subdataset"
, where file_path is
the full path to the hdf file.
process_modis_swath(
path = NULL,
date = NULL,
subdataset = NULL,
suffix = ":mod06:",
resolution = 0.05,
...
)
path |
character. Full paths of hdf files. |
date |
character(1). Date to query. |
subdataset |
character. Subdatasets to process.
Unlike other preprocessing functions, this argument should specify
the exact subdataset name. For example, when using MOD06_L2 product,
one may specify |
suffix |
character(1). Should be formatted |
resolution |
numeric(1). Resolution of output raster. Unit is degree (decimal degree in WGS84). |
... |
For internal use. |
a SpatRaster
object (crs = "EPSG:4326"
): if path
is a single file with
full specification of subdataset.
a SpatRaster
object (crs = "EPSG:4326"
): if path
is a list of files. In this case, the returned object will have the maximal extent of multiple warped layers
Insang Song
process_modis_warp()
, stars::read_stars()
, stars::st_warp()
terra::describe()
: to list the full subdataset list with sds = TRUE
terra::sprc()
, terra::rast()
## NOTE: Example is wrapped in `\dontrun{}` as function requires a large
## amount of data which is not included in the package.
## Not run:
mod06l2_swath <- process_modis_swath(
path = list.files(
"./data/mod06l2",
full.names = TRUE,
pattern = ".hdf"
),
date = "2024-01-01",
subdataset = "Cloud_Fraction",
suffix = ":mod06:",
resolution = 0.05
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.