Fortran core of TRACMASS + Python wrapping around the outside.
I recommend setting up a good python environment for this work, as follows:
- Install miniconda:
- download file from Continuum
bash [download file]
- Set
conda-forge
to be highest-priority channel (this helps the geography libraries like cartopy that connect to the geos library be all consistent)
conda config --add channels conda-forge --force
- Create environment called "tracpy" (some of the listed packages are required and some are just suggested because they are useful)
conda create --name tracpy python=3.6 cartopy matplotlib ipython netCDF4 fiona shapely pandas xarray cmocean jupyter scipy numpy seaborn --yes
- Need to also have
octant
:
git clone https://github.com/hetland/octant.git
cd octant
pip install -e .
- Make sure you installed
tracpy
:
pip install -e .
- To use environment:
source activate tracpy
- To stop using environment (in a given terminal window):
source deactivate
- To install more packages later:
conda install [package name]
- Run the manual in
/docs
withjupyter notebook
If you want to install locally, you can generally use the --user
flag (e.g. pip install --user .
).
- Make your new TracPy directory and change directories into it.
- Clone the TracPy repository from GitHub.
In the command prompt, type:
git clone https://github.com/kthyng/tracpy.git
- Install the package globally:
pip install -e .
This makes the package an editable install so that it can be updated with future additions to TracPy. Note that a required package is octant. To instead install the package locally:pip install --user .
- Move into your TracPy directory.
- Update your GitHub repository.
git pull
- Edit your install of TracPy.
pip install -e .
orpip install --force-reinstall -e .
or, for local installation:pip install --ignore-installed --user .
- After making changes to the code, you can do some basic functionality testing with
py.test
ornosetests
in thetests
subdirectory.
Learn more by running a small test case. Internet required.
- Open an iPython notebook server in the TracPy
docs
directory.ipython notebook
- A webpage will open in your browser showing the available notebooks in the current directory. Open the notebook called manual.
- The cells of the notebook can be run in order by pushing "shift" and "enter" together or the whole notebook can be run by selecting Cell > Run all. The notebook demonstrates how to initialize and run a numerical drifter experiment using TracPy.
- Alternatively, a static PDF version of the manual can be viewed at
http://nbviewer.ipython.org/urls/raw.github.com/kthyng/tracpy/master/docs/manual.ipynb
.
For projects, it is suggested to start a separate directory with its own initialization and run file for the simulation(s). Then TracPy can be imported as a module and the run script can be run from the project. An example set of projects can be found at https://github.com/kthyng/gisr.git
.
- Döös, K., Kjellsson, J., & Jönsson, B. (2013). TRACMASS—A Lagrangian Trajectory Model. In Preventive Methods for Coastal Protection (pp. 225-249). Springer International Publishing.
- Döös, K., Rupolo, V., & Brodeau, L. (2011). Dispersion of surface drifters and model-simulated trajectories. Ocean Modelling, 39(3), 301-310.
- Döös, K., & Engqvist, A. (2007). Assessment of water exchange between a discharge region and the open sea–A comparison of different methodological concepts. Estuarine, Coastal and Shelf Science, 74(4), 709-721.
- TRACMASS on GitHub: https://github.com/TRACMASS