def __init__(self, a_ellipsoid, f, name): '''(INTERNAL) New C{Ecef...}. ''' try: E = a_ellipsoid if f is None: if isinstance(E, Datum): self._datum = E E = E.ellipsoid elif not isinstance(E, Ellipsoid): raise TypeError self.name = E.name elif isscalar(E) and isscalar(f): a = float(E) f_ = (1.0 / f) if f else 0 # sphere b = None if f_ else a E = Ellipsoid(a, b, f_, name='_' + name) else: raise ValueError if not (E.a > 0 and E.f < 1): raise ValueError except (TypeError, ValueError): t = unStr(self.classname, a=E, f=f) raise EcefError('%s invalid: %s' % ('ellipsoid', t)) self._E = E if name: self.name = name
def inStr(inst, *args, **kwds): '''Return the string representation of an instance. @param inst: The instance (any C{type}). @param args: Optional positional arguments. @keyword kwds: Optional keyword arguments. @return: The B{C{inst}}'s representation (C{str}). ''' return unStr(classname(inst), *args, **kwds)
def toStr(self, **kwds): '''(INTERNAL) Must be overloaded. @param kwds: Optional, keyword arguments. ''' raise AssertionError(unStr(self.classname + '.toStr', **kwds))
def _xcopy(self, *attrs): '''(INTERNAL) Must be overloaded. ''' raise AssertionError(unStr(self.classname + '._xcopy', *attrs))
def toCartesian(self): '''Convert this (geodetic) point to (geocentric) x/y/z Cartesian coordinates. Must be overloaded. ''' raise AssertionError(unStr(self.classname + '.toCartesian'))
def falsed2(self): '''(INTERNAL) Must be overloaded. ''' raise AssertionError(unStr(self.classname + '.falsed2'))
def _notOverloaded(self, name, *args, **kwds): # PYCHOK no cover '''Raise an error for a method or property not overloaded. ''' n = '%s %s.%s' % (self._notOverloaded.__name__, self.classname, name) raise AssertionError(unStr(n, *args, **kwds))