process_modis_warp | R Documentation |
Swath data is a type of MODIS data,
where curvilinear points are stored with varying resolution depending on
the relative position of the sensor axis. As this type of data
typically does not work well with planar spatial data, users
should warp or rectify this data into a rectilinear raster.
Main procedure is done with stars::st_warp
, in which users are able to
customize the threshold to fill potential gaps that appear where
the target resolution is finer than the local resolution of curvilinear
grid points.
process_modis_warp(
path = NULL,
cellsize = 0.1,
threshold = cellsize * 4,
crs = 4326,
...
)
path |
File path of MODIS swath with exact sub-dataset specification. |
cellsize |
numeric(1). Cell size (spatial resolution) of output rectilinear grid raster. |
threshold |
numeric(1). Maximum distance to fill gaps if occur. |
crs |
integer(1)/character(1). Coordinate system definition.
Should be compatible with EPSG codes or WKT2.
See |
... |
For internal use. |
a stars
object
This function handles one file at a time.
Insang Song
terra::rectify
## NOTE: Example is wrapped in `\dontrun{}` as function requires a large
## amount of data which is not included in the package.
## Not run:
mod06l2_warp <- process_modis_warp(
path = paste0(
"HDF4_EOS:EOS_SWATH:",
list.files(
"./data/mod06l2",
full.names = TRUE,
pattern = ".hdf"
)[1],
":mod06:Cloud_Fraction"
),
cellsize = 0.1,
threshold = 0.4,
crs = 4326
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.