ported slalib.sla_refro, some refactoring

This commit is contained in:
yosata committed 2020-08-05 11:37:49 +02:00
1 parent 83d0c9ea45
commit c1f94e4d95
9 files changed
+1241 -234

No files matched your search

+16 -4
View File
@@ -13,7 +13,8 @@ import AstroAtmosphere
@ Description: A comparison of various atmospheric refraction models.
Also these are used to calculate the difference in
atmospheric dispersion, given a set of conditions.
This is a reproduction of Figure 1 of Spàno (2014).
This is a reproduction of and expansion on Figure 1 of
Spàno (2014).
'''
@@ -54,7 +55,7 @@ class atmosphericModel:
def Owens(self, l=None):
if not l:
l = self.lrange
return (AstroAtmosphere.Owens(l, T=self.T, p=self.P, H=self.H)-1)
return (AstroAtmosphere.Owens(l, T=self.T, p=self.P, RH=self.H)-1)
def BonschPotulski(self, l=None):
@@ -72,10 +73,15 @@ class atmosphericModel:
l = self.lrange
return (AstroAtmosphere.PeckReeder(l)-1)
def HohenkerkAndSinclair(self, l=None):
if not l:
l = self.lrange
return (AstroAtmosphere.HohenkerkAndSinclair(l, T=self.T, p=self.P, RH=self.H)-1)
def slalib(self, l=None):
if not l:
l = self.lrange
return(AstroAtmosphere.slalib(l, T=self.T, p=self.P, H=self.H)-1)
return(AstroAtmosphere.slalib(l, T=self.T, p=self.P, RH=self.H)-1)
if __name__ == '__main__':
@@ -92,6 +98,7 @@ if __name__ == '__main__':
BonschPotulskiData = 1e8 * at.BonschPotulski()
BirchDownsData = 1e8 * at.BirchDowns()
PeckReederData = 1e8 * at.PeckReeder()
HSdata = 1e8 * at.HohenkerkAndSinclair()
slalibData = 1e8 * at.slalib()
# Plotting the results
@@ -106,13 +113,14 @@ if __name__ == '__main__':
ax2.plot(at.lrange, BonschPotulskiData - CiddorData, 'g-.', label='Bonsch & Potulski (1998)')
ax2.plot(at.lrange, BirchDownsData - CiddorData, 'r-.', label='Birch & Downs (1993, 1994)')
ax2.plot(at.lrange, PeckReederData - CiddorData, 'b--', label='Peck & Reeder (1972)')
ax2.plot(at.lrange, HSdata - CiddorData, 'y--', label='Hohenkerk & Sinclair (1985)')
ax2.plot(at.lrange, slalibData - CiddorData, 'y-', label='ZEMAX / SLALIB')
box = ax2.get_position()
ax2.set_position([box.x0, box.y0, box.width, box.height])
ax2.legend(loc='center left', bbox_to_anchor=(1, 0.5))
ax2.set_xlabel('Wavelength ($\mu m$)')
ax2.set_ylabel('$\Delta$n $\\times$ $10^{8}$')
ax2.set_ylim([-3,3])
ax2.set_ylim([-3,7])
plt.tight_layout()
plt.show()
@@ -128,6 +136,7 @@ if __name__ == '__main__':
at.BonschPotulski,
at.BirchDowns,
at.PeckReeder,
at.HohenkerkAndSinclair,
at.slalib
]
@@ -166,11 +175,14 @@ if __name__ == '__main__':
'Ciddor (1996)',
'Edlen (1953)',
'Edlen (1966)',
'Owens (1967)',
'Bonsch & Potulski (1998)',
'Birch & Downs (1993, 1994)',
'Peck & Reeder (1972)',
'Hohenkerk & Sinclair (1985)',
'slalib']
tableData = []
for i in range(len(methodStringList)):
tableData.append([methodStringList[i], filterDispersion[0][i], filterDispersion[1][i], filterDispersion[2][i], filterDispersion[3][i]])
print(tabulate(tableData, headers=['Model', 'I-band\n(0.8 - 0.934)', 'J-band\n(1.15 - 1.345)', 'H-band\n(1.49 - 1.78)', 'K-band\n(1.97 - 2.32)']))