Skip to content

Commit

Permalink
Merge remote-tracking branch 'metoffice/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 18, 2016
2 parents 1f81686 + a4e2051 commit dbb1e08
Show file tree
Hide file tree
Showing 16 changed files with 913 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@ target/
.python-version

.DS_Store
# Website
doc/_build
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[submodule "doc/nbpublisher"]
path = doc/nbpublisher
url = https://github.com/ioam/ioam-builder.git
branch = nbpublisher
[submodule "doc/builder"]
path = doc/builder
url = https://github.com/ioam/ioam-builder.git
branch = docbuilder
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ install:

script:
- nosetests --with-doctest --with-coverage --cover-package=holocube
- flake8 --ignore=E,W .
- flake8 --ignore=E,W . --exclude=./doc

after_success: coveralls
110 changes: 110 additions & 0 deletions doc/Homepage.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"HoloCube is a [Python](http://python.org) library that makes it easy to explore and visualize geographical, meterological, oceanographic, and other multidimensional gridded datasets. HoloCube interfaces between the [HoloViews](http://holoviews.org) library for flexible visualizations of multidimensional data, the [Iris](http://scitools.org.uk/iris) library for storing and processing climate and weather data, and the [Cartopy](http://scitools.org.uk/cartopy) library for working with cartographic projections and visualizations in [Matplotlib](http://matplotlib.org/). Specifically, HoloCube:\n",
"\n",
"1. Extends HoloViews objects to allow them to use data stored in [Iris](http://scitools.org.uk/iris) [cubes](http://scitools.org.uk/iris/docs/latest/userguide/iris_cubes.html). After `import holocube`, data can be provided to any Holoviews `Element` directly as a cube, without needing to first convert into one of the other supported formats (NumPy arrays, Pandas data frames, etc.). This support is independent of the other support below -- data from Iris cubes can be used even in non-geographic `Element`s, and most geographic Elements can accept data in any format.\n",
"\n",
"2. Adds a set of new HoloViews `Element`s that have an associated geographic projection (`GeoElement`s), based on `cartopy.crs`. These currently include `GeoFeature`, `WMTS`, `GeoTiles`, `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 ``Image(temp_cube)*hc.GeoFeature(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 layours.\n",
"\n",
"With HoloCube, you can now work easily and naturally with large, multidimensional 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 holocube as hc\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 GeoFeature [projection=crs.Geostationary()]\n",
"\n",
"coasts = hc.GeoFeature(cf.COASTLINE)\n",
"borders = hc.GeoFeature(cf.BORDERS)\n",
"ocean = hc.GeoFeature(cf.OCEAN)\n",
"\n",
"ocean + borders + (ocean*borders).relabel(\"Overlay\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The following example loads a cube from [iris-sample-data](https://github.com/SciTools/iris-sample-data) and displays it as follows:"
]
},
{
"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 GeoImage [colorbar=True] (cmap='viridis')\n",
"(hc.HoloCube(surface_temp).groupby(['time'], group_type=hc.Image) * hc.GeoFeature(cf.COASTLINE))"
]
}
],
"metadata": {
"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"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Loading

0 comments on commit dbb1e08

Please sign in to comment.