emsig / emg3d

A multigrid solver for 3D electromagnetic diffusion

Home Page:https://emg3d.emsig.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ENH: Add option to remove empty Tx-Rx-f-pairs

prisae opened this issue · comments

Survey.select can be very useful to reduce a dataset. However, currently it will, e.g., keep all receivers if we select a particular source, even if this receiver has no data from that source.

  • Should be a keyword to switch off/on (by default on?)
  • This only applies if the survey has observed data.

To find empty slices is straight forward:

# empty sources
np.all(np.isnan(survey.data.observed.data), axis=(1, 2))

# empty receivers
np.all(np.isnan(survey.data.observed.data), axis=(0, 2))

# empty frequencies
np.all(np.isnan(survey.data.observed.data), axis=(0, 1))

We can get then a list of it and use recursion to get the survey.