{ "metadata": { "name": "", "signature": "sha256:0666197ce9ec4eb18d8ff3f029d4c1eea93ad64e361b513e24efa02ea00b77f3" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Spacegrids Documentation\n", "========================\n", "\n", "Spacegrids is an open source library providing a Numpy array with grids, labelled axes and associated grid-related methods such as regridding and integration. Spacegrids provides an object data model of Netcdf data that ensures consistency between a Numpy data array and its grid under common operations (and so avoiding common pitfalls related to axis interpretation), and much more. It is a write less do more library for everyday use. These Interactive Netcdf data plots using d3.js are based on Spacegrids.\n", "\n", "\n", "The Spacegrids module is a bit like \"Numpy on grids\". It allows code like:\n", "\n", " TEMP = P['some_dataset']['temperature']\n", " V = P['some_dataset']['y_velocity'] \n", " TV = TEMP*V\n", " zonal_mean_TV = TV.mean(X)\n", " TEMP2 = P['some_other_dataset']['temperature'] # defined on a different grid\n", " deltaTEMP = TEMP - TEMP2.regrid(TEMP.grid)\n", " \n", "It allows easy manipulation of spatial data, for instance a spatial grid of discrete latitude-longitude-depth coordinates covering the Earth's surface. This type of data is often stored in Netcdf file format, and indexed according to axes that are fully described in the Netcdf metadata. This allows interpretation of the data, consisting of the construction of axis and grid objects to be linked with a ```Field```. This contains the data array (e.g. temperature) when loading data into memory. Axis alignment upon multiplication and other operations with fields is then automatic, and no knowledge is required of the data index order. The module maintains a focus on notational simplicity, ease of use and maintenance of consistency between data and grid information under data manipulation. New coordinate objects and grids can be naturally constructed from experiment parameters or aggregated data values.\n", "\n", "Features\n", "--------\n", "\n", "- A numpy array with grid allowing automatic alignment and dimension broadcasting\n", "- Easy to use and intuitive regridding functionality\n", "- A data object model corresponding closely to Netcdf\n", "- Easier IO via abstraction of IO with multiple Netcdf files\n", "- Makes working with output of many experiments easy via aggregation methods\n", "- The ```Field``` class eliminates errors arising from picking the wrong array index\n", "- Quicker plotting due to automatic labels, axes etc.\n", "- Distance-related methods such as spatial differentiation and integration on sphere\n", "- Extensive unit tests and documentation\n", "\n", "There is lots of documentation, both in the source code and elsewhere. Other documentation can be found at: \n", "