Internal 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.
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
)The function is called for its side effects
character Output folder for original HDF storage.
If "$tempdir" (default), a temporary directory is used.
character array List of MODIS images to be downloaded for
the selected date (as returned from get_mod_filenames). Can be a single
image, or a list of images in case different tiles are needed!
character EPSG or WKT of output projection.
character EPSG or WKT of MODIS projection.
character ["terra" | "aqua"] Selected sensor.
numeric band number corresponding to the HDF layer to be
processed
character Name of the HDF layer to be processed.
character Date of acquisition of the images to be
downloaded.
character Datatype to the HDF layer to be processed.
numeric Original nodata value to the HDF layer to be
processed.
numeric Output nodata value to the HDF layer to be
processed.
logical If TRUE, process full tiles, if FALSE, process
bbox
numeric(4) Output bounding box (xmin, ymin, xmax, ymax) in
out_proj coordinate system. Ignored if spatmeth == "tiles", Default: NULL
logical If 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.
numeric Scale factor to be applied to the HDF layer
to be processed (Ignored if scale_val == FALSE).
numeric Offset to be applied to the HDF layer
to be processed (Ignored if scale_val == FALSE).
character ["ENVI" | "GTiff"] Desired output format.
character Full path of the file where results of the
processing are to be stored (created in MODIStsp_process)
character ["None" | "PACKBITS" | "LZW" | "DEFLATE"]
Compression method for GTiff outputs (Ignored if out_format == ENVI)
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.
float Output resolution (in output projection measurement
unit). Ignored if out_res_sel == "Native".
character ["near" | "bilinear" | "cubic" | "cubicspline", |lanczos"|, "average"|, "mode", |"max"|, |"min"|, |"q1"|, |"q3"|, |"sum"|]
Resampling method to be used by gdalwarp.
logical if 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.
logical if TRUE: the GUI is opened before processing. If FALSE:
processing parameters are retrieved from the provided opts_file
argument), Default: TRUE
logical If FALSE, suppress processing messages, Default: TRUE
logical If 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.
Lorenzo Busetto, phD (2014-2017)
Luigi Ranghetti, phD (2015)