.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "tutorial-config/eg_05_transfer_functions.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_tutorial-config_eg_05_transfer_functions.py: Transfer functions ^^^^^^^^^^^^^^^^^^ Transfer functions can be customised too depending on needs. There are built-in transfer functions, which have the added benefit of having plotting functions meaning the results can be visualised correctly, for example the impedance tensor. However, if a completely custom transfer function is required, this can be done with the caveat that there will be no plotting function available. A better solution might be to write a custom transfer function if required. For more about writing custom transfer functions, see the advanced usage. .. GENERATED FROM PYTHON SOURCE LINES 15-17 .. code-block:: default from resistics.transfunc import TransferFunction .. GENERATED FROM PYTHON SOURCE LINES 18-20 To initialise a new transfer function, the input and channels need to be defined. .. GENERATED FROM PYTHON SOURCE LINES 20-24 .. code-block:: default tf = TransferFunction(in_chans=["Cat", "Dog"], out_chans=["Tiger", "Wolf"]) print(tf) tf.summary() .. rst-class:: sphx-glr-script-out Out: .. code-block:: none | Tiger | = | Tiger_Cat Tiger_Dog | | Cat | | Wolf | | Wolf_Cat Wolf_Dog | | Dog | { 'name': 'TransferFunction', 'variation': 'generic', 'out_chans': ['Tiger', 'Wolf'], 'in_chans': ['Cat', 'Dog'], 'cross_chans': ['Cat', 'Dog'], 'n_out': 2, 'n_in': 2, 'n_cross': 2 } .. GENERATED FROM PYTHON SOURCE LINES 25-28 It is also possible to set the channels that will be used to calculate out the cross spectra. Note that these channels should be available in the input site, output site and cross site respectively. .. GENERATED FROM PYTHON SOURCE LINES 28-37 .. code-block:: default tf = TransferFunction( name="Jungle", in_chans=["Cat", "Dog"], out_chans=["Tiger", "Wolf"], cross_chans=["Lizard", "Crocodile"], ) print(tf) tf.summary() .. rst-class:: sphx-glr-script-out Out: .. code-block:: none | Tiger | = | Tiger_Cat Tiger_Dog | | Cat | | Wolf | | Wolf_Cat Wolf_Dog | | Dog | { 'name': 'Jungle', 'variation': 'generic', 'out_chans': ['Tiger', 'Wolf'], 'in_chans': ['Cat', 'Dog'], 'cross_chans': ['Lizard', 'Crocodile'], 'n_out': 2, 'n_in': 2, 'n_cross': 2 } .. GENERATED FROM PYTHON SOURCE LINES 38-41 In scenarios where the core transfer function stays the same (input and output channels), but the cross channels will be changed, there is an additional variation property that helps separate them. .. GENERATED FROM PYTHON SOURCE LINES 41-50 .. code-block:: default tf = TransferFunction( name="Jungle", variation="Birds", in_chans=["Cat", "Dog"], out_chans=["Tiger", "Wolf"], cross_chans=["Owl", "Eagle"], ) print(tf) tf.summary() .. rst-class:: sphx-glr-script-out Out: .. code-block:: none | Tiger | = | Tiger_Cat Tiger_Dog | | Cat | | Wolf | | Wolf_Cat Wolf_Dog | | Dog | { 'name': 'Jungle', 'variation': 'Birds', 'out_chans': ['Tiger', 'Wolf'], 'in_chans': ['Cat', 'Dog'], 'cross_chans': ['Owl', 'Eagle'], 'n_out': 2, 'n_in': 2, 'n_cross': 2 } .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.008 seconds) .. _sphx_glr_download_tutorial-config_eg_05_transfer_functions.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: eg_05_transfer_functions.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: eg_05_transfer_functions.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_