txrx_coordinates_to_dict#

emg3d.surveys.txrx_coordinates_to_dict(TxRx, coordinates, **kwargs)[source]#

Create dict of TxRx instances with provided coordinates.

Source and receiver dictionaries to input into a emg3d.surveys.Survey can be created in many ways. This is a helper function to create a dict from a tuple of coordinates.

Parameters:
TxRx{Tx*, Rx*)

Any of the available sources or receivers, e.g., emg3d.electrodes.TxElectricDipole.

coordinatestuple

Tuple containing the input coordinates for the defined TxRx class. Each element of the tuple must either have length 1 or n.

**kwargs

Other parameters passed through to TxRx; again, each must be of size 1 or n.

Returns:
outdict

Dict where the keys consist of a TxRx-prefix followed by a number, and the values contain the corresponding TxRx instances.

Examples

In [1]: import emg3d
   ...: import numpy as np
   ...: 

In [2]: # Create 10 electric dipole sources from x=2000:2000:10,000, of
   ...: # strength 100 A.
   ...: offsets = np.arange(1, 6)*2000
   ...: sources = emg3d.surveys.txrx_coordinates_to_dict(
   ...:                 emg3d.TxElectricDipole,
   ...:                 (offsets, 0, 0, 0, 0), strength=100)
   ...: sources  # QC the source dict
   ...: 
Out[2]: 
{'TxED-1': TxElectricDipole: 100.0 A;
     center={2,000.0; 0.0; 0.0} m; θ=0.0°, φ=0.0°; l=1.0 m,
 'TxED-2': TxElectricDipole: 100.0 A;
     center={4,000.0; 0.0; 0.0} m; θ=0.0°, φ=0.0°; l=1.0 m,
 'TxED-3': TxElectricDipole: 100.0 A;
     center={6,000.0; 0.0; 0.0} m; θ=0.0°, φ=0.0°; l=1.0 m,
 'TxED-4': TxElectricDipole: 100.0 A;
     center={8,000.0; 0.0; 0.0} m; θ=0.0°, φ=0.0°; l=1.0 m,
 'TxED-5': TxElectricDipole: 100.0 A;
     center={10,000.0; 0.0; 0.0} m; θ=0.0°, φ=0.0°; l=1.0 m}