Skip to content

Commit

Permalink
Merge 9235271 into db8faa7
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescAlted committed Nov 11, 2016
2 parents db8faa7 + 9235271 commit a5d3ea0
Show file tree
Hide file tree
Showing 35 changed files with 989 additions and 606 deletions.
486 changes: 298 additions & 188 deletions doc/source/getting_started.rst

Large diffs are not rendered by default.

95 changes: 47 additions & 48 deletions doc/source/introduction.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
.. _introduction:


************
Introduction
************
Expand All @@ -18,70 +15,72 @@ Current development activities are focused on improved generality and
handling of FLEXPART output in all possible run configurations, with
and without deposition, forward, backward, or otherwise.

.. _getting-reflexible:
A brief description of the package
=================================

The reflexible package is developed to work with output from the Lagrangian
Particle Dispersion Model, `FLEXPART <https://www.flexpart.eu/>`_ .

The module relies extensively on the users knowledge of FLEXPART data in
general, and thus one is strongly encouraged to read the
`users guide <http://zardoz.nilu.no/~andreas/flexpart/flexpart8.pdf>`_
which explains some basics regarding the model.

*Note* If you are interested in contributing functionality for other FLEXPART
versions, please contact me at `jfburkhart@gmail.com`

Purpose
-------

The purpose of the module is to make the creation of some standard plotting
products as easy as possible. However, due to the complex nature of FLEXPART
output, this isn't so easy! Regardless, I hope you find some of the
functionality helpful. The most critical functions are readheader and readgrid
which will at least get the data into Python so you can play with it as you are
most comfortable.

.. warning::
You are entering the domain of a scientist trying to write code. Constructive
input is sought, but don't complain if something breaks!


Getting reflexible
=================
Please contact: `John F. Burkhart <jfburkhart@gmail.com>`_

First, make sure you also have the dependencies installed:
- numpy
- matplotlib
- basemap (matplotlib toolkit)
- f2py (to build FortFlex)
- netCDF4 (*not* python-netcdf)
- PIL

Note the easiest way I've found to deal with the dependencies is to
use one of 'complete distributions' such as `Enthought
<http://www.enthought.com>`_ or the `python(xy)
<http://www.pythonxy.com>`_ or ideally `Anaconda
<http://www.continuum.io>`_. For Ubuntu you can pretty easily just
install the required packages. For the netcdf, we found it easiest to
use the science-meteorology-dev meta package and use pip to install
netcdf4-python.

Once you've installed all the dependencies, you can get the code from either
sources below.

GitHub
------

The code is available to the public at `github
<https://github.com/spectraphilic/reflexible>`_.
<https://github.com/spectraphilic/reflexible>`_. You can easily clone
the git repository::

PyPi
----
$ git clone https://github.com/spectraphilic/reflexible.git

The `reflexible <http://pypi.python.org/pypi/reflexible>`_ code is
also posted to pypi, but this is more likely to fall out of date.
Build and test
==============

It should simply be a matter of changing the repo directory and running
setup.py::

----
$ python setup.py build_ext --inplace

.. _email-list:
and then run the tests with::

Mailing List
============

There is a mailing list for the project set up at with
sourceforge. You can subscribe to the `reflexible
<https://lists.sourceforge.net/lists/listinfo/reflexible-users>`_ list
for user discussions.
$ pytest

.. _installation:
If the test suite pass, you can proceed with installation.

Installation
============

If all is working correctly, and you have all the required
dependencies, then it should simply be a matter of running setup.py::
It should simply be a matter of running::

$ python setup.py install

python setup.py build
Quick install
=============

and then install it (you might need to be superuser here)::
You may also want to install the package in one single shot (no testing
though!) with::

python setup.py install
$ pip install git+https://github.com/spectraphilic/reflexible.git

And *hopefully* everything works!.

Expand Down
44 changes: 6 additions & 38 deletions doc/source/reflexible.rst
Original file line number Diff line number Diff line change
@@ -1,41 +1,3 @@
.. _reflexible-overview:


*********************
The reflexible module
*********************

.. _module-description:

A brief description of the module
=================================

The reflexible module is developed to work with output from the Lagrangian
Particle Dispersion Model, `FLEXPART <http://transport.nilu.no/flexpart>`_ .

