Beispiel #1
0
 def testdop2str(self):
     dops = ['Ideal', 'Excellent', 'Good', 'Moderate', 'Fair', 'Poor']
     i = 0
     for dop in (1, 2, 5, 10, 20, 30):
         res = dop2str(dop)
         self.assertEqual(res, dops[i])
         i += 1
Beispiel #2
0
 def testdop2str(self):
     dops = ["Ideal", "Excellent", "Good", "Moderate", "Fair", "Poor"]
     i = 0
     for dop in (1, 2, 5, 10, 20, 30):
         res = dop2str(dop)
         self.assertEqual(res, dops[i])
         i += 1
Beispiel #3
0
    def _update_dop(self, units, **kwargs):
        """
        Update precision and accuracy

        :param str units: distance units as string (UMM, UMK, UI, UIK)
        :param kwargs: optional key value pairs
        """

        if "dop" in kwargs:
            dop = kwargs["dop"]
            self._dop.set(str(dop) + " " + dop2str(dop))
        if "hdop" in kwargs and "vdop" in kwargs:
            self._hvdop.set("hdop " + str(kwargs["hdop"]) + "\nvdop " +
                            str(kwargs["vdop"]))
        if "hacc" in kwargs and "vacc" in kwargs:
            if units in (UI, UIK):
                hacc = round(m2ft(kwargs["hacc"]), 1)
                vacc = round(m2ft(kwargs["vacc"]), 1)
            else:
                hacc = round(kwargs["hacc"], 1)
                vacc = round(kwargs["vacc"], 1)
            self._hvacc.set("hacc " + str(hacc) + "\nvacc " + str(vacc))