doc/gallery/etopo1.ipynb
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\nETOPO1 Earth Relief\n===================\n\nETOPO1 is a 1 arc-minute global relief model of Earth's surface that integrates\nland topography and ocean bathymetry [AmanteEakins2009]_. It's available in two\nversions: \"Ice Surface\" (top of Antarctic and Greenland ice sheets) and\n\"Bedrock\" (base of the ice sheets). The grids are loaded into\n:class:`xarray.Dataset` which can be used to plot and make computations.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import rockhound as rh\nimport matplotlib.pyplot as plt\nimport cmocean\n\n# Load a version of the topography grid\ngrid = rh.fetch_etopo1(version=\"bedrock\")\nprint(grid)\n\n# Select a subset that corresponds to Africa to make plotting faster given the\n# size of the grid.\nafrica = grid.sel(latitude=slice(-40, 45), longitude=slice(-20, 60))\n\n# Plot the age grid.\n# We're not using a map projection to speed up the plotting but this NOT\n# recommended.\nplt.figure(figsize=(9, 8))\nax = plt.subplot(111)\nafrica.bedrock.plot.pcolormesh(\n cmap=cmocean.cm.topo, cbar_kwargs=dict(pad=0.01, aspect=30), ax=ax\n)\nax.set_title(\"ETOPO1\")\nplt.tight_layout()\nplt.show()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}