Skip to contents

Compute view angles at high resolution

Usage

compute_view_angles(
  mtd_tl,
  mtd_msi,
  detector_files = NULL,
  band = "B02",
  angle_type = "zenith",
  res = 10,
  shift_s2tbx = FALSE,
  output_dir = NULL,
  overwrite = FALSE
)

Arguments

mtd_tl

sen2proc::mtd_tl object, see read_mtd_tl

mtd_msi

sen2proc::mtd_msi object, see read_mtd_msi

detector_files

character. S2 detector files for processed band

band

character. S2 band name, .e.g. "B02"

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 band: for each angle type: for each detector: 1. load angle raster at resolution 5000 m 2. extrapolate angles on the border 3. resample (bilinear) at the given resolution 4. crop at detector footprint

If shift_s2tbx is TRUE the rasters are shifted by half the resolution at:

  • the loading (step 1)

  • before resampling (step 3)