def testTheta0OfSingleLayer(self): zenAngle = 23.5 airmass = Cn2Profile.zenith_angle_to_airmass(zenAngle) r0 = 0.13 h = 1000. pr = Cn2Profile.from_fractional_j(r0, 1.0, 30, h, 10, 0.3) pr.set_zenith_angle(zenAngle) pr.set_wavelength(1.0e-6) wanted = (2.914 / 0.422727)**(-3. / 5) * pr.r0().value / ( h * airmass) * Constants.RAD2ARCSEC self.assertAlmostEqual(wanted, pr.theta0().value)
def testAirmass(self): self.assertAlmostEqual(1, Cn2Profile.zenith_angle_to_airmass(0)) self.assertAlmostEqual(2, Cn2Profile.zenith_angle_to_airmass(60)) self.assertAlmostEqual(np.sqrt(2), Cn2Profile.zenith_angle_to_airmass(45))