- Forked from: https://github.com/sam-cox/pytides
- This fork: https://github.com/drf5n/pytides/ to work with python3
- Recommended fork: https://github.com/groutr/pytides -- groutr is doing more current development
- pytides2 fork: https://github.com/sahitono/pytides -- modernized build system and typing
-- drf5n 2023-09-02
Pytides is small Python package for the analysis and prediction of tides. Pytides can be used to extrapolate the tidal behaviour at a given location from its previous behaviour. The method used is that of harmonic constituents, in particular as presented by P. Schureman in Special Publication 98. The fitting of amplitudes and phases is handled by Scipy's leastsq minimisation function. Pytides currently supports the constituents used by NOAA, with plans to add more constituent sets. It is therefore possible to use the amplitudes and phases published by NOAA directly, without the need to perform the analysis again (although there may be slight discrepancies for some constituents).
It is recommended that all interactions with pytides which require times to be specified are in the format of naive UTC datetime instances. In particular, note that pytides makes no adjustment for summertime or any other civil variations within timezones.
- Numpy
- Scipy
easy_install pytides
or
pip install pytides
should install the 2014/0.0.4 version from from https://pypi.org/project/pytides/
If you want to install from a local copy of a github repository, change to the directory and try:
pip install .
If you want to install from a particular github fork, try something like
pip install git+https://github.com/drf5n/pytides.git
or a particular release of a fork of pytides:
pip install https://github.com/drf5n/pytides/archive/refs/tags/v0.0.7.zip
Mainly for my own reference (sanity), to get pytides and its dependencies all working in a Debian (mint) virtualenv:
sudo apt-get install liblapack-dev libatlas-base-dev gfortran
export LAPACK=/usr/lib/liblapack.so
export ATLAS=/usr/lib/libatlas.so
export BLAS=/usr/lib/libblas.so
pip install numpy
pip install scipy
pip install pytides
and you'll probably want to
pip install matplotlib
although this won't install all the backends for matplotlib, which is a headache for another day (this looks promising).
Pytides is in its infancy, and hasn't yet been fully documented. The best way to get started would be to read this example. After that, you might try making your own tide table, where you can also find a method for handling timezones. You can find information about using NOAA published Harmonic Constituents directly here.
If you want to know how Pytides works, it would be best to read P. Schureman, Special Publication 98. Alternatively, there is my attempt to explain it on the wiki (although it's a little mathematical and not yet complete). It is certainly possible to use Pytides successfully without any knowledge of its methods.
I would welcome any help with Pytides. Particularly if you have knowledge of constituent data (including node factors) which other institutions/packages use. I can be reached at [email protected] or via github.
Please note however that Pytide's lack of attempts to infer constituents, or exclude similar constituents based on their synodic periods is an intentional design decision.