diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ca0973 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store + diff --git a/atmospheric refraction example.html b/atmospheric refraction example.html index 1e02f5b..20491b1 100644 --- a/atmospheric refraction example.html +++ b/atmospheric refraction example.html @@ -13143,7 +13143,7 @@ div#notebook { l2 = 1.78 # micron # Initializing dispersion model -at = Ciddor1996(p=P, T=T, H=H, xc=xc) +at = Observatory() # Calculating indices of refraction for l1 and l2 n1 = at.n_tph(l=l1, T=T, p=P, RH=H, xc=xc) @@ -13171,8 +13171,9 @@ div#notebook {
# Density of the atmosphere (following CIPM-81/91 equations)
rho = at.rho(p=P, T=T, RH=H, xc=xc)
-# Initializing refraction model
-ref = refraction(lat, h, P, rho)
+# Initializing refraction model and setting the reduced height
+ref = refraction(lat, h)
+ref.setReducedHeight(P, rho)
Dispersion is simply the refraction differential between two wavelengths. This is calculated with this module by
+Some error propagation is included in the module as well. It takes is able to calculate the uncertainty in the refractive index and uses that to propagate it into the refraction formule for the cassini model. Note: The Cassini model is the only refraction model for which error propagation is possible, in this module.
+In this example we assume the following uncertainties:
+# Initializing dispersion object
-disp = dispersion(lat, h, P, rho)
-dispersion_obs = disp.cassini(n1, n2, zenith=zenith_obs)*3.6e6
-print ('The dispersion is %.03f milli arc seconds' %(dispersion_obs))
+# Calculating the uncertainty in the refractive index
+n1 = at.n_tph(l=l1, T=T, p=P, RH=H, xc=xc)
+dn1 = at.dn_tph(l1, T, P, H, xc, dl=0.001, dT=0.2, dP=30, dRH=0.03, dCO2=25)
+
+# Calculating the uncertainty in the atmospheric refraction
+refError = ref.cassiniError(n1, dn1, zenith_obs, dz=1/3600)*3.6e3
+print ('The refraction is: %.3f +/- %.3f arc seconds' %(refraction_obs, refError))
Dispersion is simply the refraction differential between two wavelengths. This is calculated with a dispersion object. Again, we can also calculate the uncertainty in the dispersion based on the measurement uncertainties. We take the same values as above.
+Note that, since the unertainties in the refractive index at two wavelengths observated at the same time are correlated, we cannot simply use n1, n2, dn1 and dn2 as an input but require the whole set of conditions and uncertainties.
+ +# Initializing dispersion object
+disp = dispersion(lat, h)
+disp.setReducedHeight(P, rho)
+
+dispersion_obs = disp.cassini(n1, n2, zenith_obs)*3.6e6
+
+# Calculating the uncertainty in the atmospheric dispersion
+dispersion_unc = disp.cassiniError(zenith_obs, l1, l2, T, P, H, xc,
+ dl1=0.001, dl2=0.001, dT=0.2, dP=30, dRH=0.03, dCO2=25, dz=1/3600) * 3.6e6
+
+print ('The dispersion is %.03f +/- %.03f milli arc seconds' %(dispersion_obs, dispersion_unc))
+