.. _simpletess:

Simple tesseroid model
======================

The files in the folder ``cookbook/simple_tess`` show how to calculate the
gravitational fields of a simple 2 tesseroid model at 260 km height.

For this simple setup, the model file looks like this:

.. include:: ../../cookbook/simple_tess/model.txt
    :literal:

The ``simple_tess.sh`` script performs the calculations and calls the
``plot.py`` script to plot the results:

.. include:: ../../cookbook/simple_tess/simple_tess.sh
    :literal:

``tessgrd`` generates a regular grid and prints that to standard output
(``stdout``).
The scripts pipes the grid points to ``tesspot`` etc. to calculate the
corresponding fields.
Option ``-v`` tells ``tessgzz``
to print information messages (to stderr).
Option ``-llog.txt`` tells tessgzz
to log the information plus debug messages
to a file called ``log.txt``.

The columns of the output file will be, respectively:
longitude, latitude, height, potential, gx, gy, gz, gxx, gxy, gxz, gyy, gyz,
and gzz.
The result should look like this
("column" means the column of the output file):

.. figure:: ../../cookbook/simple_tess/simple_tess.png
    :align: center
    :width: 600px

    Plot of the columns of ``output.txt`` generated by ``simple_tess.sh``.
    Orthographic projection
    (thanks to the Basemap_ toolkit of matplotlib_).


.. _Basemap: http://matplotlib.org/basemap/index.html
.. _matplotlib: http://matplotlib.org
