from pylab import * from numpy import * def daylighthours(latitude,J): ds=0.4093*sin(2*pi/365*J-1.405) # to be replaced by class sha=arccos(-tan(latitude)*tan(ds)) # to be replaced by class dh=24/pi*sha return dh latitude=23 J=arange(1,365,1) plot(J,daylighthours(latitude,J)) ytext = ylabel('daylight hours') xtext = xlabel('Julian day') show()