Skip to content

4.6 composite.R

Mateusz Żółtak edited this page Oct 16, 2019 · 4 revisions

Computes composites for a given periods by combining data from the rawDir (either raw Sentinel 2 L2A data or indicators computed with the indicator step) according to the n indicators computed by the which step.

Command line arguments

  • A standard set of configFilePath, regionName, startDate and endDate.
  • A period argument specifying the aggregation period. Period description consists of a number and a period type name (day, month or year), e.g. 1 year or 10 days. Period type name can be also provided in plural, e.g. 2 months, 1 years, 10 days.

Data input/output

Reads data from both rawDir (composited bands) and periodsDir (n indicators produced by the which step) and stores results into the periodsDir.

All input and output band names are provided by the configuration (see below), e.g. for a configuration like at the bottom of the page (with two composites defined), and the runtime parameters (monthly composites for two months)

Rscript composite.R myConfig.R myRegion 2018-04-01 2018-05-31 '1 month'

it is expected the the periodsDir contains (for every tile)

2018-04m1_NMaxNDVI_{tile}.tif
2018-05m1_NMaxNDVI_{tile}.tif

and the output files created for every tile in the periodsDir will be (2 monthly periods * 2 composites):

2018-04m1_NDVIComp_{tile}.tif
2018-05m1_NDVIComp_{tile}.tif

2018-04m1_TCIComp_{tile}.tif
2018-05m1_TCIComp_{tile}.tif

Performance

This processing step consists of very simple computations and depends mostly on the storage performance.

Configuration

  • compositeSkipExisting should already existing output composites be skipped (TRUE) or reprocessed anyway (FALSE).
  • compositeBands a list of three vectors defining composites to be computed. All vectors must have same lenght. Corresponding elements of each vector describe the same output composite.
    • band input band/indicator from the rawDir to be composited.
    • whichBand the n indicator band name computed during the which step to be used for a given composite.
    • outBand output band name.
  • compositeBlockSize dimension of the processing block - see memory considerations on the parallelization page.

A sample configuration producing composites of the NDVI and TCI bands using the NMaxNDVI indicator computed during the which step:

compositeSkipExisting = TRUE
compositeBands = list(
  band      = c('NDVI',     'TCI'),
  whichBand = c('NMaxNDVI', 'NMaxNDVI'),
  outBand   = c('NDVIComp', 'TCIComp')
)
compositeBlockSize = 512
Clone this wiki locally