mirror of
https://gitlab.astro-wise.org/micado/atmosphericmodel.git
synced 2026-10-29 20:51:05 +00:00
Refactored some variable names and updated descriptions
This commit is contained in:
1 parent
e9e4b4ccd6
commit
502183889b
4 files changed
+107
-93
No files matched your search
@@ -39,39 +39,45 @@ class dispersion(Observatory):
|
||||
|
||||
Methods
|
||||
-------
|
||||
setReducedHeight(p, rho)
|
||||
Sets the reduced atmospheric height.
|
||||
planeParallel(n1, n2, zenith)
|
||||
Returns the atmospheric dispersion assuming a plane parallel
|
||||
atmosphere
|
||||
cassini(n1, n2, zenith, reduced_height=None)
|
||||
Returns the atmospheric dispersion asusming Cassini's homegeneous
|
||||
atmosphere model
|
||||
tan5(n1, n2, zenith, reduced_height=None)
|
||||
Returns the atmospheric dispersion following Oriani's theorem,
|
||||
including a fifth order term in the expansion.
|
||||
oriani(n1, n2, zenith, reduced_height=None)
|
||||
Returns the atmospheric dispersion following the classic version
|
||||
of Oriani's theorem.
|
||||
corbard(n1, n2, zenith, reduced_height=None)
|
||||
Returns the atmospheric dispersion following the method described
|
||||
in Corbard et al., 2019.
|
||||
refractionIntegral(n1, n2, z0, R0=None, useStandardAtmosphere=True, heightData=None, rhoData=None)
|
||||
Returns the atmospheric dispersion following the refraction integral.
|
||||
psi(x)
|
||||
Submethod for corbard()
|
||||
set_rc()
|
||||
Sets the local radius of curvature of the Earth at the observer.
|
||||
set_H(p, rho)
|
||||
Sets the reduced height for the conditions at the observer, assuming
|
||||
an adiabatic atmosphere.
|
||||
H_isotherm(T)
|
||||
Sets the reduced height for the conditions at the observer, assuming
|
||||
an isothermal atmosphere.
|
||||
Returns the atmospheric dispersion assuming Cassini's homegeneous
|
||||
atmosphere model.
|
||||
cassiniError(z, l1, l2, T, p, RH, xc, dl1=0, dl2=0, dT=0.2, dP=20,
|
||||
dRH=0.02, dCO2=20, dz=0, lat=None, h=None)
|
||||
Returns the uncertainty in the atmospheric dispersion, assuming
|
||||
Cassini's homegeneous atmosphere model and the given parameters.
|
||||
Cassini's homegeneous atmosphere model and the given parameters.
|
||||
corbard(n1, n2, zenith, reduced_height=None)
|
||||
Returns the atmospheric dispersion following the method described
|
||||
in Corbard et al., 2019.
|
||||
gammaCoefficients(n1, reduced_height=None)
|
||||
Helper function for matharExponential(), that calculates the gamma
|
||||
coefficients.
|
||||
H_isotherm(T)
|
||||
Sets the reduced height for the conditions at the observer, assuming
|
||||
an isothermal atmosphere.
|
||||
matharExponential(n1, n2, zenith, reduced_height=None)
|
||||
Returns the atmospheric dispersion assuming Mathar's barometric
|
||||
exponential model.
|
||||
oriani(n1, n2, zenith, reduced_height=None)
|
||||
Returns the atmospheric dispersion following the classic version
|
||||
of Oriani's theorem.
|
||||
planeParallel(n1, n2, zenith)
|
||||
Returns the atmospheric dispersion assuming a plane parallel
|
||||
atmosphere.
|
||||
psi(x)
|
||||
Submethod for corbard().
|
||||
refractionIntegral(n1, n2, zenith, R0=None, useStandardAtmosphere=True, heightData=None, rhoData=None)
|
||||
Returns the atmospheric dispersion following the refraction integral.
|
||||
setReducedHeight(p, rho)
|
||||
Sets the reduced atmospheric height.
|
||||
set_H(p, rho)
|
||||
Sets the reduced height for the conditions at the observer, assuming
|
||||
an adiabatic atmosphere.
|
||||
set_rc()
|
||||
Sets the local radius of curvature of the Earth at the observer.
|
||||
tan5(n1, n2, zenith, reduced_height=None)
|
||||
Returns the atmospheric dispersion following Oriani's theorem,
|
||||
including a fifth order term in the expansion.
|
||||
Other Observatory() methods
|
||||
'''
|
||||
def __init__(self, lat, h):
|
||||
@@ -113,7 +119,7 @@ class dispersion(Observatory):
|
||||
return np.degrees(_R1) - np.degrees(_R2)
|
||||
|
||||
|
||||
def cassiniError(self, z, l1, l2, T, p, RH, xc, dl1=0, dl2=0, dT=0.2, dP=20,
|
||||
def cassiniError(self, zenith, l1, l2, T, p, RH, xc, dl1=0, dl2=0, dT=0.2, dP=20,
|
||||
dRH=0.02, dCO2=20, dz=0, lat=None, h=None):
|
||||
'''
|
||||
Calculates the uncertainty in the atmospheric dispersion,
|
||||
@@ -128,7 +134,7 @@ class dispersion(Observatory):
|
||||
|
||||
Parameters
|
||||
----------
|
||||
z : float
|
||||
zenith : float
|
||||
Angle of observation in degrees.
|
||||
zenith = 0 means the observation is directly overhead.
|
||||
l1 : float
|
||||
@@ -222,7 +228,7 @@ class dispersion(Observatory):
|
||||
_rho_obs = self.rho(p, T, RH, xc)
|
||||
self.rc = self.set_rc() * 1000
|
||||
self.H = self.set_H(p, _rho_obs)
|
||||
_alpha = self.rc * np.sin(np.deg2rad(z)) / (self.rc + self.H)
|
||||
_alpha = self.rc * np.sin(np.deg2rad(zenith)) / (self.rc + self.H)
|
||||
_p_a = p - RH*self.svp(T)
|
||||
_p_w = RH*self.svp(T)
|
||||
_x_w_a = self.xw(_p_a, T, _RH_a)
|
||||
@@ -369,7 +375,7 @@ class dispersion(Observatory):
|
||||
|
||||
|
||||
# Partial derivatives for derivation to z
|
||||
_zenith = np.deg2rad(z)
|
||||
_zenith = np.deg2rad(zenith)
|
||||
_dz = np.deg2rad(dz)
|
||||
_R = self.rc
|
||||
_H = self.H
|
||||
@@ -420,14 +426,14 @@ class dispersion(Observatory):
|
||||
return _rList[0] - _rList[1]
|
||||
|
||||
|
||||
def gammaCoefficients(self, n0, reduced_height=None):
|
||||
def gammaCoefficients(self, n1, reduced_height=None):
|
||||
'''
|
||||
Submethod for matharExponential(). Calculates the gamma
|
||||
coefficients.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
n0 : float
|
||||
n1 : float
|
||||
Refractive index at the wavelength of interest at the observer
|
||||
reduced_height : float (optional)
|
||||
Reduced height of the atmosphere. Default value is calculated
|
||||
@@ -444,7 +450,7 @@ class dispersion(Observatory):
|
||||
else:
|
||||
H = self.H
|
||||
|
||||
_chi0 = n0**2 - 1
|
||||
_chi0 = n1**2 - 1
|
||||
_Khat = H / self.rc
|
||||
|
||||
_g1 = (1 - 5/24 * _Khat * _chi0**2 - 3/4 * _chi0 - 3/8 * _Khat**2 * _chi0 \
|
||||
@@ -483,7 +489,7 @@ class dispersion(Observatory):
|
||||
* _chi0**2 - 180 * _Khat**3 * _chi0 - 9/5 * _Khat * _chi0**4) * 35/128
|
||||
|
||||
g = np.array([_g1, _g3, _g5, _g7, _g9])
|
||||
g*= n0*_chi0/2
|
||||
g*= n1*_chi0/2
|
||||
|
||||
return g
|
||||
|
||||
@@ -659,7 +665,7 @@ class dispersion(Observatory):
|
||||
return np.exp(x**2) * _int[0]
|
||||
|
||||
|
||||
def refractionIntegral(self, n1, n2, z0, R0=None, useStandardAtmosphere=True,
|
||||
def refractionIntegral(self, n1, n2, zenith, R0=None, useStandardAtmosphere=True,
|
||||
heightData=None, rhoData=None):
|
||||
'''
|
||||
Using data that gives temperature, pressure and density as a
|
||||
@@ -678,7 +684,7 @@ class dispersion(Observatory):
|
||||
Refractive index at the shortest wavelength of interest
|
||||
n2 : float
|
||||
Refractive index at the longest wavelength of interest
|
||||
z0 : float
|
||||
zenith : float
|
||||
Angle of observation in degrees.
|
||||
zenith = 0 means the observation is directly overhead.
|
||||
R0 : float (optional)
|
||||
@@ -711,7 +717,7 @@ class dispersion(Observatory):
|
||||
|
||||
|
||||
_rList = []
|
||||
z0 = np.deg2rad(z0)
|
||||
zenith = np.deg2rad(zenith)
|
||||
|
||||
# Integration of the refraction integral over the atmosphere layers.
|
||||
for _n in [n1, n2]:
|
||||
@@ -723,7 +729,7 @@ class dispersion(Observatory):
|
||||
_n_h = 1 + (_n - 1) / _Dens[0] * _Dens
|
||||
|
||||
# Calculation of the zenith angle for given height and refractive index, from the refractive invariant
|
||||
_z = np.arcsin( (_n * R0) / (_n_h * _R) * np.sin(z0) )
|
||||
_z = np.arcsin( (_n * R0) / (_n_h * _R) * np.sin(zenith) )
|
||||
|
||||
# Calculation of log space derivative of n and r
|
||||
_lnn = np.log(_n_h)
|
||||
|
||||
Reference in new issue
Block a user