Skip to content

Instantly share code, notes, and snippets.

View dartungar's full-sized avatar
🕊️
make great software, not war

Danila Nikolaev dartungar

🕊️
make great software, not war
View GitHub Profile
@anttilipp
anttilipp / daylength.py
Created January 6, 2017 18:39
Python function to compute the length of the day given day of the year and latitude.
import numpy as np
def daylength(dayOfYear, lat):
"""Computes the length of the day (the time between sunrise and
sunset) given the day of the year and latitude of the location.
Function uses the Brock model for the computations.
For more information see, for example,
Forsythe et al., "A model comparison for daylength as a
function of latitude and day of year", Ecological Modelling,
1995.