MODIStsp_process: MODIStsp main processing function

View source: R/MODIStsp_process.R

MODIStsp_processR Documentation

MODIStsp main processing function


Main processing function of MODIStsp. Takes as input processing parameters specified by the user and performs all required processing.


MODIStsp_process(proc_opts, n_retries, verbose = TRUE, parallel = TRUE)



data.frame containing all processing parameters, as passed from the MODIStsp GUI, or created in MODIStsp by joining explicitly passed arguments with a (not mandatory) options file.


numeric maximum number of retries on download functions. In case any download function fails more than n_retries times consecutively, MODIStsp_process will abort, Default: 20


logical If FALSE, suppress processing messages, Default: TRUE


logical If TRUE (default), 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.


After retrieving the input processing options, the function

  1. Accesses NASA http archive to determine the list of files to be downloaded/processed (or, in case of offline processing, get the list of already available hdf files present in out_mod_folder);

  2. Performs all required processing steps on each date (download, reprojection, resize, mosaicing, Spectral Indexes and Quality indicators computation);

  3. Creates virtual files of the processed time series.

Reprojection and resize is dealt with by accessing gdal routines through the gdalUtilities package. Extraction of bitfields from Quality layers is done though bitwise computation Checks are done in order to not re-download already existing HDF images, and not reprocess already processed dates (if the user did not specify that)


The function is called for its side effects.


Thanks Tomislav Hengl and Babak Naimi, whose scripts made the starting point for development of this function (ModisDownload; Download_and_resampling_of_MODIS_images)

License: GPL 3.0


Lorenzo Busetto, phD (2014-2017)

Luigi Ranghetti, phD (2015)

MODIStsp documentation built on Oct. 13, 2023, 5:11 p.m.