Refactored some variable names and updated descriptions

This commit is contained in:
yosata committed 2020-08-03 11:07:42 +02:00
1 parent e9e4b4ccd6
commit 502183889b
4 files changed
+107 -93

No files matched your search

+48 -42
View File
@@ -38,39 +38,45 @@ class refraction(Observatory):
Methods
-------
setReducedHeight(p, rho)
Sets the reduced atmospheric height.
planeParallel(n1, n2, zenith)
Returns the atmospheric refraction assuming a plane parallel
atmosphere
cassini(n1, n2, zenith, reduced_height=None)
Returns the atmospheric refraction asusming Cassini's homegeneous
atmosphere model
tan5(n1, n2, zenith, reduced_height=None)
Returns the atmospheric refraction following Oriani's theorem,
including a fifth order term in the expansion.
oriani(n1, n2, zenith, reduced_height=None)
Returns the atmospheric refraction following the classic version
of Oriani's theorem.
corbard(n1, n2, zenith, reduced_height=None)
Returns the atmospheric refraction following the method described
in Corbard et al., 2019.
refractionIntegral(n1, n2, z0, R0=None, useStandardAtmosphere=True, heightData=None, rhoData=None)
Returns the atmospheric refraction 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 refraction 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 refraction, 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 refraction 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, zenith, reduced_height=None)
Returns the atmospheric refraction assuming Mathar's barometric
exponential model.
oriani(n1, n2, zenith, reduced_height=None)
Returns the atmospheric refraction following the classic version
of Oriani's theorem.
planeParallel(n1, n2, zenith)
Returns the atmospheric refraction 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 refraction 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 refraction following Oriani's theorem,
including a fifth order term in the expansion.
Other Observatory() methods
'''
def __init__(self, lat, h):
@@ -141,13 +147,13 @@ class refraction(Observatory):
else:
_H = self.H
_zenith = np.deg2rad(zenith)
_dz = np.deg2rad(dz)
_R = self.rc
_dRdn = (_R * np.sin(_zenith)) / ((_R + _H) * np.sqrt(1 - ((n**2 * _R**2 * np.sin(_zenith)**2)/(_R + _H)**2)))
_dz = np.deg2rad(dz)
_R = self.rc
_dRdn = (_R * np.sin(_zenith)) / ((_R + _H) * np.sqrt(1 - ((n**2 * _R**2 * np.sin(_zenith)**2)/(_R + _H)**2)))
_dRdz = (_R * np.cos(_zenith)) / (_R + _H) * ( n / np.sqrt(1-(n**2 * _R**2 * np.sin(_zenith)**2)/(_R + _H)**2) - 1 / np.sqrt(1-(_R**2 * np.sin(_zenith)**2)/(_R + _H)**2) )
_dRdz = (_R * np.cos(_zenith)) / (_R + _H) * ( n / np.sqrt(1-(n**2 * _R**2 * np.sin(_zenith)**2)/(_R + _H)**2) - 1 / np.sqrt(1-(_R**2 * np.sin(_zenith)**2)/(_R + _H)**2) )
_dR = np.sqrt( (_dRdn * dn)**2 + (_dRdz * _dz)**2)
_dR = np.sqrt( (_dRdn * dn)**2 + (_dRdz * _dz)**2)
return np.degrees(_dR)
@@ -185,14 +191,14 @@ class refraction(Observatory):
return np.degrees(_R)
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
@@ -210,7 +216,7 @@ class refraction(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 \
@@ -249,7 +255,7 @@ class refraction(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
@@ -408,7 +414,7 @@ class refraction(Observatory):
return np.exp(x**2) * _int[0]
def refractionIntegral(self, n1, z0, R0=None, useStandardAtmosphere=True,
def refractionIntegral(self, n1, zenith, R0=None, useStandardAtmosphere=True,
heightData=None, rhoData=None):
'''
Using data that gives temperature, pressure and density as a
@@ -425,7 +431,7 @@ class refraction(Observatory):
----------
n1 : float
Refractive index at the wavelength of interest
z0 : float
zenith : float
Angle of observation in degrees.
zenith = 0 means the observation is directly overhead.
R0 : float (optional)
@@ -457,7 +463,7 @@ class refraction(Observatory):
_Dens = rhoData
_h = heightData
z0 = np.deg2rad(z0)
zenith = np.deg2rad(zenith)
_Dens = np.asarray(_Dens)
_h = np.asarray(_h)
_R = R0 + _h * 1000
@@ -466,7 +472,7 @@ class refraction(Observatory):
_n_h = 1 + (n0 - 1) / _Dens[0] * _Dens
# Calculation of the zenith angle for given height and refractive index, from the refractive invariant
_z = np.arcsin( (n0 * R0) / (_n_h * _R) * np.sin(z0) )
_z = np.arcsin( (n0 * R0) / (_n_h * _R) * np.sin(zenith) )
# Calculation of log space derivative of n and r
_lnn = np.log(_n_h)