Giter Site home page Giter Site logo

pygridgen's Introduction

pygridgen

Build Status

A Python interface to Pavel Sakov's C-based Gridgen Orthogonal Grid Generation Package

Components

  • simple GUI interface - The GUI interface uses native matplotlib widgets for even more portability.
  • arbitrary number of corners - More corners means more complicated domains. Great for domains with bays, estuaries, and other complicated features.
  • a single orthogonal grid as a result - Whites whiter! Brights brighter!

Install

We are working on packaging using Bento or binstar. When that happens it'll be very easy to install. For now, here's a very rough outline.

  • cd external/nn; ./configure ; make install
  • cd external/csa; ./configure ; make install
  • cd external/gridutils; ./configure ; make install
  • cd external/gridgen; ./configure ; make shlib
  • cd pygridgen; python setup.py install

More details on installation in the documentation:

Dependencies:

  • numpy
  • matplotlib
  • pyproj or basemap

Examples

Basic Example

import matplotlib.pyplot as plt
import pygridgen
x = [0, 1, 2, 1, 0]
y = [0, 0, 1, 2, 2]
beta = [1, 1, 0, 1, 1]

grid = pygridgen.grid.Gridgen(x, y, beta, shape=(10, 5))

fig, ax = plt.subplots()
ax.plot(x, y, 'k-')
ax.plot(grid.x, grid.y, 'b.')
plt.show()

basic example

Example with focus

Note that add_focus_x means focus along the x axis, not at a specific x-postion.

x = [0, 1, 2, 1, 0]
y = [0, 0, 1, 2, 2]
beta = [1, 1, 0, 1, 1]

focus = pygridgen.grid.Focus()
focus.add_focus_x(xo=0.5, factor=3, Rx=0.2)
focus.add_focus_y(yo=0.75, factor=5, Ry=0.1)
grid = pygridgen.grid.Gridgen(x, y, beta, shape=(20, 20), focus=focus)

fig, ax = plt.subplots()
ax.plot(x, y, 'k-')
ax.plot(grid.x, grid.y, 'b.')
plt.show()

focused example

pygridgen's People

Contributors

arttupos avatar hetland avatar phobson avatar rsignell-usgs avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.