Skip to contents

Computes sun angles at high resolution

Usage

compute_sun_angles(
  mtd_tl,
  angle_type,
  res = 10,
  shift_s2tbx = FALSE,
  output_dir = NULL,
  overwrite = FALSE
)

Arguments

mtd_tl

sen2proc::mtd_tl object, see read_mtd_tl

angle_type

character. "zenith" or "azimuth"

res

integer. resolution in meters, .e.g. 10, 20 or 60.

shift_s2tbx

logical. If TRUE, xy shift to have the same behaviour as SNAP s2tbx.

output_dir

character. Output directory. If NULL, a raster is returned.

overwrite

logical. If TRUE, overwrite existing file.

Value

terra::SpatRaster.

Details

The workflow of this function is the following: for each angle type:

  1. load angle raster at resolution 5000 m

  2. resample (bilinear) and crop to the reference raster at the given resolution