
MODIStsp helper for processing original HDF layers
Source:R/MODIStsp_process_bands.R
MODIStsp_process_bands.RdInternal function used to perform the required spatial
processing on MODIS original hdf layers (reprojection, resizing, resampling,
mosaicing, computation of scaling factors). The function is based on the
use of gdal routines.
Usage
MODIStsp_process_bands(
out_folder_mod,
modislist,
outproj_str,
mod_proj_str,
sens_sel,
band,
bandname,
date_name,
datatype,
nodata_in,
nodata_out,
full_ext,
bbox,
scale_val,
scale_factor,
offset,
out_format,
outrep_file,
compress,
out_res_sel,
out_res,
resampling,
nodata_change,
gui,
verbose,
parallel
)Arguments
- out_folder_mod
characterOutput folder for original HDF storage. If"$tempdir"(default), a temporary directory is used.- modislist
character arrayList of MODIS images to be downloaded for the selected date (as returned fromget_mod_filenames). Can be a single image, or a list of images in case different tiles are needed!- outproj_str
characterEPSG or WKT of output projection.- mod_proj_str
characterEPSG or WKT of MODIS projection.- sens_sel
character ["terra" | "aqua"]Selected sensor.- band
numericband number corresponding to the HDF layer to be processed- bandname
characterName of the HDF layer to be processed.- date_name
characterDate of acquisition of the images to be downloaded.- datatype
characterDatatype to the HDF layer to be processed.- nodata_in
numericOriginal nodata value to the HDF layer to be processed.- nodata_out
numericOutput nodata value to the HDF layer to be processed.- full_ext
logicalIf TRUE, process full tiles, if FALSE, process bbox- bbox
numeric(4)Output bounding box (xmin, ymin, xmax, ymax) in out_proj coordinate system. Ignored if spatmeth == "tiles", Default: NULL- scale_val
logicalIf TRUE, scale and offset are applied to original MODIS layers, and Spectral Indexes are saved as floating point. If FALSE, no rescaling is done and Spectral Indexes are saved as integer, with a 10000 scaling factor.- scale_factor
numericScale factor to be applied to the HDF layer to be processed (Ignored ifscale_val== FALSE).- offset
numericOffset to be applied to the HDF layer to be processed (Ignored ifscale_val== FALSE).- out_format
character ["ENVI" | "GTiff"]Desired output format.- outrep_file
characterFull path of the file where results of the processing are to be stored (created inMODIStsp_process)- compress
character ["None" | "PACKBITS" | "LZW" | "DEFLATE"]Compression method for GTiff outputs (Ignored ifout_format == ENVI)- out_res_sel
character ["Native", "User Defined]. If "Native", the outputs keep the original resolution of MODIS HDF images. Otherwise, the value set in "out_res" is used.- out_res
floatOutput resolution (in output projection measurement unit). Ignored if out_res_sel == "Native".- resampling
character ["near" | "bilinear" | "cubic" | "cubicspline", |lanczos"|, "average"|, "mode", |"max"|, |"min"|, |"q1"|, |"q3"|, |"sum"|]Resampling method to be used bygdalwarp.- nodata_change
logicalif TRUE, NoData values are set to the max value of the datatype of the layer on the MODIStsp output rasters. NOTE: If multiple nodata values are reported for a layer, all are reset to the new value.- gui
logicalif TRUE: the GUI is opened before processing. If FALSE: processing parameters are retrieved from the providedopts_fileargument), Default: TRUE- verbose
logicalIf FALSE, suppress processing messages, Default: TRUE- parallel
logicalIf TRUE, the function is run using parallel processing, to speed-up the computation for large rasters (with a maximum of 8 cores). The number of cores is automatically determined; specifying it is also possible (e.g.parallel = 4). In this case, more than 8 cores can be specified. If FALSE (default), single core processing is used.