.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/britain-magnetic.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_gallery_britain-magnetic.py: Magnetic airborne survey of Britain ----------------------------------- This is a digitization of an airborne magnetic survey of Britain. Data are sampled where flight lines crossed contours on the archive maps. Contains only the total field magnetic anomaly, not the magnetic field intensity measurements or corrections. Unfortunately, the exact date of measurements is not available (only the year). Contains British Geological Survey materials © UKRI 2021. **Original source:** `British Geological Survey `__ .. GENERATED FROM PYTHON SOURCE LINES 25-31 .. code-block:: default import numpy as np 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:: default fname = ensaio.fetch_britain_magnetic(version=1) print(fname) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none /home/runner/work/_temp/cache/ensaio/v1/britain-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:: default data = pd.read_csv(fname) data .. raw:: html
line_and_segment year longitude latitude height_m total_field_anomaly_nt
0 FL1-1 1955 -1.74162 53.48164 792 62
1 FL1-1 1955 -1.70122 53.48352 663 56
2 FL1-1 1955 -1.08051 53.47677 315 30
3 FL1-1 1955 -1.07471 53.47672 315 31
4 FL1-1 1955 -1.01763 53.47586 321 44
... ... ... ... ... ... ...
541503 FL-3(TL10-24)-1 1965 -4.68843 58.26786 1031 64
541504 FL-3(TL10-24)-1 1965 -4.68650 58.26786 1045 74
541505 FL-3(TL10-24)-1 1965 -4.68535 58.26790 1035 94
541506 FL-3(TL10-24)-1 1965 -4.68419 58.26787 1024 114
541507 FL-3(TL10-24)-1 1965 -4.68274 58.26790 1011 120

541508 rows × 6 columns



.. 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-60 .. code-block:: default fig = pygmt.Figure() scale = np.percentile(data.total_field_anomaly_nt, 95) pygmt.makecpt(cmap="polar", series=[-scale, scale]) fig.plot( x=data.longitude, y=data.latitude, style="c0.02c", color=data.total_field_anomaly_nt, cmap=True, projection="M15c", ) fig.colorbar(frame='af+l"nT"', position="jBL+h+w7c/0.2c+o1/2") fig.coast(shorelines=True) fig.basemap(frame="afg") fig.show() .. image-sg:: /gallery/images/sphx_glr_britain-magnetic_001.png :alt: britain magnetic :srcset: /gallery/images/sphx_glr_britain-magnetic_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 21.924 seconds) .. _sphx_glr_download_gallery_britain-magnetic.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: britain-magnetic.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: britain-magnetic.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_