Go to the latest version of this document.

# ``twisted`.`positioning`.`base`.`PositionError``

class documentation

`class PositionError(FancyEqMixin): (source)`

Constructor: `PositionError(pdop, hdop, vdop, testInvariant)`

View In Hierarchy

Position error information.

Method | `__init__` | Initializes a positioning error object.
Method | `__repr__` | Returns a string representation of positioning information object.
Method | `hdop.setter` | Undocumented
Method | `pdop.setter` | Undocumented
Method | `vdop.setter` | Undocumented
Class Variable | `compareAttributes` | Undocumented
Property | `hdop` | Undocumented
Property | `pdop` | Undocumented
Property | `vdop` | Undocumented
Method | `_getDOP` | Gets a particular dilution of position value.
Method | `_setDOP` | Sets a particular dilution of position value.
Method | `_testDilutionOfPositionInvariant` | Tests if this positioning error object satisfies the dilution of position invariant (PDOP = (HDOP**2 + VDOP**2)*.5), unless the `self._testInvariant` instance variable is `False`.
Constant | `_ALLOWABLE_TRESHOLD` | Undocumented
Constant | `_DOP_EXPRESSIONS` | A mapping of DOP types (C[hvp]dop) to a list of callables that take self and return that DOP type, or raise `TypeError`. This allows a DOP value to either be returned directly if it's know, or computed from other DOP types if it isn't.
Constant | `_REPR_TEMPLATE` | Undocumented
Class Variable | `_ALLOWABLE_THRESHOLD` | The maximum allowable difference between PDOP and the geometric mean of VDOP and HDOP. That difference is supposed to be zero, but can be non-zero because of rounding error and limited reporting precision...
Instance Variable | `_hdop` | Undocumented
Instance Variable | `_pdop` | Undocumented
Instance Variable | `_testInvariant` | Undocumented
Instance Variable | `_vdop` | Undocumented

Inherited from `FancyEqMixin`:

Method | `__eq__` | Undocumented
Method | `__ne__` | Undocumented

def __init__(self, pdop=None, hdop=None, vdop=None, testInvariant=False): (source)

Initializes a positioning error object.

Parameters
pdop:`float` or `None` | The position dilution of precision. `None` if unknown.
hdop:`float` or `None` | The horizontal dilution of precision. `None` if unknown.
vdop:`float` or `None` | The vertical dilution of precision. `None` if unknown.
testInvariant:c{bool} | Flag to test if the DOP invariant is valid or not. If `True`, the invariant (PDOP = (HDOP**2 + VDOP**2)*.5) is checked at every mutation. By default, this is false, because the vast majority of DOP-providing devices ignore this invariant.

def __repr__(self) -> `str`: (source)

Returns a string representation of positioning information object.

Returns
`str` | The string representation.

@hdop.setter
def hdop(self, value): (source)

Undocumented

@pdop.setter
def pdop(self, value): (source)

Undocumented

@vdop.setter
def vdop(self, value): (source)

Undocumented

compareAttributes: `tuple[str, ...]` = (source)
overrides `twisted.python.util.FancyEqMixin.compareAttributes`

Undocumented

@property
hdop = (source)

Undocumented

@property
pdop = (source)

Undocumented

@property
vdop = (source)

Undocumented

def _getDOP(self, dopType): (source)

Gets a particular dilution of position value.

Parameters
dopType:`str` | The type of dilution of position to get. One of ('pdop', 'hdop', 'vdop').

Returns
`float` or `None` | The DOP if it is known, `None` otherwise.

def _setDOP(self, dopType, value): (source)

Sets a particular dilution of position value.

Parameters
dopType:`str` | The type of dilution of position to set. One of ('pdop', 'hdop', 'vdop').
value: `float` If this position error tests dilution of precision invariants, it will be checked. If the invariant is not satisfied, the assignment will be undone and `ValueError` is raised. | The value to set the dilution of position type to.

def _testDilutionOfPositionInvariant(self): (source)

Tests if this positioning error object satisfies the dilution of position invariant (PDOP = (HDOP**2 + VDOP**2)*.5), unless the `self._testInvariant` instance variable is `False`.

Returns
`None` if the invariant was not satisfied or not tested.

Raises
`ValueError` | Raised if the invariant was tested but not satisfied.

_ALLOWABLE_TRESHOLD: `float` = (source)

Undocumented

Value

    0.01

_DOP_EXPRESSIONS: `dict` of `str` to callables = (source)

A mapping of DOP types (C[hvp]dop) to a list of callables that take self and return that DOP type, or raise `TypeError`. This allows a DOP value to either be returned directly if it's know, or computed from other DOP types if it isn't.

Value

    {'pdop': [(lambda self: float(self._pdop)),
              (lambda self: (self._hdop ** 2 + self._vdop ** 2) ** 0.5)],
     'hdop': [(lambda self: float(self._hdop)),
              (lambda self: (self._pdop ** 2 - self._vdop ** 2) ** 0.5)],
     'vdop': [(lambda self: float(self._vdop)),
              (lambda self: (self._pdop ** 2 - self._hdop ** 2) ** 0.5)]}

_REPR_TEMPLATE: `str` = (source)

Undocumented

Value

    '<PositionError (pdop: %s, hdop: %s, vdop: %s)>'

_ALLOWABLE_THRESHOLD: `float` = (source)

The maximum allowable difference between PDOP and the geometric mean of VDOP and HDOP. That difference is supposed to be zero, but can be non-zero because of rounding error and limited reporting precision. You should never have to change this value.

_hdop = (source)

Undocumented

_pdop = (source)

Undocumented

_testInvariant = (source)

Undocumented

_vdop = (source)

Undocumented