sun.zen: Calculate the solar zenit angle from raster.

View source: R/sun.zen.R

sun.zenR Documentation

Calculate the solar zenit angle from raster.

Description

This function will return the mean solar zenith angle for a given input raster with a given projection. Based on the zenith function (package GeoLight). Function will convert the coordinates to WGS 84 Lat Lon and use the mean longitude and latitude for the calculation of the solar zenith angle.

Usage

  sun.zen(ras,time)

Arguments

ras

Raster containing a spatial reference system. Function will convert the coordinates to WGS 84 Lat Lon.

time

Overpassing time / time when the scene was aquired. Time format 'POSIXct', e.g. "1990-01-01 10:00:00"

crs.code

CRS code for the respective image. Default: crs.code = CRS("+init=epsg:4326").

Details

Most likely, an occuring error stems from a to large grid -> crop grid before the calculation of the solar zenit angle!

Value

scalar

Examples


  red <- system.file("extdata", "B30.TIF", package="TriangleMethod")
  red <- raster(red)
  zen = sun.zen(red,"1980-11-14 10:00:00")


DGampe/TriangleMethod documentation built on March 18, 2022, 6:43 a.m.