#NEWLINE# def getAppResPhs( MTdata ) : #NEWLINE# #INDENT# def appResPhs( freq , z ) : #NEWLINE# #INDENT# app_res = ( ( ( 1.0 / ( 8e-07 * ( np . pi ** 2 ) ) ) / freq ) * ( np . abs ( z ) ** 2 ) ) #NEWLINE# app_phs = ( np . arctan2 ( z . imag , z . real ) * ( 180 / np . pi ) ) #NEWLINE# return ( app_res , app_phs ) #NEWLINE# #UNINDENT# zList = [ ] #NEWLINE# for src in MTdata . survey . srcList : #NEWLINE# #INDENT# zc = [ src . freq ] #NEWLINE# for rx in src . rxList : #NEWLINE# #INDENT# if ( 'i' in rx . rxType ) : #NEWLINE# #INDENT# m = 1j #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# m = 1 #NEWLINE# #UNINDENT# zc . append ( ( m * MTdata [ ( src , rx ) ] ) ) #NEWLINE# #UNINDENT# zList . append ( zc ) #NEWLINE# #UNINDENT# return [ appResPhs ( zList [ i ] [ 0 ] , np . sum ( zList [ i ] [ 1 : 3 ] ) ) for i in np . arange ( len ( zList ) ) ]