.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/Creating_GS_Files/plot_systems.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_Creating_GS_Files_plot_systems.py: Systems (YAML, GA-AEM .stm, templates) -------------------------------------- Where a system definition comes from. A GSPy ``System`` says what recorded the data: the transmitters, the receivers, the couplets pairing them, and the gate times or frequencies the data is sampled at. There are three ways to get one, and this example works through all of them: 1. **From a YAML file** you have already written - :meth:`System.open`. 2. **From a GA-AEM ``.stm`` file**, the system file GALEISBSTDEM forward models with - :meth:`System.from_stm`. Both flavours are read: the ``System Begin`` block a time domain system is written as, and the table of coil pairs a frequency domain system is written as. 3. **From a template** for the method family, to fill in by hand - :meth:`System.metadata_template`. The three mix. A ``.stm`` is a forward modelling file rather than a system description, so it answers what it can and the rest is left as template placeholders reading ``?? what goes here ??`` - hand it a YAML alongside, or dump what it knows to a template and finish the job by hand. .. GENERATED FROM PYTHON SOURCE LINES 26-41 .. code-block:: Python from os.path import join import matplotlib.pyplot as plt import numpy as np from gspy import Survey, System system_path = join('..', 'data_files', 'systems') def placeholders(system): """The fields nothing has answered yet.""" return [name for name in system.data_vars if '??' in str(system[name].values)] .. GENERATED FROM PYTHON SOURCE LINES 42-47 A system is described per method family +++++++++++++++++++++++++++++++++++++++ Each family names the fields that method uses. This is the vocabulary every route below ends up speaking, whichever file it started from. .. GENERATED FROM PYTHON SOURCE LINES 47-50 .. code-block:: Python print(System.templates()) .. rst-class:: sphx-glr-script-out .. code-block:: none ('fdem', 'magnetic', 'radiometric', 'tdem') .. GENERATED FROM PYTHON SOURCE LINES 51-55 From a YAML file ++++++++++++++++ The ordinary case: a file holding one system, under a key with "system" in it. .. GENERATED FROM PYTHON SOURCE LINES 55-59 .. code-block:: Python resolve = System.open(join(system_path, 'Resolve_system.yml')) print(resolve) .. rst-class:: sphx-glr-script-out .. code-block:: none Size: 2kB Dimensions: (channel: 2, frequency: 6, n_transmitter: 6, n_receiver: 6, n_couplet: 6) Coordinates: * channel (channel) ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_systems.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_systems.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_