Skip to main content

numpy array with grids and associated operations

Project description

SPACEGRIDS README.

The Python 2.7 Spacegrids module, “Numpy on grids”, provides useful classes for analyzing spatial data defined on grids (e.g. covering the Earth’s surface). It interprets Netcdf metadata, and is designed to ensure consistency between data and grid information via interacting objects of fields, grids, coordinates and axes. It provides intuitive short expressions for complex operations, including volume and distance related concepts such as integration and differentiation.

Interprets metadata for most climate model output and datasets in Netcdf format, and is confirmed to work with UVic (all versions), CSIRO Mk3L, FAMOUS, CCM3.6 (Atmosphere), Levitus Data. If you have problems reading data and/ or interpreting metadata (or find a bug), the author would be happy to take a look (see also Github for email etc).

Installs by typing “pip install spacegrids” on command line. On Mac, pip can be installed via “sudo easy_install pip”. On Ubuntu/ Debian, install dependencies via package manager if pip install fails:

apt-get install python-{tk,numpy,matplotlib,scipy}


Documentation: https://github.com/willo12/spacegrids/wiki

The following import statement provides all functionality:

from spacegrids import sg

Once loaded, sg allows an overview of the available data via sg.info(). A project object is created via P = sg.project(D[‘some_project’]). This then allows fields to be loaded automatically for all experiment subdirectories. Data grids are constructed based on the Netcdf metadata.

DATA ORGANISATION ON DISK

Before using projects, Netcdf data must be organised in a projects directory tree. Create a directory named PROJECTS inside your home directory ($HOME) or on a storage disk (see below). This will contain all the data for all the projects. Then create a subdirectory for each of your projects. Inside each project, create a small text file named projname containing only a name, say “glacial”, to identify your project. In this case, type: echo glacial > projname within the project dir. This will allow the sg Python code to regard all subdirectories inside the project directory as experiment directories and will be searched for netcdf files when a sg project object P is created (see below) on the Python command line or inside a script. If a netcdf file is found in any of these (experiment) subdirectories, an exper (experiment) object of the same name as the directory is created and added to the dictionary of experiments belonging to the project object P.

The following python modules are required:

numpy matplotlib (requires python-tk) scipy

To obtain pip on Ubuntu/ Debian: (sudo) apt-get install python-pip.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spacegrids-1.1.3.tar.gz (42.1 kB view hashes)

Uploaded Source

Built Distribution

spacegrids-1.1.3-py2.7.egg (89.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page