solposx.solarposition.nasa_horizons

Contents

solposx.solarposition.nasa_horizons#

solposx.solarposition.nasa_horizons(latitude, longitude, start, end, elevation=0.0, *, time_step='1h', refraction_correction=False, url='https://ssd.jpl.nasa.gov/api/horizons.api')#

Retrieve solar positions from NASA’s Horizons web service.

The NASA Horizons [1] is an online solar system data and ephemeris computation service, which among other things can provide highly accurate calculations of sun positions.

The NASA Horizons API is described in [2].

Specification of time period

The nasa_horizons function pattern differs from the other solar position algorithms in that it can only determine solar position for uniformly spaced timestamps. For this reason, the function requires specifying start time, end time, and frequency.

Parameters:
  • latitude (float) – Latitude in decimal degrees. Positive north of equator, negative to south. [degrees]

  • longitude (float) – Longitude in decimal degrees. Positive east of prime meridian, negative to west. [degrees]

  • start (datetime-like) – Start of the requested time period.

  • end (datetime-like) – End of the requested time period.

  • elevation (float, optional) – Elevation of the point of interest [m]. The default is 0 m.

  • time_step (str, optional) – Time step size of the requested time series. ‘1m’ for minutes, ‘1h’ for hours, ‘1d’ for days, ‘1mo’ for months, and ‘1y’ for years. The default is ‘1h’.

  • refraction_correction (bool, optional) – Whether to return apparent solar position angles corrected for atmospheric refraction. The defalt is False.

  • url (str, optional) – API endpoint. The default is 'https://ssd.jpl.nasa.gov/api/horizons.api'.

Returns:

DataFrame with the following columns in degrees (note that all columns except azimuth are prefixed with ‘apparent_’ if refraction_correction=True.)

  • right_ascension

  • declination

  • azimuth

  • elevation

Return type:

pandas.DataFrame

Notes

The refraction correction algorithm is the same as solposx.refraction.spa(). See [3] for more information.

References