def test_vmf(self): ori = vmf(pos=self.boehm_pos_rad, time=self.boehm_time, coeffs=self.cfs, elev=deg2rad(5)) assert_allclose(ori, self.boehm_coeffs, rtol=1e-5, err_msg="Wrong tropodelays")
def tropmodel(pos, el, time="", coeffs=(), humi=0.75, temp0=15.0): if len(coeffs) > 1: return vmf(pos, time, el, coeffs) else: return saast(pos, el, humi, temp0)
return 2.99792458e8 * f * 5e-9 def time2gpst(t): """ convert GTime to time of week in gps time :param t: GTime instance :return: time of week in gps time (s) """ t0 = GTime(1980, 1, 6, 0, 0, 0) # GPS time reference sec = t - t0 # number of seconds since t0, type: float gps_week = int(sec / (86400 * 7)) return (sec - gps_week * 86400 * 7) + (t.sec - int(t.sec)) if __name__ == "__main__": pos = [pi / 3, pi / 6, 100.0] azel = 45 * pi / 180 t = datetime(2016, 1, 1, 0, 0) from proto.helper.vmf import vmf vmf_coeffs = (0.00121328, 0.00043331) for h in range(10): saa_ = tropmodel(pos, azel, 0.1 * h) print "Relative humidity: %2d %% \t delay: %.3f meters" % (h * 10, saa_) for h in range(90, 0, -10): saa_ = tropmodel(pos, radians(h), 50) vmf_ = sum(vmf(pos, t, radians(h), vmf_coeffs)) print "Elevation angle: %2d° \t Delays [m]: Saastamoinen: %.3f, VMF1: %.3f" % (h, saa_, vmf_)
def tropmodel(pos, el, time='', coeffs=(), humi=0.75, temp0=15.0): if len(coeffs) > 1: return vmf(pos, time, el, coeffs) else: return saast(pos, el, humi, temp0)
return 2.99792458E8 * f * 5E-9 def time2gpst(t): """ convert GTime to time of week in gps time :param t: GTime instance :return: time of week in gps time (s) """ t0 = GTime(1980, 1, 6, 0, 0, 0) # GPS time reference sec = t - t0 # number of seconds since t0, type: float gps_week = int(sec / (86400 * 7)) return (sec - gps_week * 86400 * 7) + (t.sec - int(t.sec)) if __name__ == "__main__": pos = [pi / 3, pi / 6, 100.] azel = 45 * pi / 180 t = datetime(2016, 1, 1, 0, 0) from proto.helper.vmf import vmf vmf_coeffs = (0.00121328, 0.00043331) for h in range(10): saa_ = tropmodel(pos, azel, 0.1 * h) print "Relative humidity: %2d %% \t delay: %.3f meters" % (h * 10, saa_) for h in range(90, 0, -10): saa_ = tropmodel(pos, radians(h), 50) vmf_ = sum(vmf(pos, t, radians(h), vmf_coeffs)) print "Elevation angle: %2d° \t Delays [m]: Saastamoinen: %.3f, VMF1: %.3f" % (h, saa_, vmf_)