<s> import numpy as np <EOL> def WennerSrcList ( nElecs , aSpacing , in2D = False , plotIt = False ) : <EOL> import SimPEG . DCIP as DC <EOL> elocs = np . arange ( <NUM_LIT:0> , aSpacing * nElecs , aSpacing ) <EOL> elocs -= ( nElecs * aSpacing - aSpacing ) / <NUM_LIT:2> <EOL> space = <NUM_LIT:1> <EOL> WENNER = np . zeros ( ( <NUM_LIT:0> , ) , dtype = int ) <EOL> for ii in range ( nElecs ) : <EOL> for jj in range ( nElecs ) : <EOL> test = np . r_ [ jj , jj + space , jj + space * <NUM_LIT:2> , jj + space * <NUM_LIT:3> ] <EOL> if np . any ( test >= nElecs ) : <EOL> break <EOL> WENNER = np . r_ [ WENNER , test ] <EOL> space += <NUM_LIT:1> <EOL> WENNER = WENNER . reshape ( ( - <NUM_LIT:1> , <NUM_LIT:4> ) ) <EOL> if plotIt : <EOL> for i , s in enumerate ( '<STR_LIT>' ) : <EOL> plt . plot ( elocs [ WENNER [ : , i ] ] , s + '<STR_LIT:.>' ) <EOL> plt . show ( ) <EOL> i = <NUM_LIT:0> <EOL> if in2D : <EOL> getLoc = lambda ii , abmn : np . r_ [ elocs [ WENNER [ ii , abmn ] ] , <NUM_LIT:0> ] <EOL> else : <EOL> getLoc = lambda ii , abmn : np . r_ [ elocs [ WENNER [ ii , abmn ] ] , <NUM_LIT:0> , <NUM_LIT:0> ] <EOL> srcList = [ ] <EOL> for i in range ( WENNER . shape [ <NUM_LIT:0> ] ) : <EOL> rx = DC . RxDipole ( getLoc ( i , <NUM_LIT:1> ) , getLoc ( i , <NUM_LIT:2> ) ) <EOL> src = DC . SrcDipole ( [ rx ] , getLoc ( i , <NUM_LIT:0> ) , getLoc ( i , <NUM_LIT:3> ) ) <EOL> srcList += [ src ] <EOL> return srcList </s>
