Learn R Programming

sits (version 0.10.0)

sits_cube.stack_cube: Defines a cube from a set of single image files

Description

Defines a cube to retrieve data from a set of image files. All image files should have the same spatial resolution and same projection. Each file contains a single image band for a single date; its name contains date and band information. This is the case of files in repositories such as Sentinel Hub and AWS. This case is called an "image stack", following the terminology used by the "raster" R package

Timeline and the bands are deduced from filenames. Examples of valid image names include "CB4_64_16D_STK_022024_2018-08-29_2018-09-13_EVI.tif" and "B02_2018-07-18.jp2". In each case, the user has to provide appropriate parsing information that allows SITS to extract the band and the date. In the examples above, the parsing info would include "_" as a delimiter. In the first, the names of the resulting columns for parsing are "X1", "X2", "X3", "X4", "X5", "date", "X7", and "band". In the second, only "band" and "date".

Usage

# S3 method for stack_cube
sits_cube(
  type = "STACK",
  ...,
  name = "stack_cube",
  satellite,
  sensor,
  data_dir = NULL,
  parse_info = sits:::.sits_config_data_parse_info(type),
  delim = sits:::.sits_config_data_delim(type)
)

Arguments

type

type of cube

...

other parameters

name

name of output data cube

satellite

satellite

sensor

sensor

data_dir

directory where data is located

parse_info

parsing information (see above)

delim

character to use as delimiter (default = "_")

Value

data cube

Examples

Run this code
# NOT RUN {
# Create a cube based on a stack of CBERS data
data_dir <- system.file("extdata/raster/cbers", package = "sits")

cbers_cube <- sits_cube(
    type = "STACK",
    name = "022024",
    satellite = "CBERS-4",
    sensor = "AWFI",
    data_dir = data_dir,
    delim = "_",
    parse_info = c("X1", "X2", "band", "date")
)
# }

Run the code above in your browser using DataLab