<jupyter_start><jupyter_text>Select frequency-range for Fourier transform in CSEM modellingControlled-source electromagnetic responses in three dimenision are usually modelled directly in the domain where you want to process the data, hence a time-domain code for time-domain processing, and a frequency-domain for frequency-domain processing. However, under certain conditions it can be favourable to calculate the model in theother domain and transform it with a (inverse) Fourier transform. The Fourier transform is generally very fast, in comparison with the 3D calculation of the electromagnetic response.**Have a look at the [time-domain examples](https://empymod.github.io/emg3d-gallery/gallery/index.htmltime-domain) in the [emg3d-gallery](https://empymod.github.io/emg3d-gallery) to see how a `Fourier`-instance can be used for compute transient CSEM responses.**<jupyter_code>import emg3d
import freqselect  # Script in this directory
import numpy as np
import matplotlib.pyplot as plt
# Style adjustments
%matplotlib notebook
plt.style.use('ggplot')<jupyter_output><empty_output><jupyter_text>Uncomment and run the following to have the notebook in full width.<jupyter_code>#%%html
#<style>
#.output_wrapper .ui-dialog-titlebar {display: none;}
#.container { width:100% !important; }
#</style><jupyter_output><empty_output><jupyter_text>Interactive frequency-selection App Note- Depending on the signal the real or imaginary part is used:  - `signal >= 0`: Sine transform, imaginary part is used,  - `signal < 0`: Cosine transform, real part is used.- The 1D-model is for an inline-survey:  - `src = [0, 0, src_z]` (at the origin at a given depth),  - `rec = [off, 0, rec_z]` (in-line receiver at a given offset and depth).   Model<jupyter_code>time = np.logspace(-2, 3, 301)  # Times; select a wide range.
src_z = 950                     # Source depth.
rec_z = 1000                    # Receiver depth.
depth = [0, 1000, 2000, 2100]   # Interfaces (m).
res = [2e14, 0.3, 1, 100, 1]    # Resistivities (Ohm.m).

rec = [np.array([1.5, 3, 6, 12])*1e3, np.zeros(4), rec_z]

# Collect it in a dict.
model = {
    'src': [0, 0, src_z],
    'rec': rec,
    'depth': depth,
    'res': res,
}<jupyter_output><empty_output><jupyter_text>Interactive frequency selection<jupyter_code>GUI = freqselect.InteractiveFrequency(
    src_z=src_z,
    rec_z=rec_z,
    depth=depth,
    res=res,
    time=time,
    ft='fftlog',
    xtfact=3,
    linlog='log',
)<jupyter_output><empty_output><jupyter_text>Example how to create a `Fourier` instance using the above parameters<jupyter_code>Fourier = emg3d.utils.Fourier(
    time=GUI.time,      # Current times from the GUI.
    fmin=GUI.fmin,      # Current fmin from the GUI.
    fmax=GUI.fmax,      # Current fmax from the GUI.
    signal=GUI.signal,  # Current signal from the GUI.
    ft=GUI.ft,          # Current Fourier transform from the GUI.
    ftarg=GUI.ftarg,    # Current FT arguments from the GUI.
)
emg3d.Report(['empymod'])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10830564784053157, 'fraction_numerical': 0.020930232558139535, 'mean_word_length': 4.120748299319728, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '565609', 'license': 'Apache-2.0', 'n_tokens_mistral': 1043, 'n_tokens_neox': 960, 'n_words': 319, 'path': 'InteractiveFrequencySelection.ipynb', 'repo_name': 'empymod/frequency-design', 'size': '3010'}