Add error propagation to the models

This commit is contained in:
Joost van den Born committed 2019-05-03 12:35:14 +02:00
1 parent 10bf0fa17d
commit a81c17a4b4
5 files changed
+646 -60

No files matched your search

+16 -5
View File
@@ -23,6 +23,11 @@ import pandas as pd
if __name__ == '__main__':
plt.rc('font', family='serif')
# plt.rc('xtick', labelsize='x-small')
# plt.rc('ytick', labelsize='x-small')
plt.rc('axes', labelsize='large')
# Conditions at Cerro Armazones
# T = 279.65 # k
# P = 71200 # Pa
@@ -39,7 +44,7 @@ if __name__ == '__main__':
zenith = 30 # degrees
# Calculate the index of refraction
at = Ciddor1996(p=P, T=T, H=H, xc=xc)
at = Observatory()
n1 = at.n_tph(l=l1, T=T, p=P, RH=H, xc=xc)
n2 = at.n_tph(l=l2, T=T, p=P, RH=H, xc=xc)
rho = at.rho(p=P, T=T, RH=H, xc=xc)
@@ -49,7 +54,8 @@ if __name__ == '__main__':
tableCompare = True
if dispersionAnalysis:
# Initiate the refraction class
ref = dispersion(lat, h, P, rho)
ref = dispersion(lat, h)
ref.setReducedHeight(P, rho)
# Compare the refraction models to check if the output is okay
print ('Plane - parallel atmosphere dispersion: %s mas' %(ref.planeParallel(n1, n2, zenith) * 3.6e6))
@@ -92,7 +98,7 @@ if __name__ == '__main__':
# Plotting it all, with vertical lines where the variation between the models exceed 1, 0.1, 0.01 and 0.001 mas.
fig = plt.figure(figsize=(11,6))
fig = plt.figure(figsize=(9,5))
ax = fig.add_subplot(111)
ax.set_xlim([30,85])
ax.set_xlabel('Zenith (degrees)')
@@ -119,6 +125,8 @@ if __name__ == '__main__':
ax.plot(zenithRange, orianiList_isotherm, 'y--', label='$Atan(z) - Btan^3(z)$ (isotherm)')
ax.plot(zenithRange, corbardList_isotherm, 'r--', label='Error function (isotherm)')
ax.tick_params(axis ='both', direction='in')
ax.legend()
plt.tight_layout()
plt.show()
@@ -128,6 +136,7 @@ if __name__ == '__main__':
# Initiate the refraction class
ref = refraction(lat, h, P, rho)
# Compare the refraction models to check if the output is okay
print ('Plane - parallel atmosphere refraction: %s arcsec' %(ref.planeParallel(n1, zenith) * 3.6e3))
print ('Cassini refraction: %s arcsec' %(ref.cassini(n1, zenith) * 3.6e3))
@@ -154,7 +163,7 @@ if __name__ == '__main__':
corbardList_isotherm = [ref.corbard(n1, z, reduced_height=ref.H_isotherm(T)) * 3.6e3 for z in zenithRange]
# Plotting it all, with vertical lines where the variation between the models exceed 1, 0.1, 0.01 and 0.001 arcsec.
fig = plt.figure(figsize=(11,6))
fig = plt.figure(figsize=(9,5))
ax = fig.add_subplot(111)
ax.set_xlim([80,88])
ax.set_xlabel('Zenith (degrees)')
@@ -173,6 +182,7 @@ if __name__ == '__main__':
ax.plot(zenithRange, orianiList_isotherm, 'y--', label='$Atan(z) - Btan^3(z)$ (isotherm)')
ax.plot(zenithRange, corbardList_isotherm, 'r--', label='Error function (isotherm)')
ax.tick_params(axis ='both', direction='in')
ax.legend()
plt.tight_layout()
plt.show()
@@ -182,7 +192,8 @@ if __name__ == '__main__':
refTableData = []
dispTableData = []
ref = refraction(lat, h, P, rho)
disp = dispersion(lat, h, P, rho)
disp = dispersion(lat, h)
disp.setReducedHeight(P, rho)
zenithRange = [10, 30, 50, 60, 70, 80, 85]
headerList = np.array(['z', 'Plane-parallel', 'Cassini', 'tan3', 'tan5', 'Error function', 'Full integration'])
refTableData.append(headerList)