Learn R Programming

astronomyengine (version 0.1.0)

astro_horizon: Horizontal coordinates of a celestial body

Description

Calculates the apparent location of a body relative to the local horizon of an observer on Earth.

Usage

astro_horizon(
  time,
  latitude,
  longitude,
  ra,
  dec,
  refraction = "REFRACTION_NORMAL"
)

Value

A list with elements:

azimuth

Azimuth angle in degrees (eastward from north).

altitude

Altitude angle in degrees (positive above horizon).

ra

Right ascension of the body in sidereal hours.

dec

Declination of the body in degrees.

Arguments

time

A POSIXct time value.

latitude

Observer's geographic latitude in degrees (positive north).

longitude

Observer's geographic longitude in degrees (positive east).

ra

Right ascension of the body in sidereal hours.

dec

Declination of the body in degrees.

refraction

One of "REFRACTION_NORMAL", "REFRACTION_JPLHOR", or "REFRACTION_NONE".

Details

Given a date, time, geographic location, and equatorial coordinates of a celestial body, this function returns horizontal coordinates (azimuth and altitude) relative to the horizon.

The ra and dec must be equator-of-date coordinates. Equator-of-date coordinates can be obtained by calling astro_equator() with equdate = "EQUATOR_OF_DATE" and aberration = "ABERRATION".

Atmospheric refraction correction is recommended. Pass refraction = "REFRACTION_NORMAL" to correct for optical lensing of the Earth's atmosphere that causes objects to appear higher above the horizon than they actually are.

Examples

Run this code
time <- as.POSIXct("2025-02-19 22:10:12", tz = "UTC")
astro_horizon(time, latitude = -33.87, longitude = 151.21, ra = 10.5, dec = -20.0)

Run the code above in your browser using DataLab