The module relies extensively on the users knowledge of FLEXPART data in
general, and thus one is strongly encouraged to read the `users guide <http://zardoz.nilu.no/~andreas/flexpart/flexpart8.pdf>`_ which explains some basics regarding the model.

*Note* If you are interested in contributing functionality for other FLEXPART
versions, please contact me at `jfburkhart@gmail.com`



Purpose
-------

The purpose of the module is to make the creation of some standard plotting
products as easy as possible. However, due to the complex nature of FLEXPART
output, this isn't so easy! Regardless, I hope you find some of the
functionality helpful. The most critical functions are readheader and readgrid
which will at least get the data into Python so you can play with it as you are
most comfortable.

.. warning::
You are entering the domain of a scientist trying to write code. Constructive
input is sought, but don't complain if something breaks!


******************
The reflexible API
******************
Expand All @@ -50,6 +12,12 @@ The reflexible API

.. autofunction:: reflexible.scripts.create_ncfile.create_ncfile

.. autofunction:: reflexible.scripts.fprun.main

.. autoclass:: reflexible.data_structures.Header
:members:
:undoc-members:

.. autoclass:: reflexible.data_structures.Reflexible
:members:
:undoc-members:
22 changes: 12 additions & 10 deletions reflexible/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
======
JFB: John F Burkhart <jfburkhart@gmail.com>
FA: Francesc Alted <faltet@gmail.com>
CONTRIBUTORS
============
Expand Down Expand Up @@ -89,15 +90,14 @@ def print_versions():

# Some data sources (for testing purposes mainly)
datasets = {
'Fwd1_V10.0': os.path.join(this_dir, "uio_examples/Fwd1_V10.0"),
'Fwd1_V10.1': os.path.join(this_dir, "uio_examples/Fwd1_V10.1/output.mpi"),
'Bwd1_V9.02': os.path.join(this_dir, "uio_examples/Bwd1_V9.02/outputs"),
'Bwd2_V9.2beta': os.path.join(this_dir,
"uio_examples/Bwd2_V9.2beta/outputs"),
'Fwd1_V9.02': os.path.join(this_dir, "uio_examples/Fwd1_V9.02/outputs"),
'Fwd2_V9.02': os.path.join(this_dir, "uio_examples/Fwd2_V9.02/outputs"),
'HelloWorld_V9.02': os.path.join(this_dir,
"uio_examples/HelloWorld_V9.02/outputs"),
'Fwd1_V10.1': os.path.join(this_dir, "uio_examples/Fwd1_V10.1"),
'Bwd1_V9.02': os.path.join(this_dir, "uio_examples/Bwd1_V9.02"),
'Bwd2_V9.2beta': os.path.join(this_dir, "uio_examples/Bwd2_V9.2beta"),
'Fwd1_V9.02': os.path.join(this_dir, "uio_examples/Fwd1_V9.02"),
'Fwd2_V9.02': os.path.join(this_dir, "uio_examples/Fwd2_V9.02"),
'HelloWorld_V9.02': os.path.join(this_dir, "uio_examples/HelloWorld_V9.02"),
'Only_Outputs_V9.02': os.path.join(
this_dir, "uio_examples/HelloWorld_V9.02/outputs"),
}


Expand All @@ -108,5 +108,7 @@ def print_versions():
from .data_structures import (Header, Command, Release,
ReleasePoint, Ageclass)
from .utils import Structure, CacheDict

from .base_read import read_trajectories, read_partpositions
from .flexpart import Flexpart
from .plotting import (plot_sensitivity, plot_at_level, plot_totalcolumn,
plot_trajectory)
1 change: 1 addition & 0 deletions reflexible/base_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,3 +320,4 @@ def read_shortpositions(filename, nspec, xlon0, ylat0, dx, dy, dataframe=False,
"""
#TODO: read_shortposit see partoutput_short.f90
pass

4 changes: 3 additions & 1 deletion reflexible/conv2netcdf4/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Import the public functions here
from .legacy_structures import Header, Structure, BinaryFile, FDC
from .flexpart_read import read_header, read_trajectories, read_command
from .flexpart_read import (
read_header, read_trajectories, read_command, read_releases)
from .grid_read import read_grid, get_slabs, fill_grids
from .helpers import get_fpdirs

0 comments on commit a5d3ea0

Please sign in to comment.