.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/earth-geoid.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_earth-geoid.py: Earth geoid height grid at 10 arc-minute resolution --------------------------------------------------- The grid is grid-node registered and stored in netCDF with CF-compliant metadata. The geoid height is derived from the EIGEN-6C4 spherical harmonic model of the Earth's gravity field. **Original source:** `EIGEN-6C4 model `__ .. GENERATED FROM PYTHON SOURCE LINES 19-24 .. code-block:: default import pygmt import xarray as xr import ensaio .. GENERATED FROM PYTHON SOURCE LINES 25-26 Download and cache the data and return the path to it on disk. .. GENERATED FROM PYTHON SOURCE LINES 26-29 .. code-block:: default fname = ensaio.fetch_earth_geoid(version=1) print(fname) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none /home/runner/work/_temp/cache/ensaio/v1/earth-geoid-10arcmin.nc .. GENERATED FROM PYTHON SOURCE LINES 30-31 Load the netCDF grid with xarray. .. GENERATED FROM PYTHON SOURCE LINES 31-34 .. code-block:: default data = xr.load_dataarray(fname) data .. raw:: html
<xarray.DataArray 'geoid' (latitude: 1081, longitude: 2161)>
    array([[-29.5     , -29.5     , -29.5     , ..., -29.5     , -29.5     ,
            -29.5     ],
           [-29.5     , -29.5     , -29.5     , ..., -29.5     , -29.5     ,
            -29.5     ],
           [-29.6     , -29.6     , -29.6     , ..., -29.6     , -29.6     ,
            -29.6     ],
           ...,
           [ 14.7     ,  14.7     ,  14.7     , ...,  14.7     ,  14.7     ,
             14.7     ],
           [ 15.2     ,  15.2     ,  15.2     , ...,  15.2     ,  15.2     ,
             15.2     ],
           [ 15.400001,  15.400001,  15.400001, ...,  15.400001,  15.400001,
             15.400001]], dtype=float32)
    Coordinates:
      * longitude  (longitude) float64 -180.0 -179.8 -179.7 ... 179.7 179.8 180.0
      * latitude   (latitude) float64 -90.0 -89.83 -89.67 -89.5 ... 89.67 89.83 90.0
    Attributes:
        Conventions:     CF-1.8
        title:           Geoid height (EIGEN-6C4) with respect to WGS84
        crs:             WGS84
        source:          Generated from the EIGEN-6C4 model by the ICGEM Calculat...
        license:         Creative Commons Attribution 4.0 International Licence
        references:      https://doi.org/10.5880/icgem.2015.1
        long_name:       geoid height
        standard_name:   geoid_height_above_reference_ellipsoid
        description:     height of the geoid with respect to the WGS84 ellipsoid
        units:           m
        actual_range:    [-106.5   86. ]
        icgem_metadata:  generating_institute: gfz-potsdam\ngenerating_date: 2021...


.. GENERATED FROM PYTHON SOURCE LINES 35-36 Make a PyGMT pseudo-color map of the grid in a Mollweide projection. .. GENERATED FROM PYTHON SOURCE LINES 36-46 .. code-block:: default fig = pygmt.Figure() fig.basemap( region="g", projection="W15c", frame=True, ) fig.grdimage(data, cmap="polar+h") fig.colorbar(frame='af+l"geoid height [m]"') fig.coast(shorelines=True, resolution="c", area_thresh=1e4) fig.show() .. image-sg:: /gallery/images/sphx_glr_earth-geoid_001.png :alt: earth geoid :srcset: /gallery/images/sphx_glr_earth-geoid_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 7.539 seconds) .. _sphx_glr_download_gallery_earth-geoid.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: earth-geoid.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: earth-geoid.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_