.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/morroco_speleothem_qdm.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_gallery_morroco_speleothem_qdm.py: QDM magnetic microscopy dataset of a speleothem from Morocco ------------------------------------------------------------ High-resolution magnetic map of a stalagmite sample from Wintimdouine Cave, Morocco, created using Quantum Diamond Microscope (QDM) measurements at Harvard University. The data were collected to explore the magnetic remanence properties of hematite and magnetite within the sample, providing insight into past geomagnetic field variations recorded in cave deposits. **Original source:** Carmo, Janine; Fu, Roger; Trindade, Ricardo; Piascik, Samuel (2023). QDM magnetic microscopy dataset of a speleothem from Morocco. figshare. Dataset. `10.6084/m9.figshare.22965200.v1 `__ **Pre-processing:** `Source code for preparation of the original dataset for redistribution in Ensaio `__ .. GENERATED FROM PYTHON SOURCE LINES 28-33 .. code-block:: Python import matplotlib.pyplot as plt import xarray as xr import ensaio .. GENERATED FROM PYTHON SOURCE LINES 34-36 Download and cache the data and return the path to it on disk. We'll use the netCDF version because it's smaller and can be loaded with xarray easily. .. GENERATED FROM PYTHON SOURCE LINES 36-39 .. code-block:: Python fname = ensaio.fetch_morroco_speleothem_qdm(version=1, file_format="netcdf") print(fname) .. rst-class:: sphx-glr-script-out .. code-block:: none /home/runner/work/_temp/cache/ensaio/v1/morroco-speleothem-qdm.nc .. GENERATED FROM PYTHON SOURCE LINES 40-41 Load the netCDF grid with xarray .. GENERATED FROM PYTHON SOURCE LINES 41-44 .. code-block:: Python data = xr.load_dataarray(fname) data .. raw:: html
<xarray.DataArray 'bz' (y: 600, x: 960)> Size: 2MB
    array([[ 352.40588  ,   94.89138  ,   41.619244 , ...,  470.18835  ,
             129.20056  ,   18.50121  ],
           [ 525.0481   ,  624.8466   ,   53.45418  , ...,  450.42517  ,
             240.12456  ,  -73.61368  ],
           [ 105.09393  ,  638.7656   ,  307.60736  , ...,  236.91327  ,
             386.84982  ,  -86.442154 ],
           ...,
           [ -83.74368  ,   32.98078  , -411.75073  , ...,  745.9937   ,
            1036.2003   , -140.64317  ],
           [ 171.17114  , -214.47801  ,  159.23438  , ...,  124.58138  ,
             258.5433   ,  -90.33769  ],
           [  80.609505 ,  273.08368  ,  118.23499  , ...,   -4.1957254,
             -53.55728  ,    2.1033592]], shape=(600, 960), dtype=float32)
    Coordinates:
      * x        (x) float64 8kB 0.0 2.35 4.7 7.05 ... 2.249e+03 2.251e+03 2.254e+03
      * y        (y) float64 5kB 0.0 2.35 4.7 7.05 ... 1.403e+03 1.405e+03 1.408e+03
        z        (y, x) float32 2MB 5.0 5.0 5.0 5.0 5.0 5.0 ... 5.0 5.0 5.0 5.0 5.0
    Attributes:
        Conventions:   CF-1.8
        title:         QDM magnetic microscopy dataset of a speleothem from Morocco
        source:        Measured on a Quantum Diamond Microscope (QDM) at Harvard ...
        license:       CC0 1.0 Universal
        references:    Carmo, Janine; Fu, Roger; Trindade, Ricardo; Piascik, Samu...
        long_name:     vertical magnetic field
        units:         nT
        actual_range:  [-236933.  301265.]


.. GENERATED FROM PYTHON SOURCE LINES 45-47 Make a pseudo-color map of the magnetic microscopy data and adjust the scale because of some very strong sources. .. GENERATED FROM PYTHON SOURCE LINES 47-52 .. code-block:: Python fig, ax = plt.subplots(1, 1, figsize=(9, 4.8), layout="constrained") scale = 2500 data.plot.imshow(ax=ax, cmap="RdBu_r", vmin=-scale, vmax=scale) ax.set_aspect("equal") plt.show() .. image-sg:: /gallery/images/sphx_glr_morroco_speleothem_qdm_001.png :alt: morroco speleothem qdm :srcset: /gallery/images/sphx_glr_morroco_speleothem_qdm_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.708 seconds) .. _sphx_glr_download_gallery_morroco_speleothem_qdm.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: morroco_speleothem_qdm.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: morroco_speleothem_qdm.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_