glidertools.optics.sunset_sunrise

glidertools.optics.sunset_sunrise(time, lat, lon)

Calculates the local sunrise/sunset of the glider location.

The function uses the Skyfield package to calculate the sunrise and sunset times using the date, latitude and longitude. The times are returned rather than day or night indices, as it is more flexible for the quenching correction.

Parameters:
  • time (numpy.ndarray or pandas.Series) – The date & time array in a numpy.datetime64 format.

  • lat (numpy.ndarray or pandas.Series) – The latitude of the glider position.

  • lon (numpy.ndarray or pandas.Series) – The longitude of the glider position.

Returns:

  • sunrise (numpy.ndarray) – An array of the sunrise times.

  • sunset (numpy.ndarray) – An array of the sunset times.