Calculate photosynthetically active radiation (PAR) for a series of date-times and site coordinates.
Usage
calc_light(
solar.time,
latitude,
longitude,
max.PAR = u(2326, "umol m^-2 s^-1"),
attach.units = deprecated()
)
Arguments
- solar.time
mean solar time, as required for input to metabolism models. See
mm_data
andcalc_solar_time
.- latitude
numeric value or vector indicating the site latitude in decimal degrees (never radians or deg-min-sec, no matter what
format
is) between -90 (South Pole) and 90 (North Pole).- longitude
numeric, in degrees, either positive and unitted ("degE" or "degW") or with sign indicating direction (positive = East), describing location of the site
- max.PAR
numeric or unitted_numeric: the PAR (umol m^-2 s^-1) that each day should reach at peak light
- attach.units
(deprecated, effectively FALSE in future) logical. Should the returned vector be a unitted object?
Examples
solar.time <- lubridate::force_tz(as.POSIXct('2016-09-27 12:00'), 'UTC')
calc_light(solar.time, 40, -120)
#> [1] 1720.981
library(unitted)
calc_light(u(solar.time), u(40, 'degN'), u(-120, 'degE'), u(2315, 'umol m^-2 s^-1'))
#> Warning: The `solar.time.unitted` argument of `calc_light()` is deprecated as of
#> streamMetabolizer 0.12.0.
#> ℹ streamMetabolizer will someday stop using units and the unitted package.
#> ℹ The deprecated feature was likely used in the streamMetabolizer package.
#> Please report the issue at
#> <https://github.com/USGS-R/streamMetabolizer/issues>.
#> in calc_light, setting attach.units=TRUE because is.unitted(solar.time)
#> Warning: The `attach.units` argument of `calc_solar_insolation()` is deprecated as of
#> streamMetabolizer 0.12.0.
#> ℹ streamMetabolizer will someday stop using units and the unitted package.
#> ℹ The deprecated feature was likely used in the streamMetabolizer package.
#> Please report the issue at
#> <https://github.com/USGS-R/streamMetabolizer/issues>.
#> unitted numeric (umol m^-2 s^-1)
#> [1] 1712.842