Calculate the solar bearing for a field observation

Description

Establish the true direction of a timed solar sight used to orient an instrument in a field survey.

Usage

sunAz(loc, time, timezone, limb, alt = FALSE)

Arguments

loc

Location, either a skyscapeR.horizon or a vector containing the latitude, longitude and elevation of location, in this order.

time

String containing the date and time in the following format: "YYYY-MM-DD HH:MM:SS"

timezone

Timezone for civil timestamps. Use UTC or a fixed offset for dates before 1900. See time2jd for named zones and offsets.

limb

Measured limb of the sun. Options are left, right. If missing the center of the sun will be output.

alt

Logical that triggers output of altitude of the sun at exact time. Default is FALSE.

Details

A solar reference requires the observer position, timestamp, timezone and the part of the disc that was sighted. Times are parsed using R's civil-time routines and converted to UT Julian dates. Swiss Ephemeris supplies the topocentric solar position and its horizontal coordinates using 1013.25 mbar and 15 degrees Celsius. The returned bearing is measured clockwise from north. Sighting the left or right limb applies a fixed minus or plus 16 arcminutes in azimuth. Optional altitude is the geometric centre altitude.

Astronomical positions require Swiss Ephemeris files covering the epoch. We recommend installing swephRdata; see skyscapeR-package for setup.

Value

Solar azimuth in degrees clockwise from north, one value per observation. With alt = TRUE, a data frame with columns az and alt is returned. The altitude is geometric and is expressed in degrees.

Provenance

Structured results carry a provenance attribute. Read it with attr(result, "provenance"); its packages entry records the loaded skyscapeR and swephR versions, with NA when a namespace version is unavailable. This attribute adds no list entries or table columns. Ordinary subsetting or transformations may discard attributes; save the original result for reference. It does not identify ephemeris files, catalogue revisions or a development commit. Retain those and the analysis script separately for exact reproduction. Only the table returned with alt = TRUE carries this attribute; the default numeric output is unchanged.

Scientific validation

F01 examines magnetic and solar reductions against independent references. F01 scientific validation.

Scientific checks

See Also

reduct.theodolite

Examples

if (requireNamespace("swephRdata", quietly = TRUE)) {
  sunAz(c(52,-3,100), '2017-10-04 12:32:14', 'Europe/London')
}