Added Filippenko model, updated B&S refractivity

This commit is contained in:
yosata committed 2020-09-07 21:20:09 +02:00
1 parent cce60766fc
commit 8f9a0bbbea
5 files changed
+268 -91

No files matched your search

+52 -5
View File
@@ -9,7 +9,7 @@ import numpy as np
atmospheric dispersion, given a set of conditions.
'''
def BarrellAndSears(l, T=288.15, p=101325, RH=0):
def BarrellAndSears(l, T=288.15, p=101325, RH=0, f=None):
'''
From Barrell & Sears, 1939
Equation 7.7, page 52
@@ -26,15 +26,20 @@ def BarrellAndSears(l, T=288.15, p=101325, RH=0):
Atmospheric pressure in Pascal
RH : float
Relative humidity (0=<H=<1)
f : float
Water vapour pressure in Pascal
Returns
-------
n : float
Refractive index of atmospheric air at the given conditions
'''
if f is None:
f = RH * svp(T)
f_mmHg = hPA2mmHg(f/100)
T = K2C(T)
P = hPA2mmHg(p/100)
R = (0.378125 + 0.0021414 / l**2 + 0.00001793 / l**4) * (P*(1 + (1.049 - 0.0157*T) * P * 1e-6)/(1 + 0.003661*T)) - (0.0624 - 0.000680 / l**2) * RH / (1 + 0.003661*T)
R = (0.378125 + 0.0021414 / l**2 + 0.00001793 / l**4) * (P*(1 + (1.049 - 0.0157*T) * P * 1e-6)/(1 + 0.003661*T)) - (0.0624 - 0.000680 / l**2) * f_mmHg / (1 + 0.003661*T)
n = R/1e6 + 1
return n
@@ -64,17 +69,25 @@ def Ciddor(l, CO2=450):
return n
def Edlen1953(l):
def Edlen1953(l, T=288.15, p=101325, RH=0, f=None):
'''
From Edlen, 1953
Equation 2
At standard conditions only
At standard conditions only.
Following Filippenko (1982), eqs. 2 & 3 we also include
the modification proposed by Barrell in 1951.
Parameters
----------
l : float
Wavelength in microns
T : float
Temperature in Kelvin
p : float
Atmospheric pressure in Pascal
f : float
Water vapor pressure in Pascal
Returns
-------
@@ -83,7 +96,20 @@ def Edlen1953(l):
'''
s = 1 / l
R = 6432.8 + 2949810 / (146 - s**2) + 25540/(41-s**2)
n = R/1e8 + 1
n_standard = R/1e8 + 1
pHg = hPA2mmHg(p/100)
Tc = K2C(T)
if f is None:
f = RH * svp(T)
f_mmHg = hPA2mmHg(f/100)
# Changes in temperature and pressure, from Barrell (1951)
n_tp = R/1e8 * (pHg * (1 + (1.049 - 0.0157*Tc) * 1e-6 * pHg ) ) / ( 720.883 * (1 + 0.003661 * Tc)) + 1
# Correction for water vapour pressure
n_svp = (n_tp - 1) * 1e6 - ( 0.0624 - 0.000680 * s**2 ) / (1 + 0.003661 * Tc) * f_mmHg
n = n_svp/1e6 + 1
return n
@@ -481,6 +507,7 @@ def Mathar(l, T=288.15, p=101325, RH=0):
return n
# Other necessary conversion or calculations
def K2C(K):
'''
Kelvin to Celsius conversion
@@ -514,3 +541,23 @@ def hPA2mmHg(hPa):
'''
return 0.7500616827 * hPa
def svp(T):
'''
Saturation vapour pressure in Pa.
Parameters
----------
T : float
Atmospheric temperature in Kelvin
Returns
-------
svp : float
Saturation vapour pressure in Pa
'''
_A = 1.2378847e-5 # K^-2
_B = -1.9121316e-2 # K^-2
_C = 33.93711047
_D = -6.3431645e3 # K^-2
return np.exp(_A*T**2 + _B*T + _C + _D/T)