Interpolate horizon altitude at a bearing

Description

Estimate the altitude of the local horizon, and optionally its uncertainty, at one or more true bearings.

Usage

hor2alt(hor, az, return.unc = F)

Arguments

hor

A skyscapeR.horizon object from which to retrieve horizon altitude.

az

Array of azimuth(s) for which to retrieve horizon altitude(s).

return.unc

Logical controlling whether to return altitude uncertainty. Default is FALSE.

Details

A measured axis rarely falls exactly on a stored horizon sample. Separate cubic splines interpolate altitude and its recorded uncertainty as functions of azimuth, and results are rounded to two decimal places. Supply bearings within the profile coverage; a spline beyond the measured range is an extrapolation. Distinguish this lookup from the linear interpolation used inside coordtrans.

Value

With return.unc = FALSE, a numeric vector of altitudes. With return.unc = TRUE and one azimuth, an unnamed numeric vector containing altitude followed by uncertainty. With multiple azimuths, a numeric matrix with columns alt and alt.unc, one row per input azimuth in the supplied order. Values are rounded to two decimal places.

Validation

In H07, lookup at each edge of a north-crossing panorama returned its measured altitude and lookup beyond either edge returned NA. See the H07 check in the technical manual.

Scientific checks

See Also

createHor, downloadHWT

Examples

hor <- createHor(c(0,90,180,270,360), c(0,5,3,1,0),
                 alt.unc=c(0.1,0.2,0.3,0.2,0.1), loc=c(40,-8,100))
hor2alt(hor, 90)
hor2alt(hor, 90, return.unc=TRUE)
hor2alt(hor, c(90,180,270), return.unc=TRUE)