solarAngles: Calculates solar angles

View source: R/water_netRadiation.G.R

solarAnglesR Documentation

Calculates solar angles

Description

Metadata, aspect and slope maps are combined to estimate solar angles for the entire image.

Usage

solarAngles(surface.model, MTL, WeatherStation)

Arguments

surface.model

SpatRaster with layers DEM, Slope and Aspect, from METRICtopo()

MTL

path to the Landsat metadata (*_MTL.txt) file. Required

WeatherStation

waterWeatherStation object (see read.WSdata) or the data.frame returned by getDataWS()

Details

Latitude is computed for each row of the grid; declination and hour angle are computed from the acquisition date and scene centre time in the MTL file and the weather station longitude. Solar incidence angles are computed for a horizontal surface (incidence.hor) and for the sloping surface given by Slope and Aspect (incidence.rel), following Allen et al. (2007).

Value

SpatRaster with layers (radians) latitude, declination, hour.angle (negative before solar noon), incidence.hor (solar incidence angle on a horizontal surface) and incidence.rel (incidence angle on the sloping surface).

Author(s)

Guillermo Federico Olmedo

David Fonseca-Luengo

Fernando Fuentes-Peñailillo

References

R. G. Allen, M. Tasumi, and R. Trezza, "Satellite-based energy balance for mapping evapotranspiration with internalized calibration (METRIC) - Model" Journal of Irrigation and Drainage Engineering, vol. 133, p. 380, 2007

See Also

Other net radiation related functions: LAI(), METRICtopo(), SWtransmissivity(), albedo(), incLWradiation(), incSWradiation(), netRadiation(), outLWradiation(), soilHeatFlux(), surfaceTemperature()

Examples

# a small window of the Landsat 7 example scene, to run quickly
MTL <- system.file("extdata", "L7.MTL.txt", package = "water")
WeatherStation <- read.WSdata(WSdata = system.file("extdata", "apples.csv", package = "water"),
  date.format = "%d/%m/%Y", lat = -35.42222, long = -71.38639, elev = 201, height = 2.2,
  cf = c(1, 0.2777778, 1), tz = "America/Santiago", MTL = MTL)
image.DN <- terra::rast(L7_Talca)[1:60, 1:80, drop = FALSE]
DEM <- terra::rast(DEM_Talca)[1:60, 1:80, drop = FALSE]
surface.model <- METRICtopo(DEM)
solar.angles <- solarAngles(surface.model = surface.model,
                            WeatherStation = WeatherStation, MTL = MTL)
plot(solar.angles)

water documentation built on Nov. 25, 2026, 5:08 p.m.