
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "gallery/osborne-magnetic.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_gallery_osborne-magnetic.py>`
        to download the full example code

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_gallery_osborne-magnetic.py:


Magnetic airborne survey of the Osborne Mine, Australia
-------------------------------------------------------

This is a section of a survey acquired in 1990 by the Queensland
Government, Australia. The line data have approximately 80 m terrain
clearance and 200 m line spacing. The section contains
the total field magnetic anomalies associated with the Osborne Mine,
Lightning Creek sill complex, and the Brumby prospect.

**Original source:**
`Geophysical Acquisition & Processing Section 2019. MIM Data from Mt Isa
Inlier, QLD (P1029), magnetic line data, AWAGS levelled. Geoscience Australia,
Canberra <http://pid.geoscience.gov.au/dataset/ga/142419>`__

**Pre-processing:** `Source code for preparation of the original dataset for
redistribution in Ensaio <https://github.com/fatiando-data/osborne-magnetic>`__

.. GENERATED FROM PYTHON SOURCE LINES 25-31

.. code-block:: Python


    import pandas as pd
    import pygmt

    import ensaio








.. GENERATED FROM PYTHON SOURCE LINES 32-33

Download and cache the data and return the path to it on disk

.. GENERATED FROM PYTHON SOURCE LINES 33-36

.. code-block:: Python

    fname = ensaio.fetch_osborne_magnetic(version=1)
    print(fname)





.. rst-class:: sphx-glr-script-out

 .. code-block:: none

    /home/runner/work/_temp/cache/ensaio/v1/osborne-magnetic.csv.xz




.. GENERATED FROM PYTHON SOURCE LINES 37-38

Load the CSV formatted data with pandas

.. GENERATED FROM PYTHON SOURCE LINES 38-41

.. code-block:: Python

    data = pd.read_csv(fname)
    data






.. raw:: html

    <div class="output_subarea output_html rendered_html output_result">
    <div>
    <style scoped>
        .dataframe tbody tr th:only-of-type {
            vertical-align: middle;
        }

        .dataframe tbody tr th {
            vertical-align: top;
        }

        .dataframe thead th {
            text-align: right;
        }
    </style>
    <table border="1" class="dataframe">
      <thead>
        <tr style="text-align: right;">
          <th></th>
          <th>flight_line</th>
          <th>longitude</th>
          <th>latitude</th>
          <th>height_orthometric_m</th>
          <th>total_field_anomaly_nt</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th>0</th>
          <td>5576</td>
          <td>140.66411</td>
          <td>-21.86833</td>
          <td>367</td>
          <td>-124</td>
        </tr>
        <tr>
          <th>1</th>
          <td>5576</td>
          <td>140.66403</td>
          <td>-21.86832</td>
          <td>367</td>
          <td>-124</td>
        </tr>
        <tr>
          <th>2</th>
          <td>5576</td>
          <td>140.66394</td>
          <td>-21.86832</td>
          <td>367</td>
          <td>-124</td>
        </tr>
        <tr>
          <th>3</th>
          <td>5576</td>
          <td>140.66385</td>
          <td>-21.86832</td>
          <td>366</td>
          <td>-124</td>
        </tr>
        <tr>
          <th>4</th>
          <td>5576</td>
          <td>140.66377</td>
          <td>-21.86832</td>
          <td>366</td>
          <td>-124</td>
        </tr>
        <tr>
          <th>...</th>
          <td>...</td>
          <td>...</td>
          <td>...</td>
          <td>...</td>
          <td>...</td>
        </tr>
        <tr>
          <th>990982</th>
          <td>10166</td>
          <td>140.50757</td>
          <td>-21.87023</td>
          <td>382</td>
          <td>-67</td>
        </tr>
        <tr>
          <th>990983</th>
          <td>10166</td>
          <td>140.50757</td>
          <td>-21.87029</td>
          <td>382</td>
          <td>-66</td>
        </tr>
        <tr>
          <th>990984</th>
          <td>10166</td>
          <td>140.50758</td>
          <td>-21.87034</td>
          <td>383</td>
          <td>-66</td>
        </tr>
        <tr>
          <th>990985</th>
          <td>10166</td>
          <td>140.50758</td>
          <td>-21.87040</td>
          <td>383</td>
          <td>-66</td>
        </tr>
        <tr>
          <th>990986</th>
          <td>10166</td>
          <td>140.50758</td>
          <td>-21.87046</td>
          <td>382</td>
          <td>-65</td>
        </tr>
      </tbody>
    </table>
    <p>990987 rows × 5 columns</p>
    </div>
    </div>
    <br />
    <br />

.. GENERATED FROM PYTHON SOURCE LINES 42-44

Make a PyGMT map with the data points colored by the total field magnetic
anomaly.

.. GENERATED FROM PYTHON SOURCE LINES 44-70

.. code-block:: Python

    fig = pygmt.Figure()
    fig.basemap(
        projection="M15c",
        region=[
            data.longitude.min(),
            data.longitude.max(),
            data.latitude.min(),
            data.latitude.max(),
        ],
        frame="af",
    )
    scale = 1500
    pygmt.makecpt(cmap="polar+h", series=[-scale, scale], background=True)
    fig.plot(
        x=data.longitude,
        y=data.latitude,
        fill=data.total_field_anomaly_nt,
        style="c0.075c",
        cmap=True,
    )
    fig.colorbar(
        frame='af+l"total field magnetic anomaly [nT]"',
        position="JBC+h+o0/1c+e",
    )
    fig.show()




.. image-sg:: /gallery/images/sphx_glr_osborne-magnetic_001.png
   :alt: osborne magnetic
   :srcset: /gallery/images/sphx_glr_osborne-magnetic_001.png
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 71-74

The anomaly at the bottom left is the Osborne Mine. The ones on the top right
are the Lightning Creek sill complex (the largest) and the Brumby prospect
(one of the smaller anomalies).


.. rst-class:: sphx-glr-timing

   **Total running time of the script:** (0 minutes 14.602 seconds)


.. _sphx_glr_download_gallery_osborne-magnetic.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: osborne-magnetic.ipynb <osborne-magnetic.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: osborne-magnetic.py <osborne-magnetic.py>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
