<commit_before>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "GeoViews is a [Python](http://python.org) library that makes it easy to explore and visualize geographical, meteorological, and oceanographic datasets.  \n",
    "\n",
    "GeoViews is built on the [HoloViews](http://holoviews.org) library for flexible visualizations of multidimensional data.  GeoViews adds a family of geographic plot types based on the [Cartopy](http://scitools.org.uk/cartopy) library for [Matplotlib](http://matplotlib.org/).  Each of these new `GeoElement` plot types is a new HoloViews `Element` that has an associated geographic projection based on `cartopy.crs`. The `GeoElements` currently include `Feature`, `WMTS`, `Tiles`, `Points`, `Contours`, `Image`, and `Text` objects, each of which can easily be overlaid in the same plots.  E.g. an object with temperature data can be overlaid with coastline data using an expression like ``gv.Image(temperature)*gv.Feature(cartopy.feature.COASTLINE)``.  Each `GeoElement` can also be freely combined in layouts with any other HoloViews `Element`, making it simple to make even complex multi-figure layouts.\n",
    "\n",
    "With GeoViews, you can now work easily and naturally with large, multidimensional geographic datasets, instantly visualizing any subset or combination of them, while always being able to access the raw data underlying any plot.  Here's a simple example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import holoviews as hv\n",
    "import geoviews as gv\n",
    "from cartopy import crs\n",
    "from cartopy import feature as cf\n",
    "\n",
    "hv.notebook_extension()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "%%opts Feature [projection=crs.Geostationary()]\n",
    "\n",
    "coasts  = gv.Feature(cf.COASTLINE)\n",
    "borders = gv.Feature(cf.BORDERS)\n",
    "ocean   = gv.Feature(cf.OCEAN)\n",
    "\n",
    "ocean + borders + (ocean*borders).relabel(\"Overlay\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "GeoViews is designed to work well with the [Iris](http://scitools.org.uk/iris) library for storing and processing climate and weather data, extracting the data and metadata from Iris [cubes](http://scitools.org.uk/iris/docs/latest/userguide/iris_cubes.html) for use in `GeoElement`s.  HoloViews version 1.5 and later can read Iris cubes directly, as for other supported data formats like NumPy arrays and Pandas data frames.   \n",
    "\n",
    "The following example loads a cube from [iris-sample-data](https://github.com/SciTools/iris-sample-data) and displays it:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import iris\n",
    "surface_temp = iris.load_cube(iris.sample_data_path('GloSea4', 'ensemble_001.pp'))\n",
    "print surface_temp.summary()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "With HoloViews, you can quickly view the data in the cube interactively:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "%%opts Image [colorbar=True] (cmap='viridis') Overlay [fig_size=200]\n",
    "hv.Dataset(surface_temp).groupby(['time'], group_type=gv.Image) * gv.Feature(cf.COASTLINE)"
   ]
  }
 ],
 "metadata": {
  "hide_input": false,
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.11"
  }
 },<commit_msg>Simplified homepage example<commit_after>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "GeoViews is a [Python](http://python.org) library that makes it easy to explore and visualize geographical, meteorological, and oceanographic datasets.  \n",
    "\n",
    "GeoViews is built on the [HoloViews](http://holoviews.org) library for flexible visualizations of multidimensional data.  GeoViews adds a family of geographic plot types based on the [Cartopy](http://scitools.org.uk/cartopy) library for [Matplotlib](http://matplotlib.org/).  Each of these new `GeoElement` plot types is a new HoloViews `Element` that has an associated geographic projection based on `cartopy.crs`. The `GeoElements` currently include `Feature`, `WMTS`, `Tiles`, `Points`, `Contours`, `Image`, and `Text` objects, each of which can easily be overlaid in the same plots.  E.g. an object with temperature data can be overlaid with coastline data using an expression like ``gv.Image(temperature)*gv.Feature(cartopy.feature.COASTLINE)``.  Each `GeoElement` can also be freely combined in layouts with any other HoloViews `Element`, making it simple to make even complex multi-figure layouts.\n",
    "\n",
    "With GeoViews, you can now work easily and naturally with large, multidimensional geographic datasets, instantly visualizing any subset or combination of them, while always being able to access the raw data underlying any plot.  Here's a simple example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import holoviews as hv\n",
    "import geoviews as gv\n",
    "from cartopy import crs\n",
    "from cartopy import feature as cf\n",
    "\n",
    "hv.notebook_extension()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "%%opts Feature [projection=crs.Geostationary()]\n",
    "\n",
    "coasts  = gv.Feature(cf.COASTLINE)\n",
    "borders = gv.Feature(cf.BORDERS)\n",
    "ocean   = gv.Feature(cf.OCEAN)\n",
    "\n",
    "ocean + borders + (ocean*borders).relabel(\"Overlay\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "GeoViews is designed to work well with the [Iris](http://scitools.org.uk/iris) library for storing and processing climate and weather data, extracting the data and metadata from Iris [cubes](http://scitools.org.uk/iris/docs/latest/userguide/iris_cubes.html) for use in `GeoElement`s.  HoloViews version 1.5 and later can read Iris cubes directly, as for other supported data formats like NumPy arrays and Pandas data frames.   \n",
    "\n",
    "The following example loads a cube from [iris-sample-data](https://github.com/SciTools/iris-sample-data) and quickly builds an interactive tool for exploring the data:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "%%opts Image [colorbar=True] (cmap='viridis') Overlay [fig_size=200]\n",
    "\n",
    "import iris\n",
    "surface_temp = iris.load_cube(iris.sample_data_path('GloSea4', 'ensemble_001.pp'))\n",
    "\n",
    "hv.Dataset(surface_temp).groupby(['time'], group_type=gv.Image) * gv.Feature(cf.COASTLINE)"
   ]
  }
 ],
 "metadata": {
  "hide_input": false,
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.11"
  }
 },
{'fraction_non_alphanumeric': 0.15270494948203095, 'fraction_numerical': 0.004348382146054482, 'mean_word_length': 3.6299585553582, 'pattern_counts': {'":': 91, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7614905', 'n_tokens_mistral': 2704, 'n_tokens_neox': 2612, 'n_words': 742}