Esempio n. 1
0
 def _tag2pole_or_zero(element):
     real = _tag2obj(element, _ns("Real"), float)
     imag = _tag2obj(element, _ns("Imaginary"), float)
     if real is not None or imag is not None:
         real = real or 0
         imag = imag or 0
     x = ComplexWithUncertainties(real, imag)
     real = _attr2obj(element.find(_ns("Real")), "minusError", float)
     imag = _attr2obj(element.find(_ns("Imaginary")), "minusError", float)
     if any([value is not None for value in (real, imag)]):
         real = real or 0
         imag = imag or 0
         x.lower_uncertainty = complex(real, imag)
     real = _attr2obj(element.find(_ns("Real")), "plusError", float)
     imag = _attr2obj(element.find(_ns("Imaginary")), "plusError", float)
     if any([value is not None for value in (real, imag)]):
         real = real or 0
         imag = imag or 0
         x.upper_uncertainty = complex(real, imag)
     x.number = _attr2obj(element, "number", int)
     return x