For all days between the specified start and end date, identify the time of sunrise, sunset, and solar noon (in UTC) as well as the day length. The idea for this function was contributed by Miguel C. Leon and a Python equivalent lives in the Luquillo site's LUQ-general-utils GitHub repository.
solar_day_info(
lat = NULL,
lon = NULL,
start_date = NULL,
end_date = NULL,
quiet = FALSE
)
(dataframe) table of 6 columns and a number of rows equal to the number of days between the specified start and end dates (inclusive). Columns contain: (1) date, (2) sunrise time, (3) sunset time, (4) solar noon, (5) day length, and (6) time zone of columns 2 to 4.
(numeric) latitude coordinate for which to find day length
(numeric) longitude coordinate for which to find day length
(character) starting date in 'YYYY-MM-DD' format
(character) ending date in 'YYYY-MM-DD' format
(logical) whether to suppress certain non-warning messages. Defaults to TRUE
if (FALSE) {
# Identify day information in Santa Barbara (California) for one week
solar_day_info(lat = 34.416857, lon = -119.712777,
start_date = "2022-02-07", end_date = "2022-02-12",
quiet = TRUE)
}
Run the code above in your browser using DataLab