-
Notifications
You must be signed in to change notification settings - Fork 0
/
ozone.py
29 lines (20 loc) · 1.21 KB
/
ozone.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
import numpy as np
from constants import units
# taken from https://brian-rose.github.io/ClimateLaboratoryBook/courseware/grey-radiation-climlab.html
o_pressure = np.asarray([ 3.544638, 7.388814, 13.967214, 23.944625, 37.23029 , 53.114605,
70.05915 , 85.439115, 100.514695, 118.250335, 139.115395, 163.66207 ,
192.539935, 226.513265, 266.481155, 313.501265, 368.81798 , 433.895225,
510.455255, 600.5242 , 696.79629 , 787.70206 , 867.16076 , 929.648875,
970.55483 , 992.5561 ]) * units.hPa
o_value = np.asarray([7.82792878e-06, 8.64150529e-06, 7.58940028e-06, 5.24567145e-06,
3.17761574e-06, 1.82320006e-06, 9.80756960e-07, 6.22870516e-07,
4.47620550e-07, 3.34481169e-07, 2.62570302e-07, 2.07898125e-07,
1.57074555e-07, 1.12425545e-07, 8.06004999e-08, 6.27826498e-08,
5.42990561e-08, 4.99506089e-08, 4.60075681e-08, 4.22977789e-08,
3.80559071e-08, 3.38768568e-08, 3.12171619e-08, 2.97807119e-08,
2.87980968e-08, 2.75429934e-08]) * units.kg * units.kg ** -1
def ozone_at(p):
return np.interp(p, o_pressure, o_value)
if __name__ == "__main__":
for i in range(1000):
print(ozone_at(i))