Added TPH dependency to Edlen and BonschPotulski functions.

This commit is contained in:
yosata committed 2021-03-10 11:50:00 +01:00
1 parent 160818cdf7
commit 7771c59268
2 files changed
+97 -16

No files matched your search

+20 -1
View File
@@ -81,7 +81,26 @@ class atmosphericModel:
def slalib(self, l=None):
if not l:
l = self.lrange
return(AstroAtmosphere.slalib(l, T=self.T, p=self.P, RH=self.H)-1)
try:
from pyslalib import slalib
return(AstroAtmosphere.slalib(l, T=self.T, p=self.P, RH=self.H)-1)
except ImportError as e:
print('Could not import pyslalib.slalib. Using slower Python native function sla_refro().')
h=0
lat=-24
tlr=0.0065
eps=1e-10
zObs = np.deg2rad(45.07182)
p = self.P/100
R = []
if type(l) == float:
l = [l]
for wl in l:
R.append(AstroAtmosphere.sla_refro(zObs, h, self.T, p, self.H, wl, lat, tlr, eps))
if len(l) == 1:
return R[0]
else:
return np.asarray(R)
if __name__ == '__main__':