S2_granule_naming: S2_granule_naming

View source: R/S2_granule_naming.R

S2_granule_namingR Documentation

S2_granule_naming

Description

Creates a filename to store a downloaded 'granule', based on query response for a single 'granuleId'

Usage

S2_granule_naming(x, order = c("date", "utm", "orbit", Id = "granuleId"),
  prefix = "GRANULE", suffix = ifelse(as.numeric(x$atmCorr) == 0,
  "L1C", "L2A"))

Arguments

x

is the returned data S2_query_granule for a single 'granuleId'

order

character vector representing the desired naming order. Allowed values are '"date", "utm", "orbit", "granuleId", "productId", "cloudCov", "atmCorr"'. If an element in 'order' is named, the name of the element is used as prefix for its value (without any separator). (The 'time' portion of 'date' will be truncated to avoid spaces and colons in the filename.)

prefix

character 'GRANULE' by default

suffix

character by default turns to 'L1C', if 'atmCorr = 0.0'. If 'atmCorr != 0.0' in x, 'suffix' will become 'L2A'.

Details

This function allows to alter the automatic naming behavior for downloaded granules. Useful, when it is desired to add a custom prefix / suffix or make files be easier sortable by utm zone Id instead of acquision date.

Value

character name


IVFL-BOKU/sentinel2 documentation built on May 13, 2022, 11:15 p.m.