obspy.core.util.misc.complexifyString

complexifyString(line)[source]

Converts a string in the form “(real, imag)” into a complex type.

Parameters:line (str) String in the form "(real, imag)".
Return type:complex
Returns:Complex number.

Example

>>> complexifyString("(1,2)")
(1+2j)
>>> complexifyString(" ( 1 , 2 ) ")
(1+2j)