-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
42 lines (27 loc) · 857 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import math as m
import numpy as np
import matplotlib.pyplot as plt
import insol_fcts
import parameters_fcts
def plot_lat_insol(S0,month,e,obliq,prec):
"""
orbital parameters in degrees
OUT:
(matplotlib figure, insol)................................. tuple
matplotlib figure...................................... matplotlib figure
insol: insolation array................................ 1-D array
"""
lat = np.linspace(-90,90,181)
insol = np.empty(len(lat)) * np.nan
for i in range(len(lat)):
insol[i] = insol_fcts.wmcal(S0,month,e,m.radians(obliq),m.radians(prec),m.radians(lat[i]))
plt.figure(1)
plt.xlim(-90, 90)
plt.ylim(0, 600)
plt.xlabel('Latitude (deg)')
plt.ylabel('Insolation (W m-2)')
plt.title('Average Monthly Insolation')
plt.grid(True)
plot = plt.plot(lat,insol)
plt.show()
return plot,insol