Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Commit

Permalink
Merge branch 'master' into new-moulder
Browse files Browse the repository at this point in the history
Conflicts:
	README.md
  • Loading branch information
leouieda committed Nov 23, 2014
2 parents a71e20b + 32af5c0 commit 2c41467
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 92 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include LICENSE.txt
include README.md
include README.rst
include CITATION.rst
include MANIFEST.in
recursive-include cookbook *
Expand Down
83 changes: 0 additions & 83 deletions README.md

This file was deleted.

108 changes: 108 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
|title|
=======

.. |title| image:: https://raw.githubusercontent.com/fatiando/logo/master/fatiando-banner-long.png
:alt: Fatiando a Terra

`Website <http://www.fatiando.org>`__ |
`Docs <http://fatiando.readthedocs.org>`__ |
`Mailing list <https://groups.google.com/d/forum/fatiando>`__ |
`Google+ <https://plus.google.com/+FatiandoOrg>`__

A Python package for modeling and inversion in geophysics.

.. image:: http://img.shields.io/pypi/v/fatiando.svg?style=flat
:alt: Latest PyPI version
:target: https://crate.io/packages/fatiando
.. image:: http://img.shields.io/pypi/dm/fatiando.svg?style=flat
:alt: Number of PyPI downloads
:target: https://crate.io/packages/fatiando/
.. image:: http://img.shields.io/badge/license-BSD-lightgrey.svg?style=flat
:alt: BSD 3 clause license
:target: https://github.com/fatiando/fatiando/blob/master/LICENSE.txt
.. image:: http://img.shields.io/travis/fatiando/fatiando.svg?style=flat
:alt: Travis CI build status
:target: https://travis-ci.org/fatiando/fatiando
.. image:: http://img.shields.io/coveralls/fatiando/fatiando.svg?style=flat
:alt: Test coverage status
:target: https://coveralls.io/r/fatiando/fatiando?branch=master
.. image:: http://img.shields.io/badge/doi-10.6084/m9.figshare.1115194-blue.svg?style=flat
:alt: doi:10.6084/m9.figshare.1115194
:target: http://dx.doi.org/10.6084/m9.figshare.1115194

Dependencies
------------

For the moment, Fatiando runs and is tested in Python 2.7.
To install and run Fatiando, you'll need the following packages:

* numpy >= 1.8
* scipy >= 0.14
* matplotlib >= 1.3
* IPython >= 2.0.0
* mayavi >= 4.3
* PIL >= 1.1.7
* basemap >= 1.0.7
* gcc >= 4.8.2

You can get all of these on Linux, Mac, and Windows through
the `Anaconda distribution <http://continuum.io/downloads>`__.
See file ``requirements.txt`` and the
`documentation <http://fatiando.readthedocs.org>`__.

**Windows users**: See the
`install docs <http://fatiando.readthedocs.org/en/latest/install.html>`__
for special instructions on getting the dependencies installed.

Installing
----------

Download and install the latest release of Fatiando from
`PyPI <https://pypi.python.org/pypi/fatiando>`__::

pip install fatiando

or get the latest development version from Github::

pip install --upgrade https://github.com/fatiando/fatiando/archive/master.zip

**Note**: ``fatiando.__version__`` has the current version number. If you install
from PyPI, this will be something like ``'0.2'``. If you installed from Github,
this will be the latest commit hash. This way you can track exactly what
version of Fatiando generated your results.

Citing
------

Fatiando is research software. If you use it in your research,
please **cite it** in your publications as::

Uieda, L, Oliveira Jr, V C, Ferreira, A, Santos, H B; Caparica Jr, J F (2014),
Fatiando a Terra: a Python package for modeling and inversion in geophysics.
figshare. doi: 10.6084/m9.figshare.1115194

Some of the methods implemented here are also **original research** by some of
the developers. Please **also cite the method papers**.
See the
`CITATION.rst <https://github.com/fatiando/fatiando/blob/master/CITATION.rst>`__
file for more information.

Read `this blog post by Robin Wilson
<http://www.software.ac.uk/blog/2013-09-02-encouraging-citation-software-introducing-citation-files>`__
if you haven't heard of CITATION files.

Documentation
-------------

The latest documentation is available at ReadTheDocs. The docs reflects the
*master* branch on Github.

http://fatiando.readthedocs.org


License
-------

Fatiando a Terra is free software: you can redistribute it and/or modify it
under the terms of the **BSD License**. A copy of this license is provided in
`LICENSE.txt`.
7 changes: 5 additions & 2 deletions benchmarks/gravmag_harvester.ipynb

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion doc/develop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ copy this checklist to the PR description
`khmer docs
<http://khmer.readthedocs.org/en/v1.1/development.html#checklist>`__)::

Checklist:
## 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
Expand Down
2 changes: 1 addition & 1 deletion doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ information:
.. _Python: http://www.python.org/
.. _pip: http://www.pip-installer.org
.. _MinGW: http://www.mingw.org/
.. _mailing list: https://groups.google.com/forum/#!forum/fatiando
.. _mailing list: https://groups.google.com/d/forum/fatiando
.. _Leonardo Uieda: http://fatiando.org/people/uieda/
.. _Continuum Analytics: http://continuum.io/
.. _Anaconda: http://continuum.io/downloads
Expand Down
13 changes: 10 additions & 3 deletions fatiando/gravmag/talwani.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from fatiando.constants import G, SI2MGAL


def gz(xp, zp, polygons):
def gz(xp, zp, polygons, dens=None):
"""
Calculates the :math:`g_z` gravity acceleration component.
Expand All @@ -43,6 +43,9 @@ def gz(xp, zp, polygons):
Polygons must have the property ``'density'``. Polygons that don't have
this property will be ignored in the computations. Elements of
*polygons* that are None will also be ignored.
* dens : float or None
If not None, will use this value instead of the ``'density'`` property
of the polygons. Use this, e.g., for sensitivity matrix building.
.. note:: The y coordinate of the polygons is used as z!
Expand All @@ -56,9 +59,13 @@ def gz(xp, zp, polygons):
raise ValueError("Input arrays xp and zp must have same shape!")
res = numpy.zeros_like(xp)
for polygon in polygons:
if polygon is None or 'density' not in polygon.props:
if polygon is None or ('density' not in polygon.props
and dens is None):
continue
density = polygon.props['density']
if dens is None:
density = polygon.props['density']
else:
density = dens
x = polygon.x
z = polygon.y
nverts = polygon.nverts
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
DESCRIPTION = "Modeling and inversion for geophysics"
VERSION = versioneer.get_version()
CMDCLASS = versioneer.get_cmdclass()
with open("README.md") as f:
with open("README.rst") as f:
LONG_DESCRIPTION = ''.join(f.readlines())
PACKAGES = ['fatiando',
'fatiando.gravmag',
Expand Down

0 comments on commit 2c41467

Please sign in to comment.