txrx_lists_to_dict#

emg3d.surveys.txrx_lists_to_dict(txrx)[source]#

Create dict from provided list of Tx/Rx instances.

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 list of source or receiver instances, or from a list of lists and dicts of source or receiver instances.

Parameters
txrx{Tx*, Rx*, list, dict)

Any of the available sources or receivers, e.g., emg3d.electrodes.TxElectricDipole, or a list or dict of Tx*/Rx* instances. If it is a dict, it is returned unaltered.

It can also be a list containing a combination of the above (lists, dicts, and instances).

Returns
outdict

Dict where the keys consist of a TxRx-specific 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 two electric, fixed receivers.
   ...: electric = [emg3d.RxElectricPoint((x, 0, 0, 0, 0))
   ...:             for x in [1000, 1100]]
   ...: 

In [3]: # Create three magnetic, fixed receivers.
   ...: magnetic = emg3d.surveys.txrx_coordinates_to_dict(
   ...:                 emg3d.RxMagneticPoint,
   ...:                 ([950, 1050, 1150], 0, 0, 0, 90))
   ...: 

In [4]: # Create a streamer receiver, flying 5 m behind the source.
   ...: streamer = emg3d.RxElectricPoint((5, 0, 0, 0, 0), relative=True)
   ...: 

In [5]: # Collect all receivers.
   ...: receivers = emg3d.surveys.txrx_lists_to_dict(
   ...:                 [[streamer, ], electric, magnetic])
   ...: receivers  # QC our collected receivers
   ...: 
Out[5]: 
{'RxEP-1': RxElectricPoint: relative; complex;
     x=5.0 m, y=0.0 m, z=0.0 m, θ=0.0°, φ=0.0°,
 'RxEP-2': RxElectricPoint: absolute; complex;
     x=1,000.0 m, y=0.0 m, z=0.0 m, θ=0.0°, φ=0.0°,
 'RxEP-3': RxElectricPoint: absolute; complex;
     x=1,100.0 m, y=0.0 m, z=0.0 m, θ=0.0°, φ=0.0°,
 'RxMP-4': RxMagneticPoint: absolute; complex;
     x=950.0 m, y=0.0 m, z=0.0 m, θ=0.0°, φ=90.0°,
 'RxMP-5': RxMagneticPoint: absolute; complex;
     x=1,050.0 m, y=0.0 m, z=0.0 m, θ=0.0°, φ=90.0°,
 'RxMP-6': RxMagneticPoint: absolute; complex;
     x=1,150.0 m, y=0.0 m, z=0.0 m, θ=0.0°, φ=90.0°}