fatiando/fatiando — pull request #149 by leouieda (2014-11-24 21:21:05+00:00)
Title: 2D gravity inversion for the relief of a basin using a polygonal parametrization

Implements the `PolygonalBasinGravity` class in the `gravmag.basin2d` module. This class performs the inversion for the relief of a basin by representing it as a polygon. The x coordinates of the vertices are evenly spaced and their depths are the parameters inverted for. Fixes two extra vertices to the surface at the edges of the model space.

This class is a good tool to show off and teach gravity inversion and regularization. The different effects of damping, smoothness, and total variation can be clearly seen. It has very rudimentary functionality:

* The top of the basin is assumed flat at a constant height.
* The range of the basin in the x dimension is assumed to be xmin and xmax of the data.
* Density is constant in the whole basin.

Below is the result of the cookbook recipe:

![Example](https://cloud.githubusercontent.com/assets/290082/5173251/479a6eba-740e-11e4-946c-7dc515b500fe.png)

## Checklist:

- [ ] Make tests for new code
- [ ] Create/update docstrings
- [ ] Code follows PEP8 style conventions
- [ ] Code and docs have been spellchecked
- [ ] Changelog entry
- [ ] Include new dependencies in docs, requirements.txt, README
- [ ] Documentation builds properly
- [ ] All tests pass
- [ ] Can be merged