├── .gitignore ├── MANIFEST.in ├── README.md ├── pawlowicz.changelog ├── setup.py ├── todo └── ttide ├── __init__.py ├── base.py ├── data ├── t_constituents_const.nc ├── t_constituents_sat.nc └── t_constituents_shallow.nc ├── t_18constituents_const.csv ├── t_18constituents_sat.csv ├── t_18constituents_shallow.csv ├── t_astron.py ├── t_getconsts.py ├── t_predic.py ├── t_tide.py ├── t_utils.py ├── t_vuf.py ├── tests ├── __init__.py ├── base.py ├── data │ ├── predict │ │ ├── 5constit.elev │ │ ├── 5constit.vel │ │ ├── M2-Stime.shallowM10 │ │ ├── M2.shallowM10 │ │ ├── M2only-Stime-lat.elev │ │ ├── M2only-Stime-lat.vel │ │ ├── M2only-Stime.elev │ │ ├── M2only-Stime.vel │ │ ├── M2only.elev │ │ ├── M2only.vel │ │ ├── NoArgs.elev │ │ ├── NoArgs.vel │ │ ├── NoOutput.elev │ │ ├── NoOutput.vel │ │ ├── PandasOut.elev │ │ └── PandasOut.vel │ └── print │ │ ├── 5constit.elev │ │ ├── 5constit.vel │ │ ├── M2-Stime.shallowM10 │ │ ├── M2.shallowM10 │ │ ├── M2only-Stime-lat.elev │ │ ├── M2only-Stime-lat.vel │ │ ├── M2only-Stime.elev │ │ ├── M2only-Stime.vel │ │ ├── M2only.elev │ │ ├── M2only.vel │ │ ├── NoArgs.elev │ │ ├── NoArgs.vel │ │ ├── NoOutput.elev │ │ ├── NoOutput.vel │ │ ├── PandasOut.elev │ │ └── PandasOut.vel ├── predict_tests.py └── print_tests.py └── time.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | bin/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | eggs/ 16 | lib/ 17 | lib64/ 18 | parts/ 19 | sdist/ 20 | var/ 21 | *.egg-info/ 22 | .installed.cfg 23 | *.egg 24 | 25 | # Installer logs 26 | pip-log.txt 27 | pip-delete-this-directory.txt 28 | 29 | # Unit test / coverage reports 30 | htmlcov/ 31 | .tox/ 32 | .coverage 33 | .cache 34 | nosetests.xml 35 | coverage.xml 36 | 37 | # Translations 38 | *.mo 39 | 40 | # Mr Developer 41 | .mr.developer.cfg 42 | .project 43 | .pydevproject 44 | 45 | # Rope 46 | .ropeproject 47 | 48 | # Django stuff: 49 | *.log 50 | *.pot 51 | 52 | # Sphinx documentation 53 | docs/_build/ 54 | 55 | # Emacs temporary files 56 | .#* 57 | \#*# 58 | 59 | # Ignore flymake files 60 | *flymake.py 61 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.md 2 | 3 | recursive-include ttide *.py 4 | recursive-include ttide *.csv 5 | recursive-include ttide/data *.npy 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ttide_py 2 | ======== 3 | 4 | A direct conversion of T_Tide to Python. 5 | 6 | This is a work in progress. It is not done. 7 | 8 | It is now mostly functional. 9 | Any help with finishing the conversion is welcome. 10 | 11 | Credit for T\_Tide goes to Rich Pawlowicz, the original creator of T\_Tide. 12 | It is available at https://www.eoas.ubc.ca/~rich/. 13 | 14 | A description of the theoretical basis of the analysis and some 15 | implementation details of the Matlab version can be found in: 16 | 17 | > Pawlowicz, R., B. Beardsley, and S. Lentz, "Classical Tidal 18 | "Harmonic Analysis Including Error Estimates in MATLAB 19 | using T_TIDE", Computers and Geosciences, 28, 929-937 (2002). 20 | 21 | Citation of this article would be appreciated if you find the toolbox 22 | useful (either the Matlab version, or this Python one). 23 | 24 | 25 | 26 | Installation 27 | ============ 28 | 29 | This has little to no testing. Use at your own risk. To install, run: 30 | 31 | python setup.py install 32 | 33 | 34 | Example Usage 35 | ============= 36 | 37 | Imports and define some variables: 38 | 39 | import ttide as tt 40 | import numpy as np 41 | 42 | t = np.arange(1001) 43 | m2_freq = 2 * np.pi / 12.42 44 | 45 | Here is an example 'real' (scalar) dataset: 46 | 47 | elev = 5 * np.cos(m2_freq * t) 48 | 49 | Compute the tidal fit: 50 | 51 | tfit_e = tt.t_tide(elev) 52 | 53 | All other input is optional. Currently `dt`, `stime`, `lat`, `constitnames`, `output`, `errcalc`, `synth`, `out_style`, and `secular` can be specified. Take a look at the t\_tide docstring for more info on these variables. 54 | 55 | `tfit_e` is an instance of the TTideCon ("TTide Constituents") class. It includes a `t_predic` method that is also availabe as the special `__call__` method. This makes it possible to construct the fitted time-series by simply doing: 56 | 57 | elev_fit = tfit_e(t) 58 | 59 | Or extrapolate the fit to other times: 60 | 61 | extrap_fit = tfit_e(np.arange(2000,2500)) 62 | 63 | And here is an example 'complex' (vector) dataset: 64 | 65 | vel = 0.8 * elev + 1j * 2 * np.sin(m2_freq * t) 66 | 67 | tfit_v = tt.t_tide(vel) 68 | 69 | And so on... 70 | 71 | Notes 72 | ===== 73 | 74 | 1. The code to handle timeseries longer then 18.6 years has not been converted yet. 75 | 76 | 2. The code is a little messy and they are a few hacky bits that probably will need to be fixed. The most notable is in noise_realizations. It swaps eig vectors around to match Matlab's output. 77 | Also, the returned diagonal array would sometimes be a negative on the order of 10^-10. Values between (-0.00000000001,0) are forced to 0. 78 | 79 | 3. ttide_py was initially converted to python with SMOP. Available at, https://github.com/victorlei/smop.git. 80 | -------------------------------------------------------------------------------- /pawlowicz.changelog: -------------------------------------------------------------------------------- 1 | All entries are from the t_tide function, unless otherwise indicated. 2 | 3 | 11/8/99 - Completely rewritten from the transliqterated- 4 | to-matlab IOS/Foreman fortran code by S. Lentz 5 | and B. Beardsley. 6 | 3/3/00 - Redid errors to take into account covariances 7 | between u and v errors. 8 | 1/5/00 - t_vuf: Changed to allow for no LAT setting. 9 | 7/21/00 - Found that annoying bug in error calc! 10 | 11/1/00 - Added linear error analysis. 11 | 11/8/00 - t_vuf: Added the LAT=NaN option. 12 | 8/29/01 - Made synth=1 default, also changed behavior 13 | when no lat/time given so that phases are raw 14 | at central time. 15 | 9/1/01 - Moved some SNR code to t_predic. 16 | 9/28/01 - made sure you can't choose Z0 as constituent. 17 | 6/12/01 - better explanation for variance calcs, fixed 18 | bug in typed output (thanks Mike Cook). 19 | 8/2/03 - Added block processing for long time series (thanks 20 | to Derek Goring). 21 | 8/2/03 - t_predic: Added block processing to generate prediction (to 22 | avoid memory overflows for long time series). 23 | 9/2/03 - Beta version of 18.6 year series handling 24 | 10/02/03 - t_vuf: Suport for 18-year (full) constituent set. 25 | 12/2/03 - Bug (x should be xin) fixed thanks to Mike Cook (again!) 26 | 29/9/04 - t_predic: small bug with undefined ltype fixed 27 | 4/3/11 - Changed (old) psd to (new) pwelch calls, also 28 | isfinite for finite. 29 | 23/3/11 - Corrected my conversion from psd to pwelch, thanks 30 | to Dan Codiga and (especially) Evan Haug! 31 | 32 | Version 1.3 33 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | 4 | def readme(): 5 | with open('README.md') as f: 6 | return f.read() 7 | 8 | setup(name='ttide', 9 | version='0.3dev1', 10 | description='Python distribution of the MatLab package TTide.', 11 | long_description=readme(), 12 | url='https://github.com/moflaher/ttide_py', 13 | author='Mitchell O\'Flaherty-Sproul', 14 | author_email='073208o@acadiau.ca', 15 | license='MIT', 16 | packages=['ttide'], 17 | package_data={'ttide': ['data/*.nc']}, 18 | zip_safe=False) 19 | -------------------------------------------------------------------------------- /todo: -------------------------------------------------------------------------------- 1 | * Add functionality to specify the Rayleigh criteria as a list of 2 | strings. The docstring should be updated. 3 | * Clarify what infiname and infirefname are in the docstring. 4 | * tests should compare results to known values (i.e. from Matlab version) 5 | * Are 'names' required in t_predic? Why not use 'names' or 'freq'? 6 | * Add tests for datetime64 and datetime inputs. 7 | * TTideCon needs a save method (and a load function somewhere). Or do we just pickle it? JSON? 8 | -------------------------------------------------------------------------------- /ttide/__init__.py: -------------------------------------------------------------------------------- 1 | """This package now holds the ttide_py API. 2 | 3 | The included functions are: 4 | 5 | t_tide : The t_tide harmonic analysis function. 6 | 7 | t_predic : The t_tide harmonic fit function. 8 | 9 | TTideCon : The t_tide constituents class (returned by t_tide). 10 | 11 | """ 12 | from .t_tide import t_tide 13 | from .t_predic import t_predic 14 | from ttide.base import TTideCon 15 | 16 | __version__ = '0.3lfk' 17 | -------------------------------------------------------------------------------- /ttide/base.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import io 3 | from . import t_utils as tu 4 | from .t_predic import t_predic 5 | 6 | # file object depending on Python version 7 | if sys.version_info[0] < 3: 8 | FILE_OBJ = file # Python 2 9 | else: 10 | FILE_OBJ = io.IOBase # Python 3 11 | 12 | 13 | class TTideCon(dict): 14 | """The ttide consituents class. 15 | 16 | This class is based on a dictionary, and has key-value pairs of 17 | the relavent data from the tidal fit, and for tidal prediction 18 | (extrapolation). These include: 19 | 20 | dt : The sampling interval of the fit data. 21 | 22 | nameu : The names of the tidal constituents. 23 | 24 | fu : The frequencies of the tidal constituents. 25 | 26 | tidecon : The tidal constituent amplitudes. 27 | 28 | snr : The signal to noise ratio of the constituent fits. 29 | 30 | """ 31 | 32 | def t_predic(self, time): 33 | return t_predic(time, 34 | names=self['nameu'], freq=self['fu'], 35 | tidecon=self['tidecon'], lat=self['lat'], 36 | ltype=self['ltype'], synth=self['synth']) 37 | 38 | __call__ = t_predic 39 | 40 | def pandas_style(self, to_file=None, to_file_df=None): 41 | if to_file_df is None: 42 | outstr = tu.pandas_style(self) 43 | else: 44 | outstr, df = tu.pandas_style(self, True) 45 | df.to_csv(to_file_df) 46 | 47 | if to_file is None: 48 | return outstr 49 | elif isinstance(to_file, FILE_OBJ): 50 | to_file.write(outstr) 51 | else: 52 | with open(to_file, 'w') as fl: 53 | fl.write(outstr) 54 | 55 | def classic_style(self, to_file=None): 56 | outstr = tu.classic_style(self) 57 | if to_file is None: 58 | return outstr 59 | elif isinstance(to_file, FILE_OBJ): 60 | to_file.write(outstr) 61 | else: 62 | with open(to_file, 'w') as fl: 63 | fl.write(outstr) 64 | -------------------------------------------------------------------------------- /ttide/data/t_constituents_const.nc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moflaher/ttide_py/60b10119e0d984aa2502d4075fd5267ec703491e/ttide/data/t_constituents_const.nc -------------------------------------------------------------------------------- /ttide/data/t_constituents_sat.nc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moflaher/ttide_py/60b10119e0d984aa2502d4075fd5267ec703491e/ttide/data/t_constituents_sat.nc -------------------------------------------------------------------------------- /ttide/data/t_constituents_shallow.nc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moflaher/ttide_py/60b10119e0d984aa2502d4075fd5267ec703491e/ttide/data/t_constituents_shallow.nc -------------------------------------------------------------------------------- /ttide/t_18constituents_const.csv: -------------------------------------------------------------------------------- 1 | "name","freq","doodson",,,,,,"semi","doodsonamp","doodsonspecies", 2 | "Z0 ",0,0,0,0,0,0,0,0,NaN,NaN, 3 | "SA ",0.00011407,0,0,1,0,0,-1,0,0.0116,0, 4 | "SSA ",0.00022816,0,0,2,0,0,0,0,0.07299,0, 5 | "MSM ",0.0013098,0,1,-2,1,0,0,0,NaN,NaN, 6 | "MM ",0.0015122,0,1,0,-1,0,0,0,0.08254,0, 7 | "MSF ",0.0028219,0,2,-2,0,0,0,0,0.01376,0, 8 | "MF ",0.0030501,0,2,0,0,0,0,0,0.15642,0, 9 | "A233",0.034384,1,-4,2,0,0,0,0.5,0.00010008,1, 10 | "A323",0.03439,1,-4,2,1,-1,0,-0.25,0.00052987,-1, 11 | "ALP1",0.034397,1,-4,2,1,0,0,-0.25,0.00278,-1, 12 | "2113",0.035668,1,-3,0,0,-2,0,0.25,6.0165e-05,-1, 13 | "2223",0.035687,1,-3,0,1,-1,0,0.5,0.00023015,1, 14 | "2233",0.035693,1,-3,0,1,0,0,0.5,0.00057968,1, 15 | "2313",0.035694,1,-3,0,2,-2,0,0.25,6.0165e-05,-1, 16 | "2323",0.0357,1,-3,0,2,-1,0,-0.25,0.0018002,-1, 17 | "2Q1 ",0.035706,1,-3,0,2,0,0,-0.25,0.00955,-1, 18 | "S233",0.035896,1,-3,2,-1,0,0,0.5,0.00010954,1, 19 | "S313",0.035896,1,-3,2,0,-2,0,0.25,7.0333e-05,-1, 20 | "S323",0.035903,1,-3,2,0,-1,0,-0.25,0.0021723,-1, 21 | "SIG1",0.035909,1,-3,2,0,0,0,-0.25,0.01153,-1, 22 | "S533",0.035935,1,-3,2,2,0,0,0.25,0.00010031,-1, 23 | "Q103",0.037174,1,-2,0,-1,-3,0,0.25,5.0512e-05,-1, 24 | "Q113",0.03718,1,-2,0,-1,-2,0,0.25,0.00028142,-1, 25 | "Q213",0.037193,1,-2,0,0,-2,0,0.5,7.216e-05,1, 26 | "Q223",0.037199,1,-2,0,0,-1,0,0.5,0.00082984,1, 27 | "Q233",0.037206,1,-2,0,0,0,0,0.5,0.0021071,1, 28 | "Q234",0.037206,1,-2,0,0,0,1,-0.25,5.7728e-05,-1, 29 | "Q313",0.037206,1,-2,0,1,-2,0,0.25,0.00041131,-1, 30 | "Q323",0.037212,1,-2,0,1,-1,0,-0.25,0.013595,-1, 31 | "Q1 ",0.037219,1,-2,0,1,0,0,-0.25,0.07216,-1, 32 | "Q433",0.037231,1,-2,0,2,0,0,0.5,0.00012989,1, 33 | "Q533",0.037244,1,-2,0,3,0,0,0.25,0.00020205,-1, 34 | "R313",0.037409,1,-2,2,-1,-2,0,0.25,7.9518e-05,-1, 35 | "R323",0.037415,1,-2,2,-1,-1,0,-0.25,0.0025802,-1, 36 | "RHO1",0.037421,1,-2,2,-1,0,0,-0.25,0.01371,-1, 37 | "R433",0.037434,1,-2,2,0,0,0,0.5,0.0001796,1, 38 | "R533",0.037447,1,-2,2,1,0,0,0.25,0.0007897,-1, 39 | "R543",0.037453,1,-2,2,1,1,0,-0.25,0.00023993,-1, 40 | "O233",0.038718,1,-1,0,-1,0,0,0,0.00011307,1, 41 | "O313",0.038718,1,-1,0,0,-2,0,0.25,0.002186,-1, 42 | "O323",0.038725,1,-1,0,0,-1,0,-0.25,0.071044,-1, 43 | "O1 ",0.038731,1,-1,0,0,0,0,-0.25,0.37689,-1, 44 | "O423",0.038737,1,-1,0,1,-1,0,0,0.00015076,1, 45 | "O433",0.038744,1,-1,0,1,0,0,0.5,0.001093,1, 46 | "O443",0.03875,1,-1,0,1,1,0,0,0.00015076,1, 47 | "O533",0.038756,1,-1,0,2,0,0,0.25,0.0024121,-1, 48 | "O543",0.038763,1,-1,0,2,1,0,0.25,0.00037689,-1, 49 | "T133",0.038933,1,-1,2,-2,0,0,-0.75,-0.00021899,-1, 50 | "T233",0.038946,1,-1,2,-1,0,0,-0.5,-0.00020917,1, 51 | "T323",0.038953,1,-1,2,0,-1,0,-0.25,-0.00013944,-1, 52 | "TAU1",0.038959,1,-1,2,0,0,0,-0.75,-0.00491,-1, 53 | "T343",0.038965,1,-1,2,0,1,0,-0.25,-0.0010655,-1, 54 | "T353",0.038971,1,-1,2,0,2,0,-0.25,-6.9722e-05,-1, 55 | "B323",0.040034,1,0,-2,1,-1,0,-0.75,-0.00062995,-1, 56 | "BET1",0.04004,1,0,-2,1,0,0,-0.75,-0.00278,-1, 57 | "N113",0.040231,1,0,0,-1,-2,0,-0.25,-0.00016895,-1, 58 | "N123",0.040237,1,0,0,-1,-1,0,-0.75,-0.0019711,-1, 59 | "N133",0.040243,1,0,0,-1,0,0,-0.75,-0.010659,-1, 60 | "N223",0.04025,1,0,0,0,-1,0,0,-0.00098108,1, 61 | "N233",0.040256,1,0,0,0,0,0,-0.5,-0.0066008,1, 62 | "N243",0.040262,1,0,0,0,1,0,0,-0.00085956,1, 63 | "N323",0.040262,1,0,0,1,-1,0,-0.25,-0.00085956,-1, 64 | "NO1 ",0.040269,1,0,0,1,0,0,-0.75,-0.02964,-1, 65 | "N343",0.040275,1,0,0,1,1,0,-0.75,-0.0059399,-1, 66 | "N353",0.040281,1,0,0,1,2,0,-0.25,-0.00016006,-1, 67 | "C323",0.040465,1,0,2,-1,-1,0,-0.25,-0.00015961,-1, 68 | "CHI1",0.040471,1,0,2,-1,0,0,-0.75,-0.00566,-1, 69 | "C343",0.040477,1,0,2,-1,1,0,-0.75,-0.0012378,-1, 70 | "P323",0.041432,1,1,-3,0,-1,1,0.25,8.0262e-05,-1, 71 | "PI1 ",0.041439,1,1,-3,0,0,1,-0.25,0.01029,-1, 72 | "P313",0.04154,1,1,-2,0,-2,0,-0.25,0.00014067,-1, 73 | "P323",0.041546,1,1,-2,0,-1,0,0.25,0.0019694,-1, 74 | "P1 ",0.041553,1,1,-2,0,0,0,-0.25,0.17584,-1, 75 | "P335",0.041553,1,1,-2,0,0,2,0.25,7.0336e-05,-1, 76 | "P433",0.041565,1,1,-2,1,0,0,0.5,7.0336e-05,1, 77 | "P533",0.041578,1,1,-2,2,0,0,0.25,0.00026376,-1, 78 | "P543",0.041585,1,1,-2,2,1,0,0.25,5.2752e-05,-1, 79 | "S331",0.041667,1,1,-1,0,0,-1,-0.75,-0.0014949,-1, 80 | "S1 ",0.041667,1,1,-1,0,0,1,-0.75,-0.00423,-1, 81 | "S343",0.041673,1,1,-1,0,1,1,-0.25,-0.00011167,-1, 82 | "K123",0.041749,1,1,0,-2,-1,0,-0.75,-0.0001061,-1, 83 | "K223",0.041762,1,1,0,-1,-1,0,0,-5.305e-05,1, 84 | "K233",0.041768,1,1,0,-1,0,0,-0.5,-0.00037135,1, 85 | "K313",0.041768,1,1,0,0,-2,0,-0.75,-5.305e-05,-1, 86 | "K243",0.041774,1,1,0,-1,1,0,0,-5.305e-05,1, 87 | "K323",0.041775,1,1,0,0,-1,0,-0.25,-0.010504,-1, 88 | "K1 ",0.041781,1,1,0,0,0,0,-0.75,-0.5305,-1, 89 | "K343",0.041787,1,1,0,0,1,0,-0.75,-0.071936,-1, 90 | "K353",0.041793,1,1,0,0,2,0,-0.25,-0.0015384,-1, 91 | "K433",0.041794,1,1,0,1,0,0,-0.5,-0.0001061,1, 92 | "K443",0.0418,1,1,0,1,1,0,-0.5,-5.305e-05,1, 93 | "PSI1",0.041895,1,1,1,0,0,-1,-0.75,-0.00423,-1, 94 | "P343",0.041901,1,1,1,0,1,-1,-0.75,-8.037e-05,-1, 95 | "P133",0.041983,1,1,2,-2,0,0,-0.75,-0.00026006,-1, 96 | "P143",0.041989,1,1,2,-2,1,0,-0.75,-8.0136e-05,-1, 97 | "P331",0.042009,1,1,2,0,0,-2,-0.75,-9.9792e-05,-1, 98 | "PHI1",0.042009,1,1,2,0,0,0,-0.75,-0.00756,-1, 99 | "P343",0.042015,1,1,2,0,1,0,-0.25,-0.0002903,-1, 100 | "P353",0.042021,1,1,2,0,2,0,-0.25,-0.00013986,-1, 101 | "T123",0.043059,1,2,-2,-1,-1,0,-0.75,-0.0001698,-1, 102 | "T233",0.043078,1,2,-2,0,0,0,-0.5,-7.9806e-05,1, 103 | "T323",0.043084,1,2,-2,1,-1,0,-0.25,-0.00017942,-1, 104 | "THE1",0.043091,1,2,-2,1,0,0,-0.75,-0.00566,-1, 105 | "T343",0.043097,1,2,-2,1,1,0,-0.75,-0.001128,-1, 106 | "J323",0.043287,1,2,0,-1,-1,0,-0.25,-0.00087142,-1, 107 | "J1 ",0.043293,1,2,0,-1,0,0,-0.75,-0.02964,-1, 108 | "J343",0.043299,1,2,0,-1,1,0,-0.75,-0.0058687,-1, 109 | "J423",0.0433,1,2,0,0,-1,0,0,-8.0028e-05,1, 110 | "J353",0.043305,1,2,0,-1,2,0,-0.25,-0.00013931,-1, 111 | "J433",0.043306,1,2,0,0,0,0,-0.5,-0.0024186,1, 112 | "J443",0.043312,1,2,0,0,1,0,-0.5,-0.00098108,1, 113 | "J453",0.043318,1,2,0,0,2,0,-0.5,-8.0028e-05,1, 114 | "J533",0.043319,1,2,0,1,0,0,-0.25,-0.00045053,-1, 115 | "J543",0.043325,1,2,0,1,1,0,-0.25,-0.00029047,-1, 116 | "J553",0.043331,1,2,0,1,2,0,-0.25,-0.00016895,-1, 117 | "O123",0.044799,1,3,0,-2,-1,0,-0.25,-6.0051e-05,-1, 118 | "O133",0.044805,1,3,0,-2,0,0,-0.75,-0.002428,-1, 119 | "O143",0.044811,1,3,0,-2,1,0,-0.75,-0.00048041,-1, 120 | "O233",0.044818,1,3,0,-1,0,0,-0.5,-0.00038952,1, 121 | "O243",0.044824,1,3,0,-1,1,0,-0.5,-0.00016068,1, 122 | "OO1 ",0.044831,1,3,0,0,0,0,-0.75,-0.01623,-1, 123 | "O343",0.044837,1,3,0,0,1,0,-0.75,-0.010384,-1, 124 | "O353",0.044843,1,3,0,0,2,0,-0.75,-0.0021781,-1, 125 | "O363",0.044849,1,3,0,0,3,0,-0.75,-0.00013958,-1, 126 | "U133",0.046317,1,4,0,-3,0,0,-0.75,-0.00019002,-1, 127 | "UPS1",0.046343,1,4,0,-1,0,0,-0.75,-0.00311,-1, 128 | "U343",0.046349,1,4,0,-1,1,0,-0.75,-0.0019901,-1, 129 | "U353",0.046355,1,4,0,-1,2,0,-0.75,-0.0004099,-1, 130 | "U433",0.046356,1,4,0,0,0,0,-0.5,-8.9879e-05,1, 131 | "U443",0.046362,1,4,0,0,1,0,-0.5,-7.9927e-05,1, 132 | "O233",0.075962,2,-3,0,2,0,0,0.25,0.00026988,-2, 133 | "O323",0.075969,2,-3,0,3,-1,0,0.5,9.9974e-05,2, 134 | "OQ2 ",0.075975,2,-3,0,3,0,0,0,0.00259,2, 135 | "E223",0.076158,2,-3,2,0,-1,0,0.25,5.0325e-05,-2, 136 | "E233",0.076164,2,-3,2,0,0,0,0.25,0.00026974,-2, 137 | "E323",0.076171,2,-3,2,1,-1,0,0.5,0.00025028,2, 138 | "EPS2",0.076177,2,-3,2,1,0,0,0,0.00671,2, 139 | "2113",0.077449,2,-2,0,0,-2,0,0.5,0.00014036,2, 140 | "2223",0.077468,2,-2,0,1,-1,0,0.25,0.00026922,-2, 141 | "2233",0.077474,2,-2,0,1,0,0,0.25,0.0015601,-2, 142 | "2323",0.077481,2,-2,0,2,-1,0,0.5,0.00086057,2, 143 | "2N2 ",0.077487,2,-2,0,2,0,0,0,0.02301,2, 144 | "M223",0.07767,2,-2,2,-1,-1,0,0.25,4.9986e-05,-2, 145 | "M233",0.077677,2,-2,2,-1,0,0,0.25,0.00028881,-2, 146 | "M323",0.077683,2,-2,2,0,-1,0,0.5,0.0010414,2, 147 | "MU2 ",0.077689,2,-2,2,0,0,0,0,0.02777,2, 148 | "N113",0.078961,2,-1,0,-1,-2,0,0.5,0.00067809,2, 149 | "N234",0.078986,2,-1,0,0,0,1,0,0.0001391,2, 150 | "N313",0.078987,2,-1,0,1,-2,0,0,8.6935e-05,2, 151 | "N323",0.078993,2,-1,0,1,-1,0,0.5,0.0064854,2, 152 | "N2 ",0.078999,2,-1,0,1,0,0,0,0.17387,2, 153 | "N323",0.079195,2,-1,2,-1,-1,0,0.5,0.001232,2, 154 | "NU2 ",0.079202,2,-1,2,-1,0,0,0,0.03303,2, 155 | "N433",0.079215,2,-1,2,0,0,0,0.75,0.00013873,-2, 156 | "N533",0.079227,2,-1,2,1,0,0,0,0.00013873,2, 157 | "N543",0.079234,2,-1,2,1,1,0,0.5,0.00011891,2, 158 | "G113",0.080271,2,0,-2,0,-2,0,-0.5,-0.00039012,2, 159 | "G233",0.080296,2,0,-2,1,0,0,-0.25,-7.9989e-05,-2, 160 | "G323",0.080303,2,0,-2,2,-1,0,0,-9.009e-05,2, 161 | "GAM2",0.080309,2,0,-2,2,0,0,-0.5,-0.00273,2, 162 | "H323",0.080391,2,0,-1,0,-1,1,0,-7.0336e-05,2, 163 | "H1 ",0.080397,2,0,-1,0,0,1,-0.5,-0.00314,2, 164 | "H432",0.08041,2,0,-1,1,0,0,0,-0.00014036,2, 165 | "M223",0.080492,2,0,0,-1,-1,0,0.75,9.0812e-05,-2, 166 | "M233",0.080499,2,0,0,-1,0,0,0.75,0.00036325,-2, 167 | "M313",0.080499,2,0,0,0,-2,0,0,0.00045406,2, 168 | "M323",0.080505,2,0,0,0,-1,0,0.5,0.033873,2, 169 | "M2 ",0.080511,2,0,0,0,0,0,0,0.90812,2, 170 | "M423",0.080518,2,0,0,1,-1,0,0.25,9.0812e-05,-2, 171 | "M433",0.080524,2,0,0,1,0,0,0.75,0.00081731,-2, 172 | "M443",0.08053,2,0,0,1,1,0,0.75,0.00018162,-2, 173 | "M533",0.080537,2,0,0,2,0,0,0,0.00054487,2, 174 | "M543",0.080543,2,0,0,2,1,0,0,0.00018162,2, 175 | "H323",0.080619,2,0,1,0,-1,-1,0.5,5.9892e-05,2, 176 | "H2 ",0.080625,2,0,1,0,0,-1,0,0.00276,2, 177 | "L323",0.081815,2,1,-2,1,-1,0,0,-0.00030016,2, 178 | "LDA2",0.081821,2,1,-2,1,0,0,-0.5,-0.0067,2, 179 | "L323",0.082017,2,1,0,-1,-1,0,0,-0.00093952,2, 180 | "L2 ",0.082024,2,1,0,-1,0,0,-0.5,-0.02567,2, 181 | "L523",0.082043,2,1,0,1,-1,0,-0.5,-0.00012065,2, 182 | "L533",0.082049,2,1,0,1,0,0,0,-0.0064303,2, 183 | "L543",0.082055,2,1,0,1,1,0,0,-0.0028288,2, 184 | "L553",0.082062,2,1,0,1,2,0,0,-0.00040045,2, 185 | "T2 ",0.083219,2,2,-3,0,0,1,0,0.02479,2, 186 | "S323",0.083327,2,2,-2,0,-1,0,0,0.00093188,2, 187 | "S2 ",0.083333,2,2,-2,0,0,0,0,0.42358,2, 188 | "S433",0.083346,2,2,-2,1,0,0,0.75,4.2358e-05,-2, 189 | "S533",0.083359,2,2,-2,2,0,0,0,4.2358e-05,2, 190 | "R2 ",0.083447,2,2,-1,0,0,-1,-0.5,-0.00354,2, 191 | "R335",0.083447,2,2,-1,0,0,1,0,-0.00089739,2, 192 | "R345",0.083454,2,2,-1,0,1,1,-0.5,-4.9914e-05,2, 193 | "K233",0.083549,2,2,0,-1,0,0,0.75,0.00027614,-2, 194 | "K243",0.083555,2,2,0,-1,1,0,0.75,4.6024e-05,-2, 195 | "K323",0.083555,2,2,0,0,-1,0,0.5,0.0014728,2, 196 | "K2 ",0.083561,2,2,0,0,0,0,0,0.11506,2, 197 | "K343",0.083568,2,2,0,0,1,0,0,0.034288,2, 198 | "K353",0.083574,2,2,0,0,2,0,0,0.0037279,2, 199 | "E323",0.085068,2,3,0,-1,-1,0,0.5,0.00012024,2, 200 | "ETA2",0.085074,2,3,0,-1,0,0,0,0.00643,2, 201 | "E343",0.08508,2,3,0,-1,1,0,0,0.0028003,2, 202 | "E353",0.085086,2,3,0,-1,2,0,0,0.00030028,2, 203 | "E433",0.085087,2,3,0,0,0,0,0.75,0.00048032,-2, 204 | "E443",0.085093,2,3,0,0,1,0,0.75,0.00030993,-2, 205 | "E453",0.085099,2,3,0,0,2,0,0.75,5.9799e-05,-2, 206 | "E533",0.085099,2,3,0,1,0,0,0.5,5.0154e-05,2, 207 | "M323",0.12076,3,0,0,0,-1,0,0,-0.00067003,3, 208 | "M3 ",0.12077,3,0,0,0,0,0,-0.5,-0.01188,3, 209 | 210 | -------------------------------------------------------------------------------- /ttide/t_18constituents_sat.csv: -------------------------------------------------------------------------------- 1 | "deldood",,,"phcorr","amprat","ilatfac","iconst", 2 | 3 | -------------------------------------------------------------------------------- /ttide/t_18constituents_shallow.csv: -------------------------------------------------------------------------------- 1 | "iconst","coef","iname", 2 | 26,2,19, 3 | 26,-1,13, 4 | 27,1,57, 5 | 27,-1,13, 6 | 30,2,48, 7 | 30,1,42, 8 | 30,-2,57, 9 | 31,2,42, 10 | 31,-1,57, 11 | 32,3,48, 12 | 32,-2,57, 13 | 33,2,42, 14 | 33,1,59, 15 | 33,-2,57, 16 | 36,1,48, 17 | 36,1,42, 18 | 36,1,59, 19 | 36,-2,57, 20 | 37,2,48, 21 | 37,1,57, 22 | 37,-2,59, 23 | 38,2,13, 24 | 44,2,59, 25 | 44,1,42, 26 | 44,-2,57, 27 | 41,1,57, 28 | 41,1,42, 29 | 41,-1,59, 30 | 45,1,13, 31 | 45,1,19, 32 | 50,1,48, 33 | 50,1,59, 34 | 50,-1,57, 35 | 51,1,48, 36 | 51,2,59, 37 | 51,-2,57, 38 | 52,2,57, 39 | 52,1,42, 40 | 52,-1,48, 41 | 52,-1,59, 42 | 55,2,57, 43 | 55,-1,59, 44 | 60,1,48, 45 | 60,1,57, 46 | 60,-1,42, 47 | 62,2,59, 48 | 62,1,48, 49 | 62,-1,57, 50 | 62,-1,42, 51 | 63,2,57, 52 | 63,-1,48, 53 | 64,2,48, 54 | 64,1,57, 55 | 64,-2,42, 56 | 65,1,57, 57 | 65,1,59, 58 | 65,-1,48, 59 | 66,2,57, 60 | 66,-1,42, 61 | 67,1,42, 62 | 67,1,13, 63 | 68,1,48, 64 | 68,1,13, 65 | 70,1,42, 66 | 70,1,21, 67 | 71,1,57, 68 | 71,1,13, 69 | 72,1,48, 70 | 72,1,21, 71 | 73,1,57, 72 | 73,1,19, 73 | 74,1,57, 74 | 74,1,21, 75 | 75,2,48, 76 | 75,1,42, 77 | 75,-1,57, 78 | 76,2,42, 79 | 77,3,48, 80 | 77,-1,57, 81 | 78,1,48, 82 | 78,1,57, 83 | 78,1,42, 84 | 78,-1,59, 85 | 79,1,48, 86 | 79,1,42, 87 | 81,2,48, 88 | 81,1,57, 89 | 81,-1,59, 90 | 80,1,48, 91 | 80,1,42, 92 | 80,1,59, 93 | 80,-1,57, 94 | 82,2,48, 95 | 83,2,48, 96 | 83,1,59, 97 | 83,-1,57, 98 | 84,1,57, 99 | 84,1,42, 100 | 85,1,59, 101 | 85,1,42, 102 | 86,1,48, 103 | 86,1,57, 104 | 87,1,48, 105 | 87,1,59, 106 | 88,1,57, 107 | 88,1,54, 108 | 89,2,57, 109 | 90,1,57, 110 | 90,1,59, 111 | 91,1,48, 112 | 91,1,42, 113 | 91,1,13, 114 | 92,2,48, 115 | 92,1,13, 116 | 93,3,48, 117 | 93,-1,19, 118 | 94,1,48, 119 | 94,1,42, 120 | 94,1,21, 121 | 95,2,48, 122 | 95,1,19, 123 | 96,2,48, 124 | 96,1,21, 125 | 97,1,48, 126 | 97,1,57, 127 | 97,1,21, 128 | 98,1,59, 129 | 98,1,21, 130 | 98,1,48, 131 | 99,2,57, 132 | 99,1,21, 133 | 100,3,42, 134 | 100,1,59, 135 | 100,-1,57, 136 | 101,2,42, 137 | 101,1,48, 138 | 102,2,42, 139 | 102,1,48, 140 | 102,1,59, 141 | 102,-1,57, 142 | 105,3,48, 143 | 105,1,57, 144 | 105,-1,59, 145 | 103,2,48, 146 | 103,1,42, 147 | 104,2,48, 148 | 104,1,42, 149 | 104,1,59, 150 | 104,-1,57, 151 | 106,3,48, 152 | 107,1,48, 153 | 107,1,57, 154 | 107,1,42, 155 | 108,1,48, 156 | 108,1,59, 157 | 108,1,42, 158 | 110,2,48, 159 | 110,1,57, 160 | 111,2,48, 161 | 111,1,59, 162 | 112,1,42, 163 | 112,1,57, 164 | 112,1,59, 165 | 113,2,57, 166 | 113,1,48, 167 | 114,1,48, 168 | 114,1,57, 169 | 114,1,59, 170 | 109,2,48, 171 | 109,2,57, 172 | 109,-1,59, 173 | 115,3,57, 174 | 116,2,48, 175 | 116,1,42, 176 | 116,1,13, 177 | 117,2,42, 178 | 117,1,48, 179 | 117,1,21, 180 | 118,3.5,48, 181 | 119,2,48, 182 | 119,1,57, 183 | 119,1,13, 184 | 120,3,48, 185 | 120,1,21, 186 | 121,1,48, 187 | 121,1,57, 188 | 121,1,59, 189 | 121,1,13, 190 | 122,2,48, 191 | 122,2,42, 192 | 123,3,48, 193 | 123,1,42, 194 | 124,3,48, 195 | 124,1,42, 196 | 124,1,59, 197 | 124,-1,57, 198 | 125,4,48, 199 | 126,2,48, 200 | 126,1,57, 201 | 126,1,42, 202 | 127,2,48, 203 | 127,1,42, 204 | 127,1,59, 205 | 128,3,48, 206 | 128,1,57, 207 | 129,3,48, 208 | 129,1,59, 209 | 130,1,48, 210 | 130,1,57, 211 | 130,1,42, 212 | 130,1,59, 213 | 131,2,48, 214 | 131,2,57, 215 | 132,2,48, 216 | 132,1,57, 217 | 132,1,59, 218 | 133,2,48, 219 | 133,2,42, 220 | 133,1,21, 221 | 134,3,48, 222 | 134,1,42, 223 | 134,1,21, 224 | 135,4,48, 225 | 135,1,21, 226 | 136,3,48, 227 | 136,1,57, 228 | 136,1,21, 229 | 137,4,48, 230 | 137,1,42, 231 | 138,5,48, 232 | 139,3,48, 233 | 139,1,42, 234 | 139,1,57, 235 | 140,4,48, 236 | 140,1,57, 237 | 141,2,48, 238 | 141,1,42, 239 | 141,1,57, 240 | 141,1,59, 241 | 142,3,48, 242 | 142,2,57, 243 | 143,4,48, 244 | 143,1,57, 245 | 143,1,21, 246 | 144,6,48, 247 | 145,5,48, 248 | 145,1,57, 249 | 146,3,48, 250 | 146,1,42, 251 | 146,1,59, 252 | 146,1,57, 253 | 254 | -------------------------------------------------------------------------------- /ttide/t_astron.py: -------------------------------------------------------------------------------- 1 | from __future__ import division 2 | import numpy as np 3 | from . import time 4 | 5 | 6 | def t_astron(jd): 7 | """T_ASTRON Computes astronomical Variables 8 | [A,ADER] = ASTRON(JD) computes the astronomical variables 9 | A=[tau,s,h,p,np,pp] (cycles) 10 | and their time derivatives 11 | ADER=[dtau,ds,dh,dp,dnp,dpp] (cycles/day) 12 | at the matlab time JD (UTC, but see code for details) where 13 | 14 | tau = lunar time 15 | s = mean longitude of the moon 16 | h = mean longitude of the sun 17 | p = mean longitude of the lunar perigee 18 | np = negative of the longitude of the mean ascending node 19 | pp = mean longitude of the perihelion (solar perigee) 20 | 21 | 22 | The formulae for calculating these ephemerides (other than tau) 23 | were taken from pages 98 and 107 of the Explanatory Supplement to 24 | the Astronomical Ephemeris and the American Ephemeris and Nautical 25 | Almanac (1961). They require EPHEMERIS TIME (ET), now TERRESTRIAL 26 | TIME (TT) and are based on observations made in the 1700/1800s. 27 | In a bizarre twist, the current definition of time is derived 28 | by reducing observations of planetary motions using these formulas. 29 | 30 | The current world master clock is INTERNATIONAL ATOMIC TIME (TAI). 31 | The length of the second is based on inverting the actual 32 | locations of the planets over the period 1956-65 into "time" 33 | using these formulas, and an offset added to keep the scale 34 | continuous with previous defns. Thus 35 | 36 | TT = TAI + 32.184 seconds. 37 | 38 | Universal Time UT is a time scale that is 00:00 at midnight (i.e., 39 | based on the earth's rotation rather than on planetary motions). 40 | Coordinated Universal Time (UTC) is kept by atomic clocks, the 41 | length of the second is the same as for TAI but leap seconds are 42 | inserted at intervals so that it provides UT to within 1 second. 43 | This is necessary because the period of the earth's rotation is 44 | slowly increasing (the day was exactly 86400 seconds around 1820, 45 | it is now about 2 ms longer). 22 leap seconds have been added in 46 | the last 27 years. 47 | 48 | As of 1/1/99, TAI = UTC + 32 seconds. 49 | 50 | Thus, TT = UTC + 62.184 seconds 51 | 52 | GPS time was synchronized with UTC 6/1/1980 ( = TAI - 19 secs), 53 | but is NOT adjusted for leap seconds. Your receiver might do this 54 | automatically...or it might not. 55 | 56 | Does any of this matter? The moon longitude is the fastest changing 57 | parameter at 13 deg/day. A time error of one minute implies a 58 | position error of less than 0.01 deg. This would almost always be 59 | unimportant for tidal work. 60 | 61 | The lunar time (tau) calculation requires UT as a base. UTC is 62 | close enough - an error of 1 second, the biggest difference that 63 | can occur between UT and UTC, implies a Greenwich phase error of 64 | 0.01 deg. In Doodson's definition (Proc R. Soc. A, vol 100, 65 | reprinted in International Hydrographic Review, Appendix to 66 | Circular Letter 4-H, 1954) mean lunar time is taken to begin at 67 | "lunar midnight". 68 | Compute number of days from epoch of 12:00 UT Dec 31, 1899. 69 | (January 0.5 1900 ET) 70 | """ 71 | # ## Matlab version info 72 | # B. Beardsley 12/29/98, 1/11/98 73 | # R. Pawlowicz 9/1/01 74 | # Version 1.0 75 | 76 | d = jd - time.date2num(time.datetime(1899, 12, 31, 12, 0, 0)) 77 | D = d / 10000 78 | 79 | # Compute astronomical constants at time d1. 80 | args = np.array([1, d, D * D, D ** 3]) 81 | 82 | # These are the coefficients of the formulas in the Explan. Suppl. 83 | sc = np.array([270.434164, 13.1763965268, - 8.5e-05, 3.9e-08]) 84 | hc = np.array([279.696678, 0.9856473354, 2.267e-05, 0.0]) 85 | pc = np.array([334.329556, 0.1114040803, - 0.0007739, - 2.6e-07]) 86 | npc = np.array([- 259.183275, 0.0529539222, - 0.0001557, - 5e-08]) 87 | # first coeff was 281.220833 in Foreman but Expl. Suppl. has 44. 88 | ppc = np.array([281.220844, 4.70684e-05, 3.39e-05, 7e-08]) 89 | coef = np.vstack([sc, hc, pc, npc, ppc]) 90 | 91 | # Compute the parameters; 92 | # we only need the factional part of the cycle. 93 | astro = np.fmod(np.dot(coef, args) / 360.0, 1) 94 | 95 | # Compute lunar time tau, based on fractional part of solar day. 96 | # We add the hour angle to the longitude of the sun and 97 | # subtract the longitude of the moon. 98 | tau = (np.fmod(jd, 1) + astro[1] - astro[0]) 99 | astro = np.hstack([tau, astro]) 100 | 101 | # Compute rates of change. 102 | dargs = np.array([0, 1, 0.0002 * D, 0.0003 * D * D]) 103 | 104 | ader = np.dot(coef, dargs) / 360.0 105 | dtau = (1.0 + ader[1] - ader[0]) 106 | ader = np.hstack([dtau, ader]) 107 | 108 | return astro, ader 109 | -------------------------------------------------------------------------------- /ttide/t_getconsts.py: -------------------------------------------------------------------------------- 1 | from __future__ import division 2 | import numpy as np 3 | import copy 4 | from .t_astron import t_astron 5 | import os.path as path 6 | from scipy.io.netcdf import netcdf_file as nopen 7 | 8 | _base_dir = path.join(path.dirname(__file__), 'data') 9 | has_const = path.exists(path.join(_base_dir, 't_constituents_const.nc')) 10 | has_sat = path.exists(path.join(_base_dir, 't_constituents_sat.nc')) 11 | has_shallow = path.exists(path.join(_base_dir, 't_constituents_shallow.nc')) 12 | 13 | if (has_const and has_sat and has_shallow): 14 | _const = {} 15 | _sat = {} 16 | _shallow = {} 17 | 18 | ncid = nopen(path.join(_base_dir, 19 | 't_constituents_const.nc'), 'r', mmap=False) 20 | for key in ncid.variables.keys(): 21 | _const[key] = ncid.variables[key].data 22 | ncid.close() 23 | 24 | ncid = nopen(path.join(_base_dir, 25 | 't_constituents_sat.nc'), 'r', mmap=False) 26 | for key in ncid.variables.keys(): 27 | _sat[key] = ncid.variables[key].data 28 | ncid.close() 29 | 30 | ncid = nopen(path.join(_base_dir, 31 | 't_constituents_shallow.nc'), 'r', mmap=False) 32 | for key in ncid.variables.keys(): 33 | _shallow[key] = ncid.variables[key].data 34 | ncid.close() 35 | 36 | # Correct issues with name strings 37 | _const['name'] = np.array([b''.join([s for s in arr]) 38 | for arr in _const['name']]) 39 | 40 | _const['kmpr'] = np.array([b''.join([s for s in arr]) 41 | for arr in _const['kmpr']]) 42 | 43 | else: 44 | print('You do not have t_constituents_*.npy ' + 45 | 'check that package installation is correct.') 46 | _const = {} 47 | _sat = {} 48 | _shallow = {} 49 | 50 | 51 | def t_getconsts(ctime): 52 | """ 53 | t_getconsts - Gets constituent data structures holding 54 | information for tidal analyses 55 | Variables are loaded from 't_constituents_*.npy' 56 | on init and a copy is made now. 57 | When ctime is specified t_getconsts recomputes the frequencies from 58 | the rates-of-change of astronomical parameters at the matlab TIME given. 59 | 60 | :Parameters: 61 | ctime: a datetime, the start time of the data input into t_tide. 62 | 63 | Note: 64 | Not sure if a copy has to be made here or if they can be used directly. 65 | For now a copy should be much fast then a load. 66 | """ 67 | const = copy.deepcopy(_const) 68 | sat = copy.deepcopy(_sat) 69 | shallow = copy.deepcopy(_shallow) 70 | 71 | if ctime.size != 0: 72 | # If no time, just take the "standard" frequencies, otherwise 73 | # compute them from derivatives of astro parameters. This is 74 | # probably a real overkill - the diffs are in the 75 | # 10th decimal place (9th sig fig). 76 | astro, ader = t_astron(ctime) 77 | 78 | ii = np.isfinite(const['ishallow']) 79 | const['freq'][~ii] = np.dot(const['doodson'][~ii, :], ader) / 24 80 | 81 | shallow_m1 = const['ishallow'].astype(int) -1 82 | iname_m1 = shallow['iname'].astype(int) -1 83 | range_cache = {n:np.arange(n) for n in range(const['nshallow'].max()+1)} 84 | for k in np.flatnonzero(ii): 85 | ik = shallow_m1[k] + range_cache[const['nshallow'][k]] 86 | const['freq'][k] = const['freq'][iname_m1[ik]].dot(shallow['coef'][ik]) 87 | 88 | return const, sat, shallow 89 | -------------------------------------------------------------------------------- /ttide/t_predic.py: -------------------------------------------------------------------------------- 1 | from __future__ import division 2 | import numpy as np 3 | from .t_getconsts import t_getconsts 4 | from .t_vuf import t_vuf 5 | from . import time as tm 6 | 7 | 8 | def t_predic(t_time, names, freq, tidecon, 9 | lat=None, ltype='nodal', synth=0): 10 | """T_PREDIC Tidal prediction from tidal consituents. 11 | 12 | Parameters 13 | ---------- 14 | time : array_like (N) 15 | The array of times at which to make predictions. 16 | names : array_like (M) 17 | The constituent name strings (e.g. ['M2', 'S2', ...]) 18 | freq : array_like (M) 19 | The frequencies, in cph. 20 | tidecon : array_like (M, P) 21 | The tidal constituent amplitudes, phases, and orientations. P 22 | is either 4 (for real output), or 8 (for complex output). 23 | lat : flaot 24 | decimal degrees (+north) (default: None) 25 | In the simplest case, the tidal analysis was done without nodal 26 | corrections, and thus neither will the prediction. If nodal 27 | corrections were used in the analysis, then it is likely we will 28 | want to use them in the prediction too and these are computed 29 | using the latitude, if given. 30 | ltype : {'nodal', 'full'} 31 | If the original analysis was >18.6 years satellites are not 32 | included and we force that here. Use, 'full' if the 33 | consituents were computed from data longer that >18.6 34 | years. 'nodal' (default) is if the analysis was <18.6 years. 35 | synth : float 36 | The tidal prediction may be restricted to only some of the 37 | available constituents: 38 | 0 - use all selected constituents (default) 39 | >0 - use only those constituents with a SNR greater than 40 | that given (1 or 2 are good choices). 41 | 42 | Returns 43 | ------- 44 | yout : array (N,) 45 | The predicted time series (real/scaler for P = 4, 46 | complex/vector for P = 8). 47 | 48 | """ 49 | 50 | longseries = 0 # Currently only timeseries <18.6 years are supported. 51 | if t_time.dtype.name.startswith('datetime64') or t_time.dtype == np.dtype("O"): 52 | t_time = tm.date2num(t_time) 53 | 54 | t_time = t_time.reshape(-1, 1) 55 | 56 | # Do the synthesis. 57 | snr = (tidecon[:, 0] / tidecon[:, 1]) ** 2 58 | # signal to noise ratio 59 | if synth > 0: 60 | I = snr > synth 61 | if not any(I): 62 | print('No predictions with this SNR') 63 | yout = np.nan + np.zeros_like(t_time, dtype='float64') 64 | return yout 65 | tidecon = tidecon[I, :] 66 | names = names[I] 67 | freq = freq[I] 68 | if tidecon.shape[1] == 4: 69 | # Real time series 70 | ap = np.multiply(tidecon[:, 0] / 2.0, 71 | np.exp(-1j * tidecon[:, 2] * np.pi / 180)) 72 | am = np.conj(ap) 73 | else: 74 | ap = np.multiply((tidecon[:, 0] + tidecon[:, 2]) / 2.0, 75 | np.exp(1j * np.pi / 180 * (tidecon[:, 4] - tidecon[:, 6]))) 76 | 77 | am = np.multiply((tidecon[:, 0] - tidecon[:, 2]) / 2.0, 78 | np.exp(1j * np.pi / 180 * (tidecon[:, 4] + tidecon[:, 6]))) 79 | 80 | # Mean at central point (get rid of one point at end to 81 | # take mean of odd number of points if necessary). 82 | jdmid = np.mean(t_time[0:((2 * int((max(t_time.shape) - 1) / 2)) + 1)]) 83 | if longseries: 84 | const = t_get18consts 85 | ju = np.zeros(shape=(freq.shape, freq.shape), dtype='float64') 86 | for k in range(1, (names.shape[0] + 1)): 87 | inam = strmatch(names[(k - 1), :], const.name) 88 | if max(inam.shape) == 1: 89 | ju[(k - 1)] = inam 90 | else: 91 | if max(inam.shape) > 1: 92 | minf, iminf = np.min(abs(freq[(k - 1)] - const.freq(inam))) 93 | ju[(k - 1)] = inam[(iminf - 1)] 94 | else: 95 | const, sat, cshallow = t_getconsts(np.array([])) 96 | ju = np.zeros((len(freq),), dtype='int32') 97 | # Check to make sure names and frequencies match expected values. 98 | for k in range(0, (names.shape[0])): 99 | ju[k] = np.argwhere(const['name'] == names[(k)]) 100 | # if any(freq~=const.freq(ju)), 101 | # error('Frequencies do not match names in input'); 102 | # end; 103 | # Get the astronical argument with or without nodal corrections. 104 | if lat is not None and np.absolute(jdmid) > 1: 105 | v, u, f = t_vuf(ltype, jdmid, ju, lat) 106 | else: 107 | if np.fabs(jdmid) > 1: 108 | # a real date 109 | v, u, f = t_vuf(ltype, jdmid, ju) 110 | else: 111 | v = np.zeros((len(ju),), dtype='float64') 112 | u = v 113 | f = np.ones((len(ju),), dtype='float64') 114 | 115 | ap = ap * f * np.exp(+1j * 2 * np.pi * (u + v)) 116 | am = am * f * np.exp(-1j * 2 * np.pi * (u + v)) 117 | t_time = t_time - jdmid 118 | 119 | n, m = t_time.shape 120 | ntime = max(t_time.shape) 121 | nsub = 10000 122 | yout = np.zeros([n * m, ], dtype='complex128') 123 | 124 | # longer than one year hourly. 125 | for j1 in np.arange(0, ntime, nsub): 126 | j1 = j1.astype(int) 127 | j2 = np.min([j1 + nsub, ntime]).astype(int) 128 | tap = np.repeat(ap, j2 - j1).reshape(len(ap), j2 - j1) 129 | tam = np.repeat(am, j2 - j1).reshape(len(am), j2 - j1) 130 | 131 | touter = np.outer(24 * 1j * 2 * np.pi * freq, t_time[j1:j2]) 132 | yout[j1:j2] = np.sum(np.multiply(np.exp(touter), tap), axis=0) +\ 133 | np.sum(np.multiply(np.exp(-touter), tam), axis=0) 134 | 135 | if (tidecon.shape[1] == 4): 136 | return np.real(yout) 137 | else: 138 | return yout 139 | -------------------------------------------------------------------------------- /ttide/t_tide.py: -------------------------------------------------------------------------------- 1 | from __future__ import division, print_function 2 | import numpy as np 3 | import scipy.interpolate as spi 4 | from .t_vuf import t_vuf 5 | from . import t_utils as tu 6 | from .base import TTideCon, t_predic 7 | import datetime 8 | from . import time as tm 9 | 10 | 11 | pi = np.pi 12 | 13 | 14 | np.set_printoptions(precision=8, suppress=True) 15 | 16 | 17 | def t_tide(xin, dt=1, stime=None, lat=None, 18 | out_style='classic', 19 | outfile=None, 20 | corr_fs=[0, 1e6], corr_fac=[1, 1], 21 | secular='mean', 22 | infiname=[], infirefname=[], 23 | ray=1, 24 | shallownames=[], constitnames=[], 25 | errcalc='cboot', synth=2, 26 | lsq='best'): 27 | """T_TIDE Harmonic analysis of a time series. 28 | 29 | Parameters 30 | ---------- 31 | xin : array_like 32 | can be real (e.g. for elevations), or complex (U + 1j * V) 33 | for eastward velocity U and northward velocity V. 34 | 35 | dt : float 36 | Sampling interval in hours, default = 1. 37 | 38 | stime : float (mpl_datenum) or python datetime 39 | The start time of the series, in matplotlib_datenum format (default empty). 40 | 41 | lat : float 42 | decimal degrees (+north) (default: none). 43 | 44 | out_style : {None, 'classic', 'pandas'} 45 | where to send printed output 46 | None - no printed output 47 | 'classic' - to screen in classic-mode (default) 48 | 'pandas' - to screen in pandas-like mode. 49 | 50 | outfile : str or None 51 | The filename to write to (default: None, do not write to a 52 | file). This writes in format `out_style` ('classic' if 53 | `out_style` is None). 54 | 55 | corr_fs : array_like 56 | frequencies of the pre-filter transfer function (see note on 57 | pre-filtering) 58 | corr_fac : array_like (possible complex) 59 | correction factor magnitudes (see note on pre-filtering) 60 | 61 | secular : {'mean', 'linear'} 62 | Adjustment for long-term behavior ("secular" behavior). 63 | 'mean' - assume constant offset (default). 64 | 'linear' - get linear trend. 65 | 66 | infiname : list-like of names of consituents to be inferred 67 | Unclear what a more specific docstring should be. Clarify docs here. 68 | 69 | infirefname : list-like of names of references 70 | Unclear what a more specific docstring should be. Clarify docs here. 71 | 72 | ray : float 73 | The Rayleigh criteria (default: 1) 74 | 75 | shallownames : list-like of strings 76 | The names of shallow-water constituents to analyze. 77 | 78 | errcalc : string 79 | Method to use for calculation of confidence limits: 80 | 'wboot' - Boostrapped confidence intervals based on a 81 | correlated bivariate white-noise model. 82 | 'cboot' - Boostrapped confidence intervals based on an 83 | uncorrelated bivariate coloured-noise model 84 | (default).' 85 | 'linear' - Linearized error analysis that assumes an 86 | uncorrelated bivariate coloured noise model. 87 | 88 | synth : float 89 | The signal-to-noise ratio of constituents to use for the 90 | "predicted" tide (passed to t_predic, but note that the 91 | default value is different). 92 | 0 - use all selected constituents 93 | >0 - use only those constituents with a SNR greater than 94 | that given (1 or 2 are good choices, 2 is the 95 | default). 96 | <0 - return result of least-squares fit (should be the same 97 | as using '0', except that NaN-holes in original time 98 | series will remain and mean/trend are included). 99 | 100 | lsq : string 101 | 'direct' - use A\ x fit 102 | 'normal' - use (A'A)\(A'x) (may be necessary for very large 103 | input vectors since A'A is much smaller than A) 104 | 'best' - automatically choose based on length of series 105 | (default). 106 | 107 | Returns 108 | ------- 109 | 110 | out : `TTideCon` instance 111 | This class is based on dict. The dictionary contains all of 112 | the relavent data of the fit. It also includes a `t_predic` 113 | method that can be used to create tidal predictions 114 | (extrapolation) based on the fit. This `t_predic` method is 115 | also duplicated as the `__call__` method. See the TTideCon 116 | docstring for more info. 117 | 118 | Notes 119 | ----- 120 | 121 | This function is based on the Matlab T_TIDE toolbox by Rich Pawlowicz [1]_. 122 | 123 | `stime` and `lat` are required if nodal corrections are to be computed, 124 | otherwise not necessary. If they are not included then the reported 125 | phases are raw constituent phases at the central time. 126 | 127 | Currently, timeseries longer than 18.6 years are not 128 | supported. (The Matlab version does support this.) 129 | 130 | PRE-FILTERING 131 | ............. 132 | If the time series has been passed through a pre-filter of some 133 | kind (say, to reduce the low-frequency variability), then the 134 | analyzed constituents will have to be corrected for this. The 135 | correction transfer function (1/filter transfer function) has 136 | (possibly complex) magnitude `corr_fac` at frequency `corr_fs` 137 | (cph). Corrections of more than a factor of 100 are not applied; 138 | it is assumed these refer to tidal constituents that were 139 | intentionally filtered out, e.g., the fortnightly components. 140 | 141 | NaN-Values 142 | .......... 143 | Although missing data can be handled with NaN, it is wise not to 144 | have too many of them. If your time series has a lot of missing 145 | data at the beginning and/or end, then truncate the input time 146 | series. The Rayleigh criterion is applied to frequency intervals 147 | calculated as the inverse of the input series length. 148 | 149 | .. [1] Pawlowicz, R., B. Beardsley, and S. Lentz, "Classical Tidal 150 | "Harmonic Analysis Including Error Estimates in MATLAB 151 | using T_TIDE", Computers and Geosciences, 28, 929-937 (2002). 152 | 153 | Examples 154 | -------- 155 | 156 | import numpy as np 157 | import ttide as tt 158 | 159 | t = np.arange(1001) 160 | m2_freq = 2 * np.pi / 12.42 161 | 162 | #### 163 | # Here is an example 'real' dataset: 164 | elev = 5 * np.cos(m2_freq * t) 165 | 166 | # Compute the tidal fit: 167 | tfit_e = tt.t_tide(elev) 168 | 169 | # Construct the fitted time-series: 170 | elev_fit = tfit_e(t) 171 | 172 | # Or extrapolate the fit to other times: 173 | extrap_fit = tfit_e(np.arange(2000,2500)) 174 | 175 | #### 176 | # Here is an example 'complex' (vector) dataset: 177 | vel = 0.8 * elev + 1j * 2 * np.sin(m2_freq * t) 178 | 179 | tfit_v = tt.t_tide(vel) 180 | 181 | """ 182 | 183 | # ### This text needs to be re-included in the docstring once this 184 | # ### is supported. 185 | # If your time series is longer than 18.6 years then nodal corrections 186 | # are not made -instead we fit directly to all satellites (start time 187 | # is then just used to generate Greenwich phases). 188 | 189 | # ### This text came from the docstring on `infiname` and `infirefname` 190 | # Inference of constituents. 191 | # 'inference' NAME,REFERENCE,AMPRAT,PHASE_OFFSET 192 | # where NAME is an array of the names of 193 | # constituents to be inferred, REFERENCE is an 194 | # array of the names of references, and AMPRAT 195 | # and PHASE_OFFSET are the amplitude factor and 196 | # phase offset (in degrees)from the references. 197 | # NAME and REFERENCE are Nx4 (max 4 characters 198 | # in name), and AMPRAT and PHASE_OFFSET are Nx1 199 | # (for scalar time series) and Nx2 for vector 200 | # time series (column 1 is for + frequencies and 201 | # column 2 for - frequencies). 202 | # NB - you can only infer ONE unknown constituent 203 | # per known constituent (i.e. REFERENCE must not 204 | # contain multiple instances of the same name). 205 | 206 | if isinstance(stime, (datetime.datetime, np.datetime64)): 207 | stime = tm.date2num(stime) 208 | 209 | corr_fs = np.array(corr_fs) 210 | corr_fac = np.array(corr_fac) 211 | infiname = np.array(infiname) 212 | infirefname = np.array(infirefname) 213 | shallownames = tu.fourpad(np.array(shallownames)) 214 | constitnames = tu.fourpad(np.array(constitnames)) 215 | 216 | isComplex = False 217 | 218 | # Check to make sure that incoming data is a vector. 219 | inn = xin.shape 220 | if len(inn) != 1: 221 | raise ValueError('Input time series is not a vector') 222 | if 'complex' in xin.dtype.name: 223 | isComplex = True 224 | 225 | # Check size of incoming data. 226 | nobs = max(xin.shape) 227 | 228 | # Set matrix method if auto-choice. 229 | # This could be increased for nobs>10000. 230 | # 100,000 uses a reasonable amount of ram for current systems. 231 | # Kept as is for the time being to stay true to Matlab version. 232 | if lsq[0:3] == 'bes': 233 | if nobs > 1000000: 234 | lsq = 'normal' 235 | else: 236 | lsq = 'direct' 237 | 238 | # Check to see if timeseries spans 18.6 years. 239 | if nobs * dt > 18.6 * 365.25 * 24: 240 | longseries = 1 241 | ltype = 'full' 242 | else: 243 | longseries = 0 244 | ltype = 'nodal' 245 | nobsu = nobs - np.remainder(nobs - 1, 2) 246 | 247 | # Make series odd to give a center point 248 | # Time vector for entire time series centered at series midpoint. 249 | t = (dt * (np.arange(nobs) + 1 - np.ceil(nobsu / 2))) 250 | 251 | if stime is not None: 252 | centraltime = stime + np.floor(nobsu / 2) * dt / 24.0 253 | else: 254 | centraltime = np.array([]) 255 | 256 | # -------Get the frequencies to use in the harmonic analysis----------- 257 | tmptuple = tu.constituents(ray / (dt * nobsu), 258 | constitnames, shallownames, 259 | infiname, infirefname, 260 | centraltime) 261 | nameu, fu, ju, namei, fi, jinf, jref = tmptuple 262 | 263 | mu = len(fu) 264 | mi = len(fi) 265 | 266 | # # inferred 267 | # Find the good data points 268 | # (here I assume that in a complex time series, if u is bad, so is v). 269 | gd = np.flatnonzero(np.isfinite(xin[0:nobsu])) 270 | ngood = max(gd.shape) 271 | 272 | # Now solve for the secular trend plus the analysis. Instead of solving 273 | # for + and - frequencies using exp(i*f*t), I use sines and cosines to 274 | # keep tc real. If the input series is real, than this will 275 | # Automatically use real-only computation (faster). 276 | # However, for the analysis, it's handy to get the + and - frequencies 277 | # ('ap' and 'am'), and so that's what we do afterwards. 278 | # The basic code solves the matrix problem Ac=x+errors where the functions 279 | # to use in the fit fill up the A matrix, which is of size 280 | # (number points)x(number constituents). This can get very, very large 281 | # for long time series, and for this the more complex block processing 282 | # algorithm was added. It should give 283 | # identical results (up to roundoff error) 284 | if lsq[0:3] == 'dir': 285 | if secular[0:3] == 'lin': 286 | tc = np.hstack([np.ones((len(t), 1)), 287 | np.cos(2 * pi * np.outer(t, fu)), 288 | np.sin(2 * pi * np.outer(t, fu)), 289 | t.reshape(-1, 1) * (2 / dt / nobsu)]) 290 | else: 291 | tc = np.hstack([np.ones((len(t), 1)), 292 | np.cos(2 * pi * np.outer(t, fu)), 293 | np.sin(2 * pi * np.outer(t, fu))]) 294 | 295 | coef = np.linalg.lstsq(tc[gd, :], xin[gd], rcond=None)[0].T 296 | 297 | # z0 a+ and a- amplitudes 298 | z0 = coef[0] 299 | ap = (coef[1:mu + 1] - 1j * coef[(1 + mu):(mu * 2) + 1]) / 2 300 | am = (coef[1:mu + 1] + 1j * coef[(1 + mu):(mu * 2) + 1]) / 2 301 | 302 | if secular[0:3] == 'lin': 303 | dz0 = coef[-1] 304 | else: 305 | dz0 = 0 306 | 307 | # Save least squares fitted prediction incase synth<=0 308 | xout = np.dot(tc, coef) 309 | 310 | else: 311 | # More complicated code required for long 312 | # timeseries when memory maybe a problem. 313 | # Modified from code submitted by Derek Goring (NIWA Chrischurch) 314 | # Basically the normal equations are formed 315 | # (rather than using Matlab's algorithm for least squares); 316 | # this can be done by adding up subblocks of data. 317 | # Notice how the code is messier, 318 | # and we have to recalculate everything to get the original fit. 319 | nsub = 5000 320 | # Block length - doesn't matter really but should be small enough to 321 | # get allocated quickly 322 | if secular[0:3] == 'lin': 323 | lhs = np.zeros(shape=(2 * mu + 2, 2 * mu + 2), dtype='float64') 324 | rhs = np.zeros(shape=(2 * mu + 2, ), dtype='float64') 325 | for j1 in range(1, (ngood + 1), nsub): 326 | j2 = np.min([j1 + nsub - 1, ngood]) 327 | tslice = t[gd[(j1 - 1):j2] - 1] 328 | E = np.hstack([np.ones((j2 - j1 + 1, 1)), 329 | np.cos(2 * pi * np.outer(tslice, fu)), 330 | np.sin(2 * pi * np.outer(tslice, fu)), 331 | tslice.reshape(-1, 1) * (2 / dt / nobsu)]) 332 | rhs = rhs + np.dot(E.T, xin[(gd[(j1 - 1):j2] - 1)]) 333 | lhs = lhs + np.dot(E.T, E) 334 | else: 335 | lhs = np.zeros(shape=(2 * mu + 1, 2 * mu + 1), dtype='float64') 336 | rhs = np.zeros(shape=(2 * mu + 1, ), dtype='float64') 337 | for j1 in range(1, (ngood + 1), nsub): 338 | j2 = np.min([j1 + nsub - 1, ngood]) 339 | tslice = t[gd[(j1 - 1):j2] - 1] 340 | E = np.hstack([np.ones((j2 - j1 + 1, 1)), 341 | np.cos(2 * pi * np.outer(tslice, fu)), 342 | np.sin(2 * pi * np.outer(tslice, fu))]) 343 | rhs = rhs + np.dot(E.T, xin[(gd[(j1 - 1):j2] - 1)]) 344 | lhs = lhs + np.dot(E.T, E) 345 | coef = np.linalg.lstsq(lhs, rhs, rcond=None)[0].T 346 | 347 | # z0 a+ and a- amplitudes 348 | z0 = coef[0] 349 | ap = (coef[1:mu + 1] - 1j * coef[(1 + mu):(mu * 2) + 1]) / 2 350 | am = (coef[1:mu + 1] + 1j * coef[(1 + mu):(mu * 2) + 1]) / 2 351 | 352 | if secular[0:3] == 'lin': 353 | dz0 = coef[-1] 354 | else: 355 | dz0 = 0 356 | 357 | xout = xin.copy() 358 | # Copies over NaN 359 | if secular[0:3] == 'lin': 360 | for j1 in range(1, (nobs + 1), nsub): 361 | j2 = np.min([j1 + nsub - 1, nobs]) 362 | tslice = t[(j1 - 1):j2] 363 | E = np.hstack([np.ones((j2 - j1 + 1, 1)), 364 | np.cos(2 * pi * np.outer(tslice, fu)), 365 | np.sin(2 * pi * np.outer(tslice, fu)), 366 | np.dot(tslice, (2 / dt / nobsu)).reshape(-1, 1)]) 367 | xout[(j1 - 1):j2] = np.dot(E, coef) 368 | else: 369 | for j1 in range(1, (nobs + 1), nsub): 370 | j2 = np.min([j1 + nsub - 1, nobs]) 371 | tslice = t[(j1 - 1):j2] 372 | E = np.hstack([np.ones((j2 - j1 + 1, 1)), 373 | np.cos(2 * pi * np.outer(tslice, fu)), 374 | np.sin(2 * pi * np.outer(tslice, fu))]) 375 | xout[(j1 - 1):j2] = np.dot(E, coef) 376 | 377 | # Check variance explained 378 | # (but do this with the original fit, and the residuals!) 379 | xres = xin - xout 380 | 381 | #################################################################### 382 | # ---------- Correct for prefiltering-------------------------------- 383 | #################################################################### 384 | corrfac = spi.interpolate.interp1d(corr_fs, corr_fac)(fu) 385 | # To stop things blowing up! 386 | corrfac[corrfac > 100] = 1 387 | corrfac[corrfac < 0.01] = 1 388 | corrfac[np.isnan(corrfac)] = 1 389 | ap = ap * np.squeeze(corrfac) 390 | am = am * np.squeeze(np.conj(corrfac)) 391 | 392 | #################################################################### 393 | # ---------------Nodal Corrections----------------------------------- 394 | # Generate nodal corrections and calculate phase relative to 395 | # Greenwich. Note that this is a slightly weird way to do the nodal 396 | # corrections, but is 'traditional'. The "right" way would be to 397 | # change the basis functions used in the least-squares fit above. 398 | #################################################################### 399 | if lat is not None and stime is not None: 400 | # Time and latitude 401 | # Get nodal corrections at midpoint time. 402 | v, u, f = t_vuf(ltype, centraltime, 403 | np.hstack([ju, jinf]).astype(int), lat) 404 | vu = (v + u) * 360 405 | # total phase correction (degrees) 406 | nodcor = 'Greenwich phase computed with nodal\n \ 407 | corrections applied to amplitude\n \ 408 | and phase relative to center time\n' 409 | elif stime is not None: 410 | # Time only 411 | # Get nodal corrections at midpoint time 412 | v, u, f = t_vuf(ltype, centraltime, 413 | np.hstack([ju, jinf]).astype(int)) 414 | vu = (v + u) * 360 415 | # total phase correction (degrees) 416 | nodcor = 'Greenwich phase computed, no nodal corrections' 417 | else: 418 | # No time, no latitude 419 | nshape = (len(ju) + len(jinf), 1) 420 | vu = np.zeros(nshape, dtype='float64') 421 | f = np.ones(nshape, dtype='float64') 422 | nodcor = 'Phases at central time' 423 | 424 | #################################################################### 425 | # ---------------Inference Corrections------------------------------ 426 | # Once again, the "right" way to do this 427 | # would be to change the basis functions. 428 | #################################################################### 429 | ii = np.flatnonzero(np.isfinite(jref)) 430 | if ii: 431 | print(' Do inference corrections\\n') 432 | snarg = nobsu * pi * dt * (fi[(ii - 1)] - fu[(jref[(ii - 1)] - 1)]) 433 | scarg = np.sin(snarg) / snarg 434 | if infamprat.shape[1] == 1: 435 | # For real time series 436 | pearg = np.dot(2 * pi,ii 437 | (vu[(mu + ii - 1)] - 438 | vu[(jref[(ii - 1)] - 1)] + 439 | infph[(ii - 1)])) / 360 440 | pcfac = infamprat[(ii - 1)] * f[(mu + ii - 1)] / \ 441 | f[(jref[(ii - 1)] - 1)] * np.exp(np.dot(ii, pearg)) 442 | pcorr = 1 + pcfac * scarg 443 | mcfac = np.conj(pcfac) 444 | mcorr = np.conj(pcorr) 445 | else: 446 | # For complex time series 447 | pearg = np.dot(2 * pi, 448 | (vu[(mu + ii - 1)] - 449 | vu[(jref[(ii - 1)] - 1)] + 450 | infph[(ii - 1), 0])) / 360 451 | pcfac = infamprat[(ii - 1), 0] * f[(mu + ii - 1)] / \ 452 | f[(jref[(ii - 1)] - 1)] * np.exp(np.dot(i, pearg)) 453 | pcorr = 1 + pcfac * scarg 454 | mearg = np.dot(-2 * pi, 455 | (vu[(mu + ii - 1)] - 456 | vu[(jref[(ii - 1)] - 1)] + 457 | infph[(ii - 1), 1])) / 360 458 | mcfac = infamprat[(ii - 1), 1] * f[(mu + ii - 1)] / \ 459 | f[(jref[(ii - 1)] - 1)] * np.exp(np.dot(i, mearg)) 460 | mcorr = 1 + mcfac * scarg 461 | ap[(jref[(ii - 1)] - 1)] = ap[(jref[(ii - 1)] - 1)] / pcorr 462 | # Changes to existing constituents 463 | ap = np.array([ap, ap[(jref[(ii - 1)] - 1)] * pcfac]).reshape(1, -1) 464 | # Inferred constituents 465 | am[(jref[(ii - 1)] - 1)] = am[(jref[(ii - 1)] - 1)] / mcorr 466 | am = np.array([am, am[(jref[(ii - 1)] - 1)] * mcfac]).reshape(1, -1) 467 | fu = np.array([fu, fi[(ii - 1)]]).reshape(1, -1) 468 | nameu = np.array([nameu, namei[(ii - 1), :]]).reshape(1, -1) 469 | 470 | #################################################################### 471 | # --------------Error Bar Calculations------------------------------ 472 | # 473 | # Error bar calcs involve two steps: 474 | # 1) Estimate the uncertainties in the analyzed amplitude 475 | # for both + and - frequencies (i.e., in 'ap' and 'am'). 476 | # A simple way of doing this is to take the variance of the 477 | # original time series and divide it into the amount appearing 478 | # in the bandwidth of the analysis (approximately 1/length). 479 | # A more sophisticated way is to assume "locally white" 480 | # noise in the vicinity of, e.g., the diurnal consistuents. 481 | # This takes into account slopes in the continuum spectrum. 482 | # 483 | # 2) Transform those uncertainties into ones suitable for ellipse 484 | # parameters (axis lengths, angles). This can be done 485 | # analytically for large signal-to-noise ratios. However, the 486 | # transformation is non-linear at lows SNR, say, less than 10 487 | # or so. 488 | # 489 | #################################################################### 490 | 491 | # Fill in "internal" NaNs with linearly interpolated 492 | # values so we can fft things. 493 | xr = tu.fixgaps(xres) 494 | 495 | nreal = 1 496 | 497 | if errcalc.endswith('boot'): 498 | # print('Using nonlinear bootstrapped error estimates.'); 499 | ################################################################ 500 | # "noise" matrices are created with the right covariance 501 | # structure to add to the analyzed components to 502 | # create 'nreal' REPLICATES. 503 | ################################################################ 504 | 505 | nreal = 300 506 | # Create noise matrices 507 | NP, NM = tu.noise_realizations(xr[(np.isfinite(xr))], 508 | fu, dt, nreal, errcalc) 509 | # All replicates are then transformed (nonlinearly) into 510 | # ellipse parameters. The computed error bars are then 511 | # based on the std dev of the replicates. 512 | 513 | AP = np.repeat(ap, nreal).reshape(len(ap), nreal) + NP 514 | AM = np.repeat(am, nreal).reshape(len(am), nreal) + NM 515 | # Add to analysis (first column of NM,NP=0 516 | # so first column of AP/M holds ap/m). 517 | 518 | # Angle/magnitude form: 519 | epsp = np.angle(AP) * 180 / pi 520 | epsm = np.angle(AM) * 180 / pi 521 | 522 | ap = np.absolute(AP) 523 | am = np.absolute(AM) 524 | else: 525 | if errcalc == 'linear': 526 | print('Using linearized error estimates.') 527 | ############################################################ 528 | # Uncertainties in analyzed amplitudes are computed in 529 | # different spectral bands. Real and imaginary parts of 530 | # the residual time series are treated separately 531 | # (no cross-covariance is assumed). 532 | # 533 | # Noise estimates are then determined from a linear analysis 534 | # of errors, assuming that everything is uncorrelated. 535 | # This is OK for scalar timeseries but can fail for vector 536 | # time series if the noise is not isotropic. 537 | ############################################################ 538 | 539 | ercx, eicx = tu.noise_stats(xr[np.isfinite(xr)], fu, dt) 540 | 541 | # Note - here we assume that the error in the cos and sin 542 | # terms is equal, and equal to total power in the 543 | # encompassing frequency bin. It seems like there should be 544 | # a factor of 2 here somewhere but it only works this way! 545 | # 546 | 547 | emaj, emin, einc, epha = errell(ap + am, 1j * (ap - am), 548 | ercx, ercx, eicx, eicx) 549 | epsp = 180 / np.pi * np.angle(ap) 550 | epsm = 180 / np.pi * np.angle(am) 551 | ap = np.absolute(ap) 552 | am = np.absolute(am) 553 | else: 554 | print("Unrecognized type of error analysis: " + 555 | errcalc + " specified!") 556 | # -----Convert complex amplitudes to standard ellipse parameters---- 557 | aap = ap / np.repeat(f, nreal).reshape(f.shape[0], nreal) 558 | # Apply nodal corrections and 559 | aam = am / np.repeat(f, nreal).reshape(f.shape[0], nreal) 560 | # compute ellipse parameters. 561 | fmaj = aap + aam 562 | # major axis 563 | fmin = aap - aam 564 | # minor axis 565 | 566 | gp = np.mod(np.repeat(vu, nreal).reshape(vu.shape[0], nreal) - epsp, 360) 567 | # pos. Greenwich phase in deg. 568 | gm = np.mod(np.repeat(vu, nreal).reshape(vu.shape[0], nreal) + epsm, 360) 569 | # neg. Greenwich phase in deg. 570 | finc = ((epsp + epsm) / 2) 571 | finc[:, 0] = np.mod(finc[:, 0], 180) 572 | 573 | # Ellipse inclination in degrees 574 | # (mod 180 to prevent ambiguity, i.e., 575 | # we always ref. against northern 576 | # semi-major axis. 577 | finc = tu.cluster(finc, 180) 578 | # Cluster angles around the 'true' angle to avoid 360 degree wraps. 579 | pha = np.mod(gp + finc, 360) 580 | # Greenwich phase in degrees. 581 | pha = tu.cluster(pha, 360) 582 | # Cluster angles around the 'true' angle to avoid 360 degree wraps. 583 | 584 | # ----------------Generate 95% CI----------------------------------- 585 | # For bootstrapped errors, we now compute limits of the distribution. 586 | if errcalc.endswith('boot'): 587 | def booterrcalc(para, nreal): 588 | errval = np.multiply( 589 | np.median( 590 | np.absolute( 591 | para - (np.median(para, 1).reshape(-1, 1) * 592 | np.ones([1, nreal]))), 1) / 0.6375, 1.96) 593 | return errval 594 | 595 | emaj = booterrcalc(fmaj, nreal) 596 | emin = booterrcalc(fmin, nreal) 597 | einc = booterrcalc(finc, nreal) 598 | epha = booterrcalc(pha, nreal) 599 | 600 | else: 601 | # In the linear analysis, the 95 CI are computed from the sigmas 602 | # by this fudge factor (infinite degrees of freedom). 603 | emaj = 1.96 * emaj 604 | emin = 1.96 * emin 605 | einc = 1.96 * einc 606 | epha = 1.96 * epha 607 | 608 | if isComplex: 609 | tidecon = np.array([fmaj[:, 0], emaj, fmin[:, 0], emin, 610 | finc[:, 0], einc, pha[:, 0], epha]).T 611 | else: 612 | tidecon = np.array([fmaj[:, 0], emaj, pha[:, 0], epha]).T 613 | tideconout = tidecon.copy() 614 | # Sort results by frequency (needed if anything has been inferred 615 | # since these are stuck at the end of the list by code above). 616 | if any(np.isfinite(jref)): 617 | fu, I = np.sort(fu) 618 | nameu = nameu[(I - 1), :] 619 | tidecon = tidecon[(I - 1), :] 620 | snr = (tidecon[:, 0] / tidecon[:, 1]) ** 2 621 | # signal to noise ratio 622 | # --------Generate a 'prediction' using significant constituents---- 623 | xoutOLD = xout 624 | if synth >= 0: 625 | if lat is not None and stime is not None: 626 | xout = t_predic(stime + np.array([range(nobs)]) * dt / 24.0, 627 | nameu, fu, tidecon, synth=synth, lat=lat) 628 | elif stime is not None: 629 | xout = t_predic(stime + np.array([range(nobs)]) * dt / 24.0, 630 | nameu, fu, tidecon, synth=synth) 631 | else: 632 | xout = t_predic(t / 24.0, nameu, fu, tidecon, synth=synth) 633 | 634 | # Check variance explained (but now do this 635 | # with the synthesized fit) and the residuals! 636 | xres = xin[:] - xout[:] 637 | 638 | xout = xout.reshape(inn[0], 1) 639 | 640 | out = TTideCon() 641 | out['nobs'] = nobs 642 | out['ngood'] = ngood 643 | out['dt'] = dt 644 | out['xin'] = xin 645 | out['xout'] = xout 646 | out['xres'] = xres 647 | out['xingd'] = xin[gd] 648 | out['xoutgd'] = xout[gd] 649 | out['xresgd'] = xres[gd] 650 | out['isComplex'] = isComplex 651 | out['ray'] = ray 652 | out['nodcor'] = nodcor 653 | out['z0'] = z0 654 | out['dz0'] = dz0 655 | 656 | out['fu'] = fu 657 | out['nameu'] = nameu 658 | out['tidecon'] = tideconout 659 | out['snr'] = snr 660 | out['synth'] = synth 661 | out['lat'] = lat 662 | out['ltype'] = ltype 663 | if stime is not None: 664 | out['stime'] = stime 665 | 666 | # -----------------Output results----------------------------------- 667 | if out_style or outfile: 668 | if out_style: 669 | method = out_style + '_style' 670 | else: 671 | method = 'classic_style' 672 | 673 | if outfile: 674 | getattr(out, method)(to_file=outfile) 675 | else: 676 | print(getattr(out, method)(), end='') 677 | 678 | return out 679 | -------------------------------------------------------------------------------- /ttide/t_utils.py: -------------------------------------------------------------------------------- 1 | from __future__ import division, print_function 2 | import numpy as np 3 | import scipy.signal as sps 4 | import sys 5 | from .t_getconsts import t_getconsts 6 | from . import time 7 | 8 | try: 9 | import pandas as pd 10 | except ImportError: 11 | pd = None 12 | 13 | 14 | np.set_printoptions(precision=8, suppress=True) 15 | 16 | try: 17 | enc = sys.stdout.encoding 18 | except AttributeError: 19 | enc = 'UTF-8' 20 | 21 | if enc is None: 22 | # This is for piping/writing stdout to file, e.g. using '>' 23 | enc = 'UTF-8' 24 | 25 | 26 | def fourpad(conin): 27 | conin = np.array(conin, dtype='|S4') 28 | for i, con in enumerate(conin): 29 | conin[i] = con.ljust(4) 30 | 31 | return conin 32 | 33 | 34 | def constituents(minres, constit, shallow, infname, infref, centraltime): 35 | """[name,freq,kmpr]=constituents(minres,infname) loads tidal constituent 36 | table (containing 146 constituents), then picks out only the ' 37 | resolvable' frequencies (i.e. those that are MINRES apart), base on 38 | the comparisons in the third column of constituents.dat. Only 39 | frequencies in the 'standard' set of 69 frequencies are actually used. 40 | Also return the indices of constituents to be inferred. 41 | If we have the mat-file, read it in, otherwise create it and read 42 | it in! 43 | R Pawlowicz 9/1/01 44 | Version 1.0 45 | 46 | 19/1/02 - typo fixed (thanks to Zhigang Xu) 47 | Compute frequencies from astronomical considerations. 48 | """ 49 | if minres > 1 / (18.6 * 365.25 * 24): 50 | # Choose only resolveable pairs for short 51 | const, sat, cshallow = t_getconsts(centraltime) 52 | # Time series 53 | ju = np.flatnonzero(const['df'] >= minres) 54 | else: 55 | # Choose them all if > 18.6 years. 56 | const, sat, cshallow = t_get18consts(centraltime) 57 | 58 | ju = np.array([range(2, 59 | (max(const['freq'].shape) + 1))]).reshape(1, -1).T 60 | # Skip Z0 61 | for ff in range(1, 3): 62 | # loop twice to make sure of neightbouring pairs 63 | jck = np.flatnonzero(np.diff(const['freq'][ju]) < minres) 64 | if (max(jck.shape) > 0): 65 | jrm = jck 66 | jrm = jrm + (abs(const['doodsonamp'][ju[(jck + 1 - 1)]]) < 67 | abs(const['doodsonamp'][ju[(jck - 1)]])) 68 | # disp(' Warning! Following constituent pairs violate Rayleigh criterion') 69 | # for ick in range(1, (max(jck.shape) +1)): 70 | # disp(' ' + const.name(ju[(jck[(ick -1)] -1)], :) 71 | # + ' vs ' + const.name(ju[(jck[(ick -1)] + 1 -1)], :) + ' - not using ' + 72 | # const.name(ju[(jrm[(ick -1)] -1)], :)) 73 | ju[(jrm - 1)] = np.array([]) 74 | 75 | if constit.size: 76 | # Selected if constituents are specified in input. 77 | ju = np.array([], dtype=int) 78 | for k in range(0, (constit.shape[0])): 79 | j1 = np.where(const['name'] == constit[k])[0] 80 | if (j1.size == 0): 81 | print("Can't recognize name " + 82 | constit[k].decode(enc) + 83 | ' for forced search') 84 | else: 85 | ju = np.append(ju, j1) 86 | 87 | # sort in ascending order of frequency. 88 | II = np.argsort(const['freq'][ju]) 89 | ju = ju[II] 90 | 91 | # cout 92 | # disp([' number of standard constituents used: ',int2str(length(ju))]) 93 | if shallow.size != 0: 94 | # Add explictly selected shallow water constituents. 95 | for k in range(0, (shallow.shape[0])): 96 | j1 = np.where(const['name'] == shallow[k])[0] 97 | if (j1.size == 0): 98 | print("Can't recognize name " + 99 | shallow[k].decode(enc) + 100 | ' for forced search') 101 | else: 102 | ju = np.append(ju, j1) 103 | 104 | nameu = const['name'][ju] 105 | fu = const['freq'][ju] 106 | 107 | # Check if neighboring chosen constituents violate Rayleigh criteria. 108 | jck = np.flatnonzero(np.diff(fu) < minres) 109 | # cout 110 | # if (length(jck)>0) 111 | # disp([' Warning! Following constituent 112 | # pairs violate Rayleigh criterion']); 113 | # for ick=1:length(jck); 114 | # disp([' ',nameu(jck(ick),:),' ',nameu(jck(ick)+1,:)]); 115 | # end; 116 | # end 117 | # For inference, add in list of components to be inferred. 118 | fi = np.array([]) 119 | namei = np.array([]) 120 | jinf = np.array([]) 121 | jref = np.array([]) 122 | if infname.size != 0: 123 | fi = np.zeros(shape=(infname.shape[0], 1), dtype='float64') 124 | namei = np.zeros(shape=(infname.shape[0], 4), dtype='float64') 125 | jinf = np.zeros(shape=(infname.shape[0], 1), dtype='float64') + np.nan 126 | jref = np.zeros(shape=(infname.shape[0], 1), dtype='float64') + np.nan 127 | for k in range(1, (infname.shape[0] + 1)): 128 | j1 = strmatch(infname[(k - 1), :], const.name) 129 | if (0 in j1.shape): 130 | print("Can't recognize name" + 131 | infname[(k - 1), :] + ' for inference') 132 | else: 133 | jinf[(k - 1)] = j1 134 | fi[(k - 1)] = const['freq'][j1] 135 | namei[(k - 1), :] = const['name'][j1, :] 136 | j1 = strmatch(infref[(k - 1), :], nameu) 137 | if (0 in j1.shape): 138 | print("Can't recognize name " + infref[(k - 1), :] + 139 | ' for as a reference for inference') 140 | else: 141 | jref[(k - 1)] = j1 142 | print(' Inference of ' + namei[(k - 1), :] + 143 | ' using ' + nameu[(j1 - 1), :] + '\\n') 144 | jinf[(isnan(jref) - 1)] = np.nan 145 | return nameu, fu, ju, namei, fi, jinf, jref 146 | 147 | 148 | def fixgaps(x): 149 | """FIXGAPS: Linearly interpolates gaps in a time series 150 | YOUT=FIXGAPS(YIN) linearly interpolates over NaN in the input time 151 | series (may be complex), but ignores trailing and leading NaNs. 152 | R. Pawlowicz 11/6/99 153 | Version 1.0 154 | """ 155 | 156 | 157 | #find nans 158 | bd = np.isnan(x) 159 | 160 | #early exit if there are no nans 161 | if not bd.any(): 162 | return x 163 | 164 | #find nonnans index numbers 165 | gd = np.flatnonzero(~bd) 166 | 167 | #ignore leading and trailing nans 168 | bd[:gd.min()]=False 169 | bd[(gd.max()+1):]=False 170 | 171 | #interpolate nans 172 | x[bd] = np.interp(np.flatnonzero(bd),gd,x[gd]) 173 | 174 | return x 175 | 176 | def cluster(ain, clusang): 177 | """CLUSTER: Clusters angles in rows around the angles in the first 178 | column. CLUSANG is the allowable ambiguity (usually 360 degrees but 179 | sometimes 180). 180 | """ 181 | 182 | makearray = (ain - np.repeat(ain[:, 0], 183 | ain.shape[1]).reshape(ain.shape[0], ain.shape[1])) 184 | ii = makearray > clusang / 2 185 | ain[(ii)] = ain[(ii)] - clusang 186 | ii = (ain - np.repeat(ain[:, 0], 187 | ain.shape[1]).reshape(ain.shape[0], ain.shape[1])) < - clusang / 2 188 | ain[(ii)] = ain[(ii)] + clusang 189 | return ain 190 | 191 | 192 | def noise_realizations(xres, fu, dt, nreal, errcalc): 193 | """NOISE_REALIZATIONS: Generates matrices of noise (with correct 194 | cross-correlation structure) for bootstrap analysis. 195 | 196 | R. Pawlowicz 11/10/00 197 | Version 1.0 198 | """ 199 | if errcalc == 'cboot': 200 | fband, Pxrave, Pxiave, Pxcave = residual_spectrum(xres, fu, dt) 201 | aaa, bbb = Pxcave.shape 202 | Pxcave = np.zeros((aaa, bbb), dtype='float64') 203 | # For comparison with other technique! 204 | # print('**** Assuming no covariance between u and v errors!******\n'); 205 | else: 206 | if errcalc == 'wboot': 207 | fband = np.array([0, 0.5]).reshape(1, -1) 208 | nx = max(xres.shape) 209 | A = np.cov(np.real(xres), np.imag(xres)) / nx 210 | Pxrave = np.array([A[0, 0]]) 211 | Pxiave = np.array([A[1, 1]]) 212 | Pxcave = np.array([A[0, 1]]) 213 | else: 214 | sys.exit("Unrecognized type of bootstap analysis specified: '" + 215 | errcalc + "'") 216 | 217 | nfband = fband.shape[0] 218 | Mat = np.zeros(shape=(4, 4, nfband), dtype='float64') 219 | for k in range(1, (nfband + 1)): 220 | # The B matrix represents the covariance matrix for the vector 221 | # [Re{ap} Im{ap} Re{am} Im{am}]' where Re{} and Im{} are real and 222 | # imaginary parts, and ap/m represent the complex constituent 223 | # amplitudes for positive and negative frequencies when the input 224 | # is bivariate white noise. For a flat residual spectrum this works 225 | # fine. 226 | # This is adapted here for "locally white" conditions, but I'm still 227 | # not sure how to handle a complex sxy, so this is set to zero 228 | # right now. 229 | p = (Pxrave[(k - 1)] + Pxiave[(k - 1)]) / 2 230 | d = (Pxrave[(k - 1)] - Pxiave[(k - 1)]) / 2 231 | sxy = Pxcave[(k - 1)] 232 | B = np.hstack([p, 0, d, sxy, 233 | 0, p, sxy, -d, 234 | d, sxy, p, 0, 235 | sxy, -d, 0, p]).reshape(4, 4) 236 | # Compute the transformation matrix that takes uncorrelated white 237 | # noise and makes noise with the same statistical structure as the 238 | # Fourier transformed noise. 239 | 240 | D, V = np.linalg.eigh(B) 241 | 242 | # next five lines are horrible coding/math someone should check it over 243 | # swap so the vectors match matlab, should check if this always holds 244 | V[[1, 0], [1, 3]] = V[[0, 1], [3, 1]] 245 | V[[3, 2], [1, 3]] = V[[2, 3], [3, 1]] 246 | # total cludge to deal with bad zeroing in eigh 247 | D[((D < 0) & (D > -0.00000000001))] = 0 248 | 249 | Mat[:, :, (k - 1)] = np.dot(V, np.diag(np.sqrt(D))) 250 | # print Mat 251 | # Generate realizations for the different analyzed constituents. 252 | N = np.zeros(shape=(4, nreal), dtype='float64') 253 | NM = np.zeros(shape=(max(fu.shape), nreal), dtype='complex128') 254 | NP = np.zeros(shape=(max(fu.shape), nreal), dtype='complex128') 255 | 256 | for k in range(0, fu.shape[0]): 257 | l = np.squeeze(np.flatnonzero(np.all([fu[k] > fband[:, 0], 258 | fu[k] < fband[:, 1]], axis=0))) 259 | N = np.hstack([np.zeros(4,).reshape(-1, 1), 260 | np.dot(np.squeeze(Mat[:, :, l]), 261 | np.random.randn(4, nreal - 1))]) 262 | NP[(k), :] = (N[0, :] + 1j * N[1, :]) 263 | NM[(k), :] = (N[2, :] + 1j * N[3, :]) 264 | 265 | return NP, NM 266 | 267 | 268 | def residual_spectrum(xres, fu, dt): 269 | """RESIDUAL_SPECTRUM: Computes statistics from an input spectrum over 270 | a number of bands, returning the band limits and the estimates for 271 | power spectra for real and imaginary parts and the cross-spectrum. 272 | 273 | Mean values of the noise spectrum are computed for the following 274 | 8 frequency bands defined by their center frequency and band width: 275 | M0 +.1 cpd; M1 +-.2 cpd; M2 +-.2 cpd; M3 +-.2 cpd; M4 +-.2 cpd; 276 | M5 +-.2 cpd; M6 +-.21 cpd; M7 (.26-.29 cpd); and M8 (.30-.50 cpd). 277 | S. Lentz 10/28/99 278 | R. Pawlowicz 11/1/00 279 | Version 1.0 280 | Define frequency bands for spectral averaging. 281 | """ 282 | fband = np.array([[0.0001, 0.00417], 283 | [0.03192, 0.04859], 284 | [0.07218, 0.08884], 285 | [0.11243, 0.1291], 286 | [0.15269, 0.16936], 287 | [0.19295, 0.20961], 288 | [0.2332, 0.251], 289 | [0.26, 0.29], 290 | [0.3, 0.5]]) 291 | 292 | # If we have a sampling interval> 1 hour, we might have to get 293 | # rid of some bins. 294 | # fband(fband(:,1)>1/(2*dt),:)=[]; 295 | nfband = fband.shape[0] 296 | nx = max(xres.shape) 297 | 298 | # Spectral estimate (takes real time series only). 299 | fx, Pxr = sps.welch(np.real(xres), window=np.hanning(nx), 300 | noverlap=np.ceil(nx / 2), nfft=nx, fs=1 / dt, nperseg=nx) 301 | Pxr = Pxr / 2 / dt 302 | fx, Pxi = sps.welch(np.imag(xres), window=np.hanning(nx), 303 | noverlap=np.ceil(nx / 2), nfft=nx, fs=1 / dt, nperseg=nx) 304 | Pxi = Pxi / 2 / dt 305 | #Pxc, fx = mplm.csd(np.real(xres), np.imag(xres), nx, 1 / dt) 306 | fx, Pxc = sps.csd(np.real(xres), np.imag(xres), fs=1 / dt, nperseg=nx, nfft=nx, ) 307 | 308 | # matlab cpsd returns only reals when given a real xres have to 309 | # test for complex and maybe change to ifstatement 310 | Pxc = np.real(Pxc) 311 | Pxc = Pxc / 2 / dt 312 | df = fx[2] - fx[1] 313 | 314 | # Sets Px=NaN in bins close to analyzed frequencies 315 | # to prevent leakage problems?). 316 | Pxr[np.around(fu / df).astype(int)] = np.nan 317 | Pxi[np.around(fu / df).astype(int)] = np.nan 318 | Pxc[np.around(fu / df).astype(int)] = np.nan 319 | 320 | Pxrave = np.zeros(shape=(nfband, 1), dtype='float64') 321 | Pxiave = np.zeros(shape=(nfband, 1), dtype='float64') 322 | Pxcave = np.zeros(shape=(nfband, 1), dtype='float64') 323 | 324 | # Loop downwards in frequency through bands (cures short time series 325 | # problem with no data in lowest band). 326 | # Divide by nx to get power per frequency bin, and multiply by 2 327 | # to account for positive and negative frequencies. 328 | for k in range(nfband - 1, -1, - 1): 329 | jband = np.flatnonzero(np.all(np.vstack([fx >= fband[(k), 0], 330 | fx <= fband[(k), 1], 331 | np.isfinite(Pxr)]).T, axis=1)) 332 | if any(jband): 333 | Pxrave[k] = 2 * np.mean(Pxr[(jband)]) / nx 334 | Pxiave[k] = 2 * np.mean(Pxi[(jband)]) / nx 335 | Pxcave[k] = 2 * np.mean(Pxc[(jband)]) / nx 336 | else: 337 | if k < nfband: 338 | Pxrave[k] = Pxrave[(k + 1)] 339 | # Low frequency bin might not have any points... 340 | Pxiave[k] = Pxiave[(k + 1)] 341 | Pxcave[k] = Pxcave[(k + 1)] 342 | 343 | return fband, Pxrave, Pxiave, Pxcave 344 | 345 | 346 | def noise_stats(xres, fu, dt): 347 | """NOISE_STATS: Computes statistics of residual energy for all 348 | constituents (ignoring any cross-correlations between real and 349 | imaginary parts). 350 | S. Lentz 10/28/99 351 | R. Pawlowicz 11/1/00 352 | Version 1.0 353 | """ 354 | fband, Pxrave, Pxiave, Pxcave = residual_spectrum(xres, fu, dt) 355 | nfband = fband.shape[0] 356 | mu = max(fu.shape) 357 | # Get the statistics for each component. 358 | ercx = np.zeros(shape=(mu, 1), dtype='float64') 359 | eicx = np.zeros(shape=(mu, 1), dtype='float64') 360 | for k1 in range(0, nfband): 361 | k = np.flatnonzero(np.all([fu >= fband[k1, 0], 362 | fu <= fband[k1, 1]], axis=0)) 363 | ercx[(k)] = np.sqrt(Pxrave[(k1)]) 364 | eicx[(k)] = np.sqrt(Pxiave[(k1)]) 365 | return ercx, eicx 366 | 367 | 368 | def errell(cxi, sxi, ercx, ersx, ercy, ersy): 369 | """[emaj,emin,einc,epha]=errell(cx,sx,cy,sy,ercx,ersx,ercy,ersy) computes 370 | the uncertainities in the ellipse parameters based on the 371 | uncertainities in the least square fit cos,sin coefficients. 372 | 373 | INPUT: cx,sx=cos,sin coefficients for x 374 | cy,sy=cos,sin coefficients for y 375 | ercx,ersx=errors in x cos,sin coefficients 376 | ercy,ersy=errors in y cos,sin coefficients 377 | 378 | OUTPUT: emaj=major axis error 379 | emin=minor axis error 380 | einc=inclination error (deg) 381 | epha=pha error (deg) 382 | based on linear error propagation, with errors in the coefficients 383 | cx,sx,cy,sy uncorrelated. 384 | B. Beardsley 1/15/99; 1/20/99 385 | Version 1.0 386 | """ 387 | r2d = 180.0 / np.pi 388 | cx = np.real(cxi[:]) 389 | sx = np.real(sxi[:]) 390 | cy = np.imag(cxi[:]) 391 | sy = np.imag(sxi[:]) 392 | ercx = ercx[:] 393 | ersx = ersx[:] 394 | ercy = ercy[:] 395 | ersy = ersy[:] 396 | rp = 0.5 * np.sqrt((cx + sy) ** 2 + (cy - sx) ** 2) 397 | rm = 0.5 * np.sqrt((cx - sy) ** 2 + (cy + sx) ** 2) 398 | ercx2 = ercx ** 2 399 | ersx2 = ersx ** 2 400 | ercy2 = ercy ** 2 401 | ersy2 = ersy ** 2 402 | # major axis error 403 | ex = (cx + sy) / rp 404 | fx = (cx - sy) / rm 405 | gx = (sx - cy) / rp 406 | hx = (sx + cy) / rm 407 | dcx2 = (0.25 * (ex + fx)) ** 2 408 | dsx2 = (0.25 * (gx + hx)) ** 2 409 | dcy2 = (0.25 * (hx - gx)) ** 2 410 | dsy2 = (0.25 * (ex - fx)) ** 2 411 | emaj = np.sqrt(dcx2 * ercx2 + dsx2 * ersx2 + 412 | dcy2 * ercy2 + dsy2 * ersy2) 413 | # minor axis error 414 | dcx2 = (0.25 * (ex - fx)) ** 2 415 | dsx2 = (0.25 * (gx - hx)) ** 2 416 | dcy2 = (0.25 * (hx + gx)) ** 2 417 | dsy2 = (0.25 * (ex + fx)) ** 2 418 | emin = np.sqrt(dcx2 * ercx2 + dsx2 * ersx2 + 419 | dcy2 * ercy2 + dsy2 * ersy2) 420 | # inclination error 421 | rn = 2.0 * (cx * cy + sx * sy) 422 | rd = cx ** 2 + sx ** 2 - (cy ** 2 + sy ** 2) 423 | den = rn ** 2 + rd ** 2 424 | dcx2 = ((rd * cy - rn * cx) / den) ** 2 425 | dsx2 = ((rd * sy - rn * sx) / den) ** 2 426 | dcy2 = ((rd * cx + rn * cy) / den) ** 2 427 | dsy2 = ((rd * sx + rn * sy) / den) ** 2 428 | einc = r2d * np.sqrt(dcx2 * ercx2 + dsx2 * ersx2 + 429 | dcy2 * ercy2 + dsy2 * ersy2) 430 | # phase error 431 | rn = 2.0 * (cx * sx + cy * sy) 432 | rd = cx ** 2 - sx ** 2 + cy ** 2 - sy ** 2 433 | den = rn ** 2 + rd ** 2 434 | dcx2 = ((rd * sx - rn * cx) / den) ** 2 435 | dsx2 = ((rd * cx + rn * sx) / den) ** 2 436 | dcy2 = ((rd * sy - rn * cy) / den) ** 2 437 | dsy2 = ((rd * cy + rn * sy) / den) ** 2 438 | epha = r2d * np.sqrt(dcx2 * ercx2 + dsx2 * ersx2 + 439 | dcy2 * ercy2 + dsy2 * ersy2) 440 | 441 | return emaj, emin, einc, epha 442 | 443 | 444 | def variance_str(out): 445 | '''Takes the out dictionary and prints the variance text''' 446 | 447 | x = np.var(out['xingd'].real, ddof=1) 448 | xp = np.var(out['xoutgd'].real, ddof=1) 449 | xr = np.var(out['xresgd'].real, ddof=1) 450 | z0r = out['z0'].real 451 | dz0r = out['dz0'].real 452 | 453 | outstr = 'x0= {:.3g} xtrend= {:.3g}\n'.format(z0r, dz0r) 454 | outstr += ('var(data)= {:.2f}' + ' ' * 4 + 455 | 'var(prediction)= {:.2f}' + ' ' * 4 + 456 | 'var(residual)= {:.2f}\n').format(x, xp, xr) 457 | outstr += 'var(prediction)/var(data) (%%) = %.1f\n\n' % (100 * xp / x) 458 | 459 | if np.iscomplexobj(out['xin']): 460 | y = np.var(out['xingd'].imag, ddof=1) 461 | yp = np.var(out['xoutgd'].imag, ddof=1) 462 | yr = np.var(out['xresgd'].imag, ddof=1) 463 | z0r = out['z0'].imag 464 | dz0r = out['dz0'].imag 465 | 466 | outstr += 'y0= {:.3g} ytrend= {:.3g}\n'.format(z0r, dz0r) 467 | outstr += ('var(data)= {:.2f}' + ' ' * 4 + 468 | 'var(prediction)= {:.2f}' + ' ' * 4 + 469 | 'var(residual)= {:.2f}\n').format(y, yp, yr) 470 | outstr += 'var(prediction)/var(data) (%) = {:.1f}\n\n'.format( 471 | 100 * yp / y) 472 | 473 | outstr += 'total_var= {:f} pred_var= {:f}\n'.format( 474 | (x + y), (xp + yp)) 475 | outstr += 'total_var/pred_var (%) = {:.1f} \n'.format( 476 | 100 * (xp + yp) / (x + y)) 477 | return outstr 478 | 479 | 480 | def classic_style(out): 481 | outstr = '-' * 35 + '\n' 482 | outstr += ('nobs = %d \nngood = %d \nrecord length (days) = %.2f' % 483 | (out['nobs'], out['ngood'], 484 | np.dot(max(out['xin'].shape), out['dt']) / 24)) + '\n' 485 | if ('stime' in out): 486 | outstr += 'start time: {}\n'.format( 487 | time.num2date(out['stime']).strftime('%Y-%m-%d %H:%M:%S')) 488 | outstr += ('rayleigh criterion = %.1f\n\n' % out['ray']) 489 | outstr += ('%s\n' % out['nodcor']) 490 | outstr += variance_str(out) 491 | 492 | if out['isComplex']: 493 | outstr += (' ' * 32 + 'ellipse parameters with 95 % CI estimates\n') 494 | outstr += (' tide freq major emaj' + 495 | ' minor emin inc einc' + 496 | ' pha epha snr\n') 497 | fmt = ('{star} {name} {fuk:9.7f} ' 498 | '{c[0]:9.4f} {c[1]:8.3f} {c[2]:9.4f} {c[3]:8.3f} ' 499 | '{c[4]:8.2f} {c[5]:8.2f} {c[6]:8.2f} {c[7]:8.2f} ' 500 | '{snr:8.2g}\n') 501 | for k, fuk in enumerate(out['fu']): 502 | if out['snr'][k] > out['synth']: 503 | star = '*' 504 | else: 505 | star = ' ' 506 | outstr += fmt.format(star=star, 507 | name=out['nameu'][k].decode(enc), 508 | fuk=fuk, 509 | c=out['tidecon'][k], 510 | snr=out['snr'][k]) 511 | else: 512 | outstr += ' tidal amplitude and phase with 95 % CI estimates\n' 513 | outstr += (' tide freq amp amp_err' + 514 | ' pha pha_err snr\n') 515 | fmt = ('{star} {name} {fuk:9.7f} ' 516 | '{c[0]:9.4f} {c[1]:8.3f} {c[2]:8.2f} {c[3]:8.2f} ' 517 | '{snr:8.2g}\n') 518 | for k, fuk in enumerate(out['fu']): 519 | if out['snr'][k] > out['synth']: 520 | star = '*' 521 | else: 522 | star = ' ' 523 | outstr += fmt.format(star=star, 524 | name=out['nameu'][k].decode(enc), 525 | fuk=fuk, 526 | c=out['tidecon'][k], 527 | snr=out['snr'][k]) 528 | return outstr 529 | 530 | 531 | def pandas_style(out, dfTF=False): 532 | if pd is None: 533 | # Unable to import pandas. 534 | print("pandas is not available, falling back to out_style='classic'.") 535 | return classic_style(out) 536 | spacer = 70 537 | if out['isComplex']: 538 | spacer = 116 539 | outstr = '=' * spacer + '\n' 540 | 541 | outstr += ('Number of observations = %d' % out['nobs']) + '\n' 542 | outstr += ('Number of observations used = %d' % out['ngood']) + '\n' 543 | outstr += ('Record length (days) = %.2f' % (out['nobs'] * out['dt'] / 24.0)) + '\n' 544 | 545 | if ('stime' in out): 546 | outstr += ('Start time: %s\n' % 547 | time.num2date(out['stime']).strftime('%Y-%m-%d %H:%M:%S')) + '\n' 548 | outstr += ('%s\n' % out['nodcor']) + '\n' 549 | outstr += variance_str(out) 550 | 551 | names = np.array([name.decode(enc) for name in out['nameu']]) 552 | fmt = {'Freq': '{:,.6f}'.format, 'Major': '{:,.2f}'.format, 553 | 'Major Err': '{:,.2f}'.format, 'Minor': '{:,.2f}'.format, 554 | 'Minor Err': '{:,.2f}'.format, 'Inc': '{:,.1f}'.format, 555 | 'Inc Err': '{:,.1f}'.format, 'Phase': '{:,.1f}'.format, 556 | 'Phase Err': '{:,.1f}'.format, 'SNR': '{:,.1g}'.format, 557 | 'Amp': '{:,.2f}'.format, 'Amp Err': '{:,.2f}'.format} 558 | 559 | if out['isComplex']: 560 | colnames = ['Freq', 'Major', 'Major Err', 'Minor', 'Minor Err', 561 | 'Inc', 'Inc Err', 'Phase', 'Phase Err', 'SNR'] 562 | outstr += (' ' * 35 + 'Ellipse parameters with 95 % CI estimates') + '\n' 563 | else: 564 | colnames = ['Freq', 'Amp', 'Amp Err', 'Phase', 'Phase Err', 'SNR'] 565 | outstr += (' ' * 12 + 'Tidal amplitude and phase with 95 % CI estimates') + '\n' 566 | 567 | dfdata = np.vstack([out['fu'], out['tidecon'].T, out['snr']]).T 568 | df = pd.DataFrame(dfdata, names, colnames) 569 | df.index.name = 'Tide' 570 | outstr += (df.to_string(col_space=10, formatters=fmt)) + '\n' 571 | 572 | outstr += ('=' * spacer) + '\n' 573 | if dfTF: 574 | return outstr, df 575 | else: 576 | return outstr 577 | -------------------------------------------------------------------------------- /ttide/t_vuf.py: -------------------------------------------------------------------------------- 1 | from __future__ import division 2 | import numpy as np 3 | import scipy as sp 4 | from .t_astron import t_astron 5 | from .t_getconsts import t_getconsts 6 | 7 | 8 | def t_vuf(ltype, ctime, ju, lat=None): 9 | """T_VUF Computes nodal modulation corrections. 10 | [V,U,F]=T_VUF(TYPE,DATE,JU,LAT) returns the astronomical phase V, the 11 | nodal phase modulation U, and the nodal amplitude correction F at 12 | a decimal date DATE for the components specified by index JU 13 | at a latitude LAT. 14 | 15 | TYPE is either 'full' for the 18.6 year set of constitunets, or 'nodal' 16 | for the 1-year set with satellite modulations. 17 | 18 | If LAT is not specified, then the Greenwich phase V is computed with 19 | U=0 and F=1. 20 | 21 | Note that V and U are in 'cycles', not degrees or radians (i.e., 22 | multiply by 360 to get degrees). 23 | 24 | If LAT is set to NaN, then the nodal corrections are computed for all 25 | satellites that do *not* have a "latitude-dependent" correction 26 | factor. This is for compatibility with the ways things are done in 27 | the xtide package. (The latitude-dependent corrections were zeroed 28 | out there partly because it was convenient, but this was rationalized 29 | by saying that since the forcing of tides can occur at latitudes 30 | other than where they are observed, the idea that observations have 31 | the equilibrium latitude-dependence is possibly bogus anyway). 32 | Get all the info about constituents. 33 | Calculate astronomical arguments at mid-point of data time series. 34 | """ 35 | 36 | astro, ader = t_astron(ctime) 37 | 38 | if ltype == 'full': 39 | const = t_get18consts(ctime) 40 | # Phase relative to Greenwich (in units of cycles). 41 | v = rem(np.dot(const.doodson, astro) + const.semi, 1) 42 | v = v[(ju - 1)] 43 | u = np.zeros(shape=(v.shape, v.shape), dtype='float64') 44 | f = np.ones(shape=(v.shape, v.shape), dtype='float64') 45 | else: 46 | const, sat, shallow = t_getconsts(ctime) 47 | # Phase relative to Greenwich (in units of cycles). 48 | # (This only returns values when we have doodson#s, 49 | # i.e., not for the shallow water components, 50 | # but these will be computed later.) 51 | v = np.fmod(np.dot(const['doodson'], astro) + const['semi'], 1) 52 | 53 | if lat is not None: 54 | # If we have a latitude, get nodal corrections. 55 | # Apparently the second-order terms in the tidal potential 56 | # go to zero at the equator, but the third-order terms 57 | # do not. Hence when trying to infer the third-order terms 58 | # from the second-order terms, the nodal correction factors 59 | # blow up. In order to prevent this, it is assumed that the 60 | # equatorial forcing is due to second-order forcing OFF the 61 | # equator, from about the 5 degree location. Latitudes are 62 | # hence (somewhat arbitrarily) forced to be no closer than 63 | # 5 deg to the equator, as per note in Foreman. 64 | if abs(lat) < 5: 65 | lat = np.sign(lat) * 5 66 | slat = np.sin(np.pi * lat / 180) 67 | # Satellite amplitude ratio adjustment for latitude. 68 | rr = sat['amprat'] 69 | # no amplitude correction 70 | if np.isfinite(lat): 71 | j = np.flatnonzero(sat['ilatfac'] == 1) 72 | # latitude correction for diurnal constituents 73 | rr[j] = rr[j] * 0.36309 * (1.0 - 5.0 * slat * slat) / slat 74 | j = np.flatnonzero(sat['ilatfac'] == 2) 75 | # latitude correction for semi-diurnal constituents 76 | rr[j] = rr[j] * 2.59808 * slat 77 | else: 78 | rr[sat['ilatfac'] > 0] = 0 79 | # Calculate nodal amplitude and phase corrections. 80 | uu = np.fmod(np.dot(sat['deldood'], astro.T[ 81 | 3:6]) + sat['phcorr'], 1) 82 | # uu=uudbl-round(uudbl); <_ I think this was wrong. 83 | # The original 84 | # FORTRAN code is: IUU=UUDBL 85 | # UU=UUDBL-IUU 86 | # which is truncation. 87 | # Sum up all of the satellite factors for all satellites. 88 | nsat = np.max(sat['iconst'].shape) 89 | nfreq = np.max(const['isat'].shape) 90 | 91 | fsum = np.array(1 + sp.sparse.csr_matrix( 92 | (np.squeeze(rr * np.exp(1j * 2 * np.pi * uu)), 93 | (np.arange(0, nsat), np.squeeze(sat['iconst'] - 1))), 94 | shape=(nsat, nfreq)).sum(axis=0)).flatten() 95 | 96 | f = np.absolute(fsum) 97 | u = np.angle(fsum) / (2 * np.pi) 98 | 99 | # Compute amplitude and phase corrections 100 | # for shallow water constituents. 101 | shallow_m1 = const['ishallow'].astype(int) -1 102 | iname_m1 = shallow['iname'].astype(int) -1 103 | coefs = shallow['coef'].astype(np.float64) 104 | range_cache = {n:np.arange(n) for n in range(const['nshallow'].max()+1)} 105 | for k in np.flatnonzero(np.isfinite(const['ishallow'])): 106 | ik = shallow_m1[k] + range_cache[const['nshallow'][k]] 107 | iname = iname_m1[ik] 108 | coef = coefs[ik] 109 | f[k] = np.multiply.reduce(np.power(f[iname], coef)) 110 | u[k] = u[iname].dot(coef) 111 | v[k] = v[iname].dot(coef) 112 | 113 | f = f[ju] 114 | u = u[ju] 115 | v = v[ju] 116 | 117 | else: 118 | # Astronomical arguments only, no nodal corrections. 119 | # Compute phases for shallow water constituents. 120 | for k in np.flatnonzero(np.isfinite(const['ishallow'])): 121 | ik = ((const['ishallow'][k] - 1 + 122 | np.array(range(0, const['nshallow'][k]))).astype(int)) 123 | v[k] = np.dot(v[shallow['iname'][ik] - 1], shallow['coef'][ik]) 124 | 125 | v = v[ju] 126 | f = np.ones(len(v)) 127 | u = np.zeros(len(v)) 128 | 129 | return v, u, f 130 | -------------------------------------------------------------------------------- /ttide/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moflaher/ttide_py/60b10119e0d984aa2502d4075fd5267ec703491e/ttide/tests/__init__.py -------------------------------------------------------------------------------- /ttide/tests/base.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import os 3 | 4 | try: 5 | testdir = os.path.dirname(os.path.realpath(__file__)) + '/' 6 | except NameError: 7 | testdir = 'tests/' 8 | 9 | t = np.arange(1001) 10 | m2_freq = 2 * np.pi / 12.42 11 | shallow_freq = 2 * np.pi / 2.484120261 12 | 13 | # Build an M2 tidal series with 5m elevation 14 | ein = 5 * np.cos(m2_freq * t) 15 | sin = ein + 1 * np.cos(shallow_freq * t) 16 | 17 | # Build an M2 tidal series for current 18 | # Use to 2m/s horizontal currents and .5m/s vertical currents 19 | uin = 2 * np.cos(m2_freq * t) 20 | vin = 0.5 * np.cos(m2_freq * t) 21 | uvin = uin + 1j * vin 22 | 23 | 24 | # These are (arguments, fname) 25 | cases = [ 26 | ######################################################################## 27 | # Elevation Test Cases 28 | ######################################################################## 29 | 30 | # Basic test case 31 | (dict(xin=ein), 'NoArgs.elev'), 32 | # No output test case 33 | (dict(xin=ein, out_style=None), 'NoOutput.elev'), 34 | # Pandas output case 35 | (dict(xin=ein, out_style='pandas'), 'PandasOut.elev'), 36 | # M2 tides only 37 | (dict(xin=ein, constitnames=['M2']), 'M2only.elev'), 38 | # 5 tidal constituents (all should basically be zero other then M2) 39 | (dict(xin=ein, constitnames=['M2', 'N2', 'S2', 'K1', 'O1']), '5constit.elev'), 40 | # M2 tides with a starttime 41 | (dict(xin=ein, constitnames=['M2'], stime=768000), 'M2only-Stime.elev'), 42 | # M2 tides with a starttime and latitude 43 | (dict(xin=ein, constitnames=['M2'], stime=768000, lat=45), 'M2only-Stime-lat.elev'), 44 | 45 | ######################################################################## 46 | # Shallow Test Cases 47 | ######################################################################## 48 | 49 | # M2 tides and shallow 50 | (dict(xin=sin, constitnames=['M2'], shallownames=['M10']), 'M2.shallowM10'), 51 | # M2 tides and shallow and start_time 52 | (dict(xin=sin, constitnames=['M2'], stime=768000, shallownames=['M10']), 'M2-Stime.shallowM10'), 53 | 54 | ######################################################################## 55 | # Current Test Cases 56 | ######################################################################## 57 | 58 | # Basic test case 59 | (dict(xin=uvin), 'NoArgs.vel'), 60 | # No output test case 61 | (dict(xin=uvin, out_style=None), 'NoOutput.vel'), 62 | # Pandas output case 63 | (dict(xin=uvin, out_style='pandas'), 'PandasOut.vel'), 64 | # M2 tides only 65 | (dict(xin=uvin, constitnames=['M2']), 'M2only.vel'), 66 | # 5 tidal constituents (all should basically be zero other then M2) 67 | (dict(xin=uvin, constitnames=['M2', 'N2', 'S2', 'K1', 'O1']), '5constit.vel'), 68 | # M2 tides with a starttime 69 | (dict(xin=uvin, constitnames=['M2'], stime=768000), 'M2only-Stime.vel'), 70 | # M2 tides with a starttime and latitude 71 | (dict(xin=uvin, constitnames=['M2'], stime=768000, lat=45), 'M2only-Stime-lat.vel'), 72 | ] 73 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/5constit.elev: -------------------------------------------------------------------------------- 1 | 4.92624 2 | -3.90823 3 | 1.93114 4 | 0.51914 5 | -2.84186 6 | 4.46784 7 | -4.99765 8 | 4.30010 9 | -2.54617 10 | 0.16746 11 | 2.25137 12 | -4.11734 13 | 4.97350 14 | -4.60948 15 | 3.11344 16 | -0.85229 17 | -1.61795 18 | 3.69015 19 | -4.85625 20 | 4.83102 21 | -3.62051 22 | 1.52091 23 | 0.95271 24 | -3.19241 25 | 4.64788 26 | -4.96225 27 | 4.05899 28 | -2.15971 29 | -0.26993 30 | 2.63363 31 | -4.35078 32 | 4.99973 33 | -4.42145 34 | 2.75802 35 | -0.41752 36 | -2.02562 37 | 3.97142 38 | -4.94214 39 | 4.69984 40 | -3.30427 41 | 1.09762 42 | 1.37895 43 | -3.51725 44 | 4.79170 45 | -4.88946 46 | 3.78737 47 | -1.75632 48 | -0.70588 49 | 2.99561 50 | -4.55038 51 | 4.98749 52 | -4.19963 53 | 2.38130 54 | 0.02063 55 | -2.41745 56 | 4.22181 57 | -4.99034 58 | 4.53320 59 | -2.96251 60 | 0.66494 61 | 1.79491 62 | -3.81404 63 | 4.89779 64 | -4.77982 65 | 3.48801 66 | -1.33928 67 | -1.13799 68 | 3.33519 69 | -4.71358 70 | 4.93553 71 | -3.94633 72 | 1.98811 73 | 0.45856 74 | -2.79255 75 | 4.44068 76 | -4.99877 77 | 4.33009 78 | -2.59858 79 | 0.22902 80 | 2.19676 81 | -4.08314 82 | 4.96729 83 | -4.63238 84 | 3.16037 85 | -0.91225 86 | -1.55991 87 | 3.64876 88 | -4.84163 89 | 4.84641 90 | -3.66212 91 | 1.57875 92 | 0.89286 93 | -3.14548 94 | 4.62528 95 | -4.96919 96 | 4.09386 97 | -2.21445 98 | -0.20868 99 | 2.58152 100 | -4.32099 101 | 4.99897 102 | -4.44919 103 | 2.80779 104 | -0.47810 105 | -1.96901 106 | 3.93373 107 | -4.93324 108 | 4.72107 109 | -3.34935 110 | 1.15586 111 | 1.32055 112 | -3.47278 113 | 4.77330 114 | -4.90248 115 | 3.82776 116 | -1.81295 117 | -0.64664 118 | 2.94700 119 | -4.52397 120 | 4.99086 121 | -4.23279 122 | 2.43546 123 | -0.04017 124 | -2.36482 125 | 4.18924 126 | -4.98549 127 | 4.55803 128 | -3.01152 129 | 0.72570 130 | 1.73797 131 | -3.77481 132 | 4.88537 133 | -4.79715 134 | 3.53119 135 | -1.39786 136 | -1.07863 137 | 3.28970 138 | -4.69289 139 | 4.94471 140 | -3.98346 141 | 2.04410 142 | 0.39788 143 | -2.74231 144 | 4.41272 145 | -4.99943 146 | 4.35960 147 | -2.65049 148 | 0.29053 149 | 2.14173 150 | -4.04847 151 | 4.96059 152 | -4.65445 153 | 3.20636 154 | -0.97205 155 | -1.50100 156 | 3.60647 157 | -4.82691 158 | 4.86184 159 | -3.70285 160 | 1.63531 161 | 0.83304 162 | -3.09697 163 | 4.60125 164 | -4.97623 165 | 4.12933 166 | -2.26858 167 | -0.14881 168 | 2.52945 169 | -4.28931 170 | 4.99644 171 | -4.47703 172 | 2.85854 173 | -0.53854 174 | -1.91351 175 | 3.89606 176 | -4.92254 177 | 4.74052 178 | -3.39442 179 | 1.21516 180 | 1.26182 181 | -3.42886 182 | 4.75480 183 | -4.91410 184 | 3.86677 185 | -1.86953 186 | -0.58656 187 | 2.89781 188 | -4.49740 189 | 4.99379 190 | -4.26508 191 | 2.48902 192 | -0.10104 193 | -2.31174 194 | 4.15613 195 | -4.97988 196 | 4.58195 197 | -3.06011 198 | 0.78677 199 | 1.68060 200 | -3.73554 201 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/5constit.vel: -------------------------------------------------------------------------------- 1 | 1.97049 2 | 0.49262 3 | -1.56329 4 | -0.39082 5 | 0.77246 6 | 0.19311 7 | 0.20766 8 | 0.05191 9 | -1.13675 10 | -0.28419 11 | 1.78714 12 | 0.44678 13 | -1.99906 14 | -0.49977 15 | 1.72004 16 | 0.43001 17 | -1.01847 18 | -0.25462 19 | 0.06699 20 | 0.01675 21 | 0.90055 22 | 0.22514 23 | -1.64693 24 | -0.41173 25 | 1.98940 26 | 0.49735 27 | -1.84379 28 | -0.46095 29 | 1.24538 30 | 0.31134 31 | -0.34092 32 | -0.08523 33 | -0.64718 34 | -0.16179 35 | 1.47606 36 | 0.36901 37 | -1.94250 38 | -0.48563 39 | 1.93241 40 | 0.48310 41 | -1.44820 42 | -0.36205 43 | 0.60836 44 | 0.15209 45 | 0.38108 46 | 0.09527 47 | -1.27697 48 | -0.31924 49 | 1.85915 50 | 0.46479 51 | -1.98490 52 | -0.49623 53 | 1.62360 54 | 0.40590 55 | -0.86388 56 | -0.21597 57 | -0.10797 58 | -0.02699 59 | 1.05345 60 | 0.26336 61 | -1.74031 62 | -0.43508 63 | 1.99989 64 | 0.49997 65 | -1.76858 66 | -0.44214 67 | 1.10321 68 | 0.27580 69 | -0.16701 70 | -0.04175 71 | -0.81025 72 | -0.20256 73 | 1.58857 74 | 0.39714 75 | -1.97685 76 | -0.49421 77 | 1.87994 78 | 0.46998 79 | -1.32171 80 | -0.33043 81 | 0.43905 82 | 0.10976 83 | 0.55158 84 | 0.13790 85 | -1.40690 86 | -0.35173 87 | 1.91668 88 | 0.47917 89 | -1.95578 90 | -0.48895 91 | 1.51495 92 | 0.37874 93 | -0.70253 94 | -0.17563 95 | -0.28235 96 | -0.07059 97 | 1.19824 98 | 0.29956 99 | -1.82015 100 | -0.45504 101 | 1.99499 102 | 0.49875 103 | -1.67985 104 | -0.41996 105 | 0.95252 106 | 0.23813 107 | 0.00825 108 | 0.00206 109 | -0.96698 110 | -0.24174 111 | 1.68872 112 | 0.42218 113 | -1.99613 114 | -0.49903 115 | 1.81328 116 | 0.45332 117 | -1.18500 118 | -0.29625 119 | 0.26598 120 | 0.06649 121 | 0.71796 122 | 0.17949 123 | -1.52561 124 | -0.38140 125 | 1.95912 126 | 0.48978 127 | -1.91193 128 | -0.47798 129 | 1.39520 130 | 0.34880 131 | -0.53571 132 | -0.13393 133 | -0.45520 134 | -0.11380 135 | 1.33408 136 | 0.33352 137 | -1.88543 138 | -0.47136 139 | 1.97421 140 | 0.49355 141 | -1.57853 142 | -0.39463 143 | 0.79524 144 | 0.19881 145 | 0.18343 146 | 0.04586 147 | -1.11702 148 | -0.27925 149 | 1.77627 150 | 0.44407 151 | -1.99951 152 | -0.49988 153 | 1.73204 154 | 0.43301 155 | -1.03943 156 | -0.25986 157 | 0.09161 158 | 0.02290 159 | 0.87870 160 | 0.21968 161 | -1.63326 162 | -0.40831 163 | 1.98692 164 | 0.49673 165 | -1.85295 166 | -0.46324 167 | 1.26415 168 | 0.31604 169 | -0.36490 170 | -0.09123 171 | -0.62396 172 | -0.15599 173 | 1.45950 174 | 0.36488 175 | -1.93665 176 | -0.48416 177 | 1.93856 178 | 0.48464 179 | -1.46485 180 | -0.36621 181 | 0.63150 182 | 0.15788 183 | 0.35714 184 | 0.08929 185 | -1.25819 186 | -0.31455 187 | 1.85011 188 | 0.46253 189 | -1.98768 190 | -0.49692 191 | 1.63754 192 | 0.40939 193 | -0.88578 194 | -0.22144 195 | -0.08347 196 | -0.02087 197 | 1.03261 198 | 0.25815 199 | -1.72839 200 | -0.43210 201 | 1.99959 202 | 0.49990 203 | -1.77968 204 | -0.44492 205 | 1.12311 206 | 0.28078 207 | -0.19124 208 | -0.04781 209 | -0.78760 210 | -0.19690 211 | 1.57349 212 | 0.39337 213 | -1.97329 214 | -0.49332 215 | 1.88843 216 | 0.47211 217 | -1.33974 218 | -0.33494 219 | 0.46234 220 | 0.11559 221 | 0.52822 222 | 0.13205 223 | -1.38911 224 | -0.34728 225 | 1.90932 226 | 0.47733 227 | -1.96099 228 | -0.49025 229 | 1.53110 230 | 0.38278 231 | -0.72518 232 | -0.18130 233 | -0.25866 234 | -0.06466 235 | 1.17880 236 | 0.29470 237 | -1.80959 238 | -0.45240 239 | 1.99634 240 | 0.49909 241 | -1.69312 242 | -0.42328 243 | 0.97419 244 | 0.24355 245 | -0.01607 246 | -0.00402 247 | -0.94593 248 | -0.23648 249 | 1.67570 250 | 0.41892 251 | -1.99420 252 | -0.49855 253 | 1.82321 254 | 0.45580 255 | -1.20461 256 | -0.30115 257 | 0.29028 258 | 0.07257 259 | 0.69519 260 | 0.17380 261 | -1.50992 262 | -0.37748 263 | 1.95415 264 | 0.48854 265 | -1.91886 266 | -0.47971 267 | 1.41248 268 | 0.35312 269 | -0.55914 270 | -0.13979 271 | -0.43145 272 | -0.10786 273 | 1.31588 274 | 0.32897 275 | -1.87716 276 | -0.46929 277 | 1.97788 278 | 0.49447 279 | -1.59338 280 | -0.39835 281 | 0.81764 282 | 0.20441 283 | 0.15915 284 | 0.03979 285 | -1.09692 286 | -0.27423 287 | 1.76509 288 | 0.44127 289 | -1.99977 290 | -0.49994 291 | 1.74384 292 | 0.43596 293 | -1.06020 294 | -0.26505 295 | 0.11621 296 | 0.02905 297 | 0.85669 298 | 0.21417 299 | -1.61939 300 | -0.40485 301 | 1.98423 302 | 0.49606 303 | -1.86178 304 | -0.46544 305 | 1.28254 306 | 0.32064 307 | -0.38882 308 | -0.09721 309 | -0.60040 310 | -0.15010 311 | 1.44259 312 | 0.36065 313 | -1.93076 314 | -0.48269 315 | 1.94474 316 | 0.48618 317 | -1.48114 318 | -0.37028 319 | 0.65412 320 | 0.16353 321 | 0.33321 322 | 0.08330 323 | -1.23879 324 | -0.30970 325 | 1.84050 326 | 0.46012 327 | -1.99049 328 | -0.49762 329 | 1.65173 330 | 0.41293 331 | -0.90743 332 | -0.22686 333 | -0.05952 334 | -0.01488 335 | 1.01178 336 | 0.25294 337 | -1.71572 338 | -0.42893 339 | 1.99858 340 | 0.49964 341 | -1.79081 342 | -0.44770 343 | 1.14342 344 | 0.28585 345 | -0.21541 346 | -0.05385 347 | -0.76540 348 | -0.19135 349 | 1.55843 350 | 0.38961 351 | -1.96902 352 | -0.49225 353 | 1.89621 354 | 0.47405 355 | -1.35777 356 | -0.33944 357 | 0.48606 358 | 0.12152 359 | 0.50473 360 | 0.12618 361 | -1.37154 362 | -0.34289 363 | 1.90192 364 | 0.47548 365 | -1.96564 366 | -0.49141 367 | 1.54671 368 | 0.38668 369 | -0.74781 370 | -0.18695 371 | -0.23462 372 | -0.05866 373 | 1.15912 374 | 0.28978 375 | -1.79896 376 | -0.44974 377 | 1.99751 378 | 0.49938 379 | -1.70603 380 | -0.42651 381 | 0.99561 382 | 0.24890 383 | -0.04042 384 | -0.01010 385 | -0.92470 386 | -0.23117 387 | 1.66245 388 | 0.41561 389 | -1.99195 390 | -0.49799 391 | 1.83278 392 | 0.45820 393 | -1.22404 394 | -0.30601 395 | 0.31471 396 | 0.07868 397 | 0.67224 398 | 0.16806 399 | -1.49422 400 | -0.37355 401 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/M2-Stime.shallowM10: -------------------------------------------------------------------------------- 1 | 2.89314 2 | -4.60200 3 | 5.62177 4 | -2.92268 5 | 2.82241 6 | 0.95833 7 | -3.02124 8 | 3.73624 9 | -5.99056 10 | 3.43514 11 | -2.94364 12 | 0.39938 13 | 3.01346 14 | -3.11874 15 | 5.81246 16 | -4.26007 17 | 2.83647 18 | -1.64949 19 | -2.61527 20 | 2.87773 21 | -5.15834 22 | 5.15691 23 | -2.79677 24 | 2.52134 25 | 1.73130 26 | -2.93603 27 | 4.27475 28 | -5.81430 29 | 3.06398 30 | -2.90946 31 | -0.47401 32 | 3.04976 33 | -3.47260 34 | 5.99001 35 | -3.70791 36 | 2.91603 37 | -0.88201 38 | -2.92346 39 | 2.98740 40 | -5.62015 41 | 4.59337 42 | -2.79908 43 | 2.01945 44 | 2.34924 45 | -2.87442 46 | 4.84793 47 | -5.43867 48 | 2.85014 49 | -2.71705 50 | -1.30640 51 | 2.98673 52 | -3.95898 53 | 5.94163 54 | -3.25693 55 | 2.94472 56 | -0.02374 57 | -3.04580 58 | 3.25250 59 | -5.91555 60 | 4.01395 61 | -2.87182 62 | 1.33490 63 | 2.77261 64 | -2.90709 65 | 5.37343 66 | -4.92158 67 | 2.78486 68 | -2.32958 69 | -2.01948 70 | 2.90210 71 | -4.52202 72 | 5.67420 73 | -2.95229 74 | 2.84888 75 | 0.84243 76 | -3.03043 77 | 3.66846 78 | -5.99731 79 | 3.49795 80 | -2.93923 81 | 0.51890 82 | 2.99678 83 | -3.08195 84 | 5.77122 85 | -4.34090 86 | 2.82595 87 | -1.74473 88 | -2.55652 89 | 2.87348 90 | -5.08500 91 | 5.22908 92 | -2.80558 93 | 2.57507 94 | 1.63207 95 | -2.94822 96 | 4.19621 97 | -5.85163 98 | 3.10630 99 | -2.92245 100 | -0.35339 101 | 3.05230 102 | -3.41468 103 | 5.97859 104 | -3.77983 105 | 2.90622 106 | -0.99562 107 | -2.89255 108 | 2.96323 109 | -5.56461 110 | 4.67439 111 | -2.79300 112 | 2.10076 113 | 2.27461 114 | -2.87875 115 | 4.76937 116 | -5.50080 117 | 2.87035 118 | -2.75489 119 | -1.19648 120 | 2.99860 121 | -3.88540 122 | 5.96197 123 | -3.31143 124 | 2.94667 125 | -0.14521 126 | -3.03844 127 | 3.20624 128 | -5.88660 129 | 4.09219 130 | -2.86023 131 | 1.43916 132 | 2.72607 133 | -2.89484 134 | 5.30648 135 | -4.99899 136 | 2.78629 137 | -2.39545 138 | -1.93011 139 | 2.91215 140 | -4.44206 141 | 5.72317 142 | -2.98499 143 | 2.87188 144 | 0.72503 145 | -3.03833 146 | 3.60287 147 | -5.99963 148 | 3.56320 149 | -2.93319 150 | 0.63732 151 | 2.97680 152 | -3.04825 153 | 5.72626 154 | -4.42211 155 | 2.81619 156 | -1.83676 157 | -2.49385 158 | 2.87155 159 | -5.01003 160 | 5.29912 161 | -2.81702 162 | 2.62488 163 | 1.52997 164 | -2.96066 165 | 4.11857 166 | -5.88497 167 | 3.15167 168 | -2.93249 169 | -0.23220 170 | 3.05271 171 | -3.35947 172 | 5.96281 173 | -3.85357 174 | 2.89564 175 | -1.10725 176 | -2.85792 177 | 2.94208 178 | -5.50601 179 | 4.75488 180 | -2.78848 181 | 2.17841 182 | 2.19624 183 | -2.88476 184 | 4.69011 185 | -5.55999 186 | 2.89354 187 | -2.78899 188 | -1.08441 189 | 3.00983 190 | -3.81351 191 | 5.97797 192 | -3.36872 193 | 2.94636 194 | -0.26630 195 | -3.02824 196 | 3.16299 197 | -5.85357 198 | 4.17148 199 | -2.84876 200 | 1.54068 201 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/M2.shallowM10: -------------------------------------------------------------------------------- 1 | 5.62009 2 | -2.92182 3 | 2.82154 4 | 0.96188 5 | -3.02094 6 | 3.73836 7 | -5.99028 8 | 3.43324 9 | -2.94375 10 | 0.39567 11 | 3.01393 12 | -3.11993 13 | 5.81368 14 | -4.25759 15 | 2.83681 16 | -1.64650 17 | -2.61702 18 | 2.87790 19 | -5.16058 20 | 5.15465 21 | -2.79654 22 | 2.51962 23 | 1.73431 24 | -2.93566 25 | 4.27718 26 | -5.81309 27 | 3.06272 28 | -2.90902 29 | -0.47772 30 | 3.04965 31 | -3.47443 32 | 5.99029 33 | -3.70572 34 | 2.91632 35 | -0.87847 36 | -2.92436 37 | 2.98819 38 | -5.62181 39 | 4.59086 40 | -2.79930 41 | 2.01688 42 | 2.35148 43 | -2.87432 44 | 4.85035 45 | -5.43671 46 | 2.84957 47 | -2.71582 48 | -1.30976 49 | 2.98636 50 | -3.96128 51 | 5.94094 52 | -3.25529 53 | 2.94463 54 | -0.01998 55 | -3.04598 56 | 3.25398 57 | -5.91638 58 | 4.01156 59 | -2.87218 60 | 1.33164 61 | 2.77398 62 | -2.90751 63 | 5.37546 64 | -4.91917 65 | 2.78485 66 | -2.32749 67 | -2.02218 68 | 2.90180 69 | -4.52449 70 | 5.67263 71 | -2.95133 72 | 2.84812 73 | 0.84603 74 | -3.03017 75 | 3.67052 76 | -5.99717 77 | 3.49597 78 | -2.93939 79 | 0.51522 80 | 2.99734 81 | -3.08304 82 | 5.77255 83 | -4.33839 84 | 2.82626 85 | -1.74183 86 | -2.55839 87 | 2.87357 88 | -5.08729 89 | 5.22689 90 | -2.80527 91 | 2.57347 92 | 1.63517 93 | -2.94784 94 | 4.19862 95 | -5.85054 96 | 3.10494 97 | -2.92209 98 | -0.35712 99 | 3.05225 100 | -3.41643 101 | 5.97901 102 | -3.77758 103 | 2.90654 104 | -0.99214 105 | -2.89356 106 | 2.96393 107 | -5.56637 108 | 4.67189 109 | -2.79316 110 | 2.09830 111 | 2.27697 112 | -2.87859 113 | 4.77181 114 | -5.49893 115 | 2.86968 116 | -2.75378 117 | -1.19990 118 | 2.99824 119 | -3.88765 120 | 5.96140 121 | -3.30971 122 | 2.94664 123 | -0.14147 124 | -3.03871 125 | 3.20762 126 | -5.88755 127 | 4.08976 128 | -2.86059 129 | 1.43598 130 | 2.72756 131 | -2.89518 132 | 5.30858 133 | -4.99662 134 | 2.78621 135 | -2.39347 136 | -1.93292 137 | 2.91183 138 | -4.44452 139 | 5.72171 140 | -2.98394 141 | 2.87122 142 | 0.72868 143 | -3.03810 144 | 3.60486 145 | -5.99962 146 | 3.56115 147 | -2.93340 148 | 0.63368 149 | 2.97746 150 | -3.04924 151 | 5.72770 152 | -4.41960 153 | 2.81648 154 | -1.83397 155 | -2.49584 156 | 2.87157 157 | -5.01237 158 | 5.29699 159 | -2.81663 160 | 2.62340 161 | 1.53316 162 | -2.96028 163 | 4.12096 164 | -5.88400 165 | 3.15022 166 | -2.93222 167 | -0.23594 168 | 3.05273 169 | -3.36114 170 | 5.96336 171 | -3.85127 172 | 2.89598 173 | -1.10384 174 | -2.85905 175 | 2.94269 176 | -5.50786 177 | 4.75241 178 | -2.78859 179 | 2.17607 180 | 2.19872 181 | -2.88456 182 | 4.69257 183 | -5.55821 184 | 2.89278 185 | -2.78800 186 | -1.08790 187 | 3.00949 188 | -3.81570 189 | 5.97754 190 | -3.36691 191 | 2.94640 192 | -0.26257 193 | -3.02860 194 | 3.16428 195 | -5.85465 196 | 4.16902 197 | -2.84911 198 | 1.53759 199 | 2.67722 200 | -2.88554 201 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/M2only-Stime-lat.elev: -------------------------------------------------------------------------------- 1 | 3.41619 2 | -4.77230 3 | 4.95697 4 | -3.92488 5 | 1.92936 6 | 0.53974 7 | -2.87636 8 | 4.50693 9 | -5.03121 10 | 4.32049 11 | -2.54925 12 | 0.15225 13 | 2.28212 14 | -4.15631 15 | 5.01027 16 | -4.63438 17 | 3.12091 18 | -0.84136 19 | -1.64471 20 | 3.72706 21 | -4.89455 22 | 4.86059 23 | -3.63353 24 | 1.51456 25 | 0.97618 26 | -3.22730 27 | 4.68623 28 | -4.99486 29 | 4.07741 30 | -2.15911 31 | -0.28919 32 | 2.66650 33 | -4.38927 34 | 5.03463 35 | -4.44416 36 | 2.76281 37 | -0.40328 38 | -2.05524 39 | 4.00927 40 | -4.97916 41 | 4.72684 42 | -3.31424 43 | 1.08811 44 | 1.40511 45 | -3.55343 46 | 4.82950 47 | -4.92010 48 | 3.80298 49 | -1.75236 50 | -0.72840 51 | 3.03037 52 | -4.58848 53 | 5.02029 54 | -4.21978 55 | 2.38346 56 | 0.03791 57 | -2.44998 58 | 4.26066 59 | -5.02550 60 | 4.55675 61 | -2.96948 62 | 0.65330 63 | 1.82324 64 | -3.85224 65 | 4.93565 66 | -4.80752 67 | 3.49931 68 | -1.33215 69 | -1.16202 70 | 3.37094 71 | -4.75242 72 | 4.96734 73 | -3.96295 74 | 1.98580 75 | 0.47881 76 | -2.82588 77 | 4.47929 78 | -5.03320 79 | 4.35163 80 | -2.60188 81 | 0.21346 82 | 2.22736 83 | -4.12143 84 | 5.00384 85 | -4.65798 86 | 3.16874 87 | -0.90169 88 | -1.58670 89 | 3.68560 90 | -4.87982 91 | 4.87621 92 | -3.67566 93 | 1.57286 94 | 0.91602 95 | -3.18005 96 | 4.66349 97 | -5.00220 98 | 4.11304 99 | -2.21428 100 | -0.22802 101 | 2.61434 102 | -4.35894 103 | 5.03356 104 | -4.47262 105 | 2.81381 106 | -0.46430 107 | -1.99918 108 | 3.97193 109 | -4.96970 110 | 4.74759 111 | -3.36011 112 | 1.14783 113 | 1.34619 114 | -3.50978 115 | 4.81183 116 | -4.93274 117 | 3.84284 118 | -1.80965 119 | -0.66774 120 | 2.98123 121 | -4.56293 122 | 5.02459 123 | -4.25288 124 | 2.43724 125 | -0.02334 126 | -2.39629 127 | 4.22771 128 | -5.02138 129 | 4.58247 130 | -3.01872 131 | 0.71398 132 | 1.76602 133 | -3.81252 134 | 4.92317 135 | -4.82536 136 | 3.54309 137 | -1.39111 138 | -1.10233 139 | 3.32520 140 | -4.73184 141 | 4.97698 142 | -4.00044 143 | 2.04193 144 | 0.41780 145 | -2.77498 146 | 4.45099 147 | -5.03444 148 | 4.38211 149 | -2.65412 150 | 0.27464 151 | 2.17226 152 | -4.08594 153 | 4.99667 154 | -4.68089 155 | 3.21610 156 | -0.96188 157 | -1.52845 158 | 3.64360 159 | -4.86437 160 | 4.89111 161 | -3.71725 162 | 1.63093 163 | 0.85573 164 | -3.13233 165 | 4.64005 166 | -5.00881 167 | 4.14807 168 | -2.26912 169 | -0.16681 170 | 2.56180 171 | -4.32796 172 | 5.03175 173 | -4.50042 174 | 2.86439 175 | -0.52525 176 | -1.94282 177 | 3.93399 178 | -4.95951 179 | 4.76763 180 | -3.40547 181 | 1.20738 182 | 1.28707 183 | -3.46560 184 | 4.79344 185 | -4.94466 186 | 3.88213 187 | -1.86668 188 | -0.60699 189 | 2.93165 190 | -4.53670 191 | 5.02814 192 | -4.28535 193 | 2.49065 194 | -0.08459 195 | -2.34224 196 | 4.19413 197 | -5.01651 198 | 4.60750 199 | -3.06752 200 | 0.77456 201 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/M2only-Stime-lat.vel: -------------------------------------------------------------------------------- 1 | 1.36648 2 | 0.34162 3 | -1.90892 4 | -0.47723 5 | 1.98279 6 | 0.49570 7 | -1.56995 8 | -0.39249 9 | 0.77175 10 | 0.19294 11 | 0.21590 12 | 0.05397 13 | -1.15054 14 | -0.28764 15 | 1.80277 16 | 0.45069 17 | -2.01248 18 | -0.50312 19 | 1.72820 20 | 0.43205 21 | -1.01970 22 | -0.25492 23 | 0.06090 24 | 0.01523 25 | 0.91285 26 | 0.22821 27 | -1.66252 28 | -0.41563 29 | 2.00411 30 | 0.50103 31 | -1.85375 32 | -0.46344 33 | 1.24836 34 | 0.31209 35 | -0.33655 36 | -0.08414 37 | -0.65788 38 | -0.16447 39 | 1.49082 40 | 0.37271 41 | -1.95782 42 | -0.48945 43 | 1.94424 44 | 0.48606 45 | -1.45341 46 | -0.36335 47 | 0.60582 48 | 0.15146 49 | 0.39047 50 | 0.09762 51 | -1.29092 52 | -0.32273 53 | 1.87449 54 | 0.46862 55 | -1.99794 56 | -0.49949 57 | 1.63096 58 | 0.40774 59 | -0.86364 60 | -0.21591 61 | -0.11568 62 | -0.02892 63 | 1.06660 64 | 0.26665 65 | -1.75571 66 | -0.43893 67 | 2.01385 68 | 0.50346 69 | -1.77767 70 | -0.44442 71 | 1.10512 72 | 0.27628 73 | -0.16131 74 | -0.04033 75 | -0.82210 76 | -0.20552 77 | 1.60371 78 | 0.40093 79 | -1.99167 80 | -0.49792 81 | 1.89074 82 | 0.47268 83 | -1.32570 84 | -0.33142 85 | 0.43524 86 | 0.10881 87 | 0.56205 88 | 0.14051 89 | -1.42137 90 | -0.35534 91 | 1.93180 92 | 0.48295 93 | -1.96804 94 | -0.49201 95 | 1.52119 96 | 0.38030 97 | -0.70094 98 | -0.17524 99 | -0.29136 100 | -0.07284 101 | 1.21215 102 | 0.30304 103 | -1.83539 104 | -0.45885 105 | 2.00811 106 | 0.50203 107 | -1.68791 108 | -0.42198 109 | 0.95339 110 | 0.23835 111 | 0.01516 112 | 0.00379 113 | -0.97999 114 | -0.24500 115 | 1.70426 116 | 0.42607 117 | -2.01020 118 | -0.50255 119 | 1.82270 120 | 0.45568 121 | -1.18779 122 | -0.29695 123 | 0.26132 124 | 0.06533 125 | 0.72930 126 | 0.18232 127 | -1.54090 128 | -0.38522 129 | 1.97426 130 | 0.49356 131 | -1.92301 132 | -0.48075 133 | 1.39973 134 | 0.34993 135 | -0.53286 136 | -0.13321 137 | -0.46481 138 | -0.11620 139 | 1.34838 140 | 0.33709 141 | -1.90097 142 | -0.47524 143 | 1.98694 144 | 0.49673 145 | -1.58518 146 | -0.39630 147 | 0.79432 148 | 0.19858 149 | 0.19152 150 | 0.04788 151 | -1.13035 152 | -0.28259 153 | 1.79172 154 | 0.44793 155 | -2.01328 156 | -0.50332 157 | 1.74065 158 | 0.43516 159 | -1.04075 160 | -0.26019 161 | 0.08538 162 | 0.02135 163 | 0.89094 164 | 0.22274 165 | -1.64857 166 | -0.41214 167 | 2.00154 168 | 0.50038 169 | -1.86319 170 | -0.46580 171 | 1.26750 172 | 0.31687 173 | -0.36068 174 | -0.09017 175 | -0.63468 176 | -0.15867 177 | 1.47424 178 | 0.36856 179 | -1.95193 180 | -0.48798 181 | 1.95048 182 | 0.48762 183 | -1.47026 184 | -0.36757 185 | 0.62914 186 | 0.15729 187 | 0.36641 188 | 0.09160 189 | -1.27202 190 | -0.31801 191 | 1.86540 192 | 0.46635 193 | -2.00088 194 | -0.50022 195 | 1.64522 196 | 0.41130 197 | -0.88571 198 | -0.22143 199 | -0.09121 200 | -0.02280 201 | 1.04574 202 | 0.26143 203 | -1.74357 204 | -0.43589 205 | 2.01342 206 | 0.50336 207 | -1.78905 208 | -0.44726 209 | 1.12552 210 | 0.28138 211 | -0.18572 212 | -0.04643 213 | -0.79967 214 | -0.19992 215 | 1.58877 216 | 0.39719 217 | -1.98788 218 | -0.49697 219 | 1.89904 220 | 0.47476 221 | -1.34404 222 | -0.33601 223 | 0.45913 224 | 0.11478 225 | 0.53848 226 | 0.13462 227 | -1.40391 228 | -0.35098 229 | 1.92473 230 | 0.48118 231 | -1.97310 232 | -0.49327 233 | 1.53714 234 | 0.38428 235 | -0.72386 236 | -0.18097 237 | -0.26710 238 | -0.06677 239 | 1.19249 240 | 0.29812 241 | -1.82517 242 | -0.45629 243 | 2.00983 244 | 0.50246 245 | -1.70115 246 | -0.42529 247 | 0.97490 248 | 0.24372 249 | -0.00934 250 | -0.00233 251 | -0.95852 252 | -0.23963 253 | 1.69108 254 | 0.42277 255 | -2.00855 256 | -0.50214 257 | 1.83299 258 | 0.45825 259 | -1.20749 260 | -0.30187 261 | 0.28559 262 | 0.07140 263 | 0.70641 264 | 0.17660 265 | -1.52501 266 | -0.38125 267 | 1.96927 268 | 0.49232 269 | -1.93015 270 | -0.48254 271 | 1.41724 272 | 0.35431 273 | -0.55645 274 | -0.13911 275 | -0.44093 276 | -0.11023 277 | 1.33008 278 | 0.33252 279 | -1.89274 280 | -0.47318 281 | 1.99079 282 | 0.49770 283 | -1.60018 284 | -0.40004 285 | 0.81677 286 | 0.20419 287 | 0.16712 288 | 0.04178 289 | -1.10999 290 | -0.27750 291 | 1.78040 292 | 0.44510 293 | -2.01378 294 | -0.50344 295 | 1.75284 296 | 0.43821 297 | -1.06165 298 | -0.26541 299 | 0.10986 300 | 0.02746 301 | 0.86890 302 | 0.21723 303 | -1.63438 304 | -0.40859 305 | 1.99867 306 | 0.49967 307 | -1.87235 308 | -0.46809 309 | 1.28644 310 | 0.32161 311 | -0.38475 312 | -0.09619 313 | -0.61138 314 | -0.15285 315 | 1.45744 316 | 0.36436 317 | -1.94575 318 | -0.48644 319 | 1.95644 320 | 0.48911 321 | -1.48690 322 | -0.37172 323 | 0.65237 324 | 0.16309 325 | 0.34229 326 | 0.08557 327 | -1.25293 328 | -0.31323 329 | 1.85602 330 | 0.46401 331 | -2.00352 332 | -0.50088 333 | 1.65923 334 | 0.41481 335 | -0.90765 336 | -0.22691 337 | -0.06673 338 | -0.01668 339 | 1.02472 340 | 0.25618 341 | -1.73118 342 | -0.43280 343 | 2.01270 344 | 0.50317 345 | -1.80017 346 | -0.45004 347 | 1.14576 348 | 0.28644 349 | -0.21010 350 | -0.05253 351 | -0.77713 352 | -0.19428 353 | 1.57360 354 | 0.39340 355 | -1.98380 356 | -0.49595 357 | 1.90705 358 | 0.47676 359 | -1.36219 360 | -0.34055 361 | 0.48295 362 | 0.12074 363 | 0.51483 364 | 0.12871 365 | -1.38624 366 | -0.34656 367 | 1.91738 368 | 0.47934 369 | -1.97786 370 | -0.49447 371 | 1.55285 372 | 0.38821 373 | -0.74667 374 | -0.18667 375 | -0.24279 376 | -0.06070 377 | 1.17266 378 | 0.29317 379 | -1.81468 380 | -0.45367 381 | 2.01126 382 | 0.50281 383 | -1.71414 384 | -0.42854 385 | 0.99626 386 | 0.24907 387 | -0.03383 388 | -0.00846 389 | -0.93690 390 | -0.23422 391 | 1.67765 392 | 0.41941 393 | -2.00660 394 | -0.50165 395 | 1.84300 396 | 0.46075 397 | -1.22701 398 | -0.30675 399 | 0.30982 400 | 0.07746 401 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/M2only-Stime.elev: -------------------------------------------------------------------------------- 1 | 3.37854 2 | -4.73308 3 | 4.92582 4 | -3.90944 5 | 1.93342 6 | 0.51718 7 | -2.84083 8 | 4.46716 9 | -4.99695 10 | 4.30017 11 | -2.54784 12 | 0.17010 13 | 2.24939 14 | -4.11673 15 | 4.97356 16 | -4.60955 17 | 3.11405 18 | -0.85416 19 | -1.61539 20 | 3.68842 21 | -4.85608 22 | 4.83173 23 | -3.62136 24 | 1.52207 25 | 0.95083 26 | -3.19034 27 | 4.64673 28 | -4.96251 29 | 4.06016 30 | -2.16118 31 | -0.26829 32 | 2.63191 33 | -4.34948 34 | 4.99941 35 | -4.42215 36 | 2.75941 37 | -0.41933 38 | -2.02368 39 | 3.96995 40 | -4.94173 41 | 4.70049 42 | -3.30544 43 | 1.09902 44 | 1.37718 45 | -3.51532 46 | 4.79057 47 | -4.88991 48 | 3.78894 49 | -1.75791 50 | -0.70462 51 | 2.99419 52 | -4.54879 53 | 4.98682 54 | -4.20076 55 | 2.38355 56 | 0.01873 57 | -2.41642 58 | 4.22096 59 | -4.98940 60 | 4.53311 61 | -2.96410 62 | 0.66751 63 | 1.79293 64 | -3.81327 65 | 4.89759 66 | -4.77971 67 | 3.48858 68 | -1.34113 69 | -1.13553 70 | 3.33345 71 | -4.71313 72 | 4.93589 73 | -3.94707 74 | 1.98937 75 | 0.45665 76 | -2.79057 77 | 4.43951 78 | -4.99870 79 | 4.33088 80 | -2.59998 81 | 0.23088 82 | 2.19490 83 | -4.08191 84 | 4.96694 85 | -4.63277 86 | 3.16141 87 | -0.91403 88 | -1.55771 89 | 3.64709 90 | -4.84123 91 | 4.84702 92 | -3.66303 93 | 1.57989 94 | 0.89105 95 | -3.14327 96 | 4.62393 97 | -4.96957 98 | 4.09535 99 | -2.21587 100 | -0.20753 101 | 2.58000 102 | -4.31916 103 | 4.99812 104 | -4.45021 105 | 2.80993 106 | -0.47991 107 | -1.96791 108 | 3.93268 109 | -4.93211 110 | 4.72088 111 | -3.35083 112 | 1.15827 113 | 1.31860 114 | -3.47181 115 | 4.77280 116 | -4.90224 117 | 3.82834 118 | -1.81472 119 | -0.64435 120 | 2.94526 121 | -4.52320 122 | 4.99086 123 | -4.23343 124 | 2.43684 125 | -0.04209 126 | -2.36299 127 | 4.18804 128 | -4.98507 129 | 4.55844 130 | -3.01287 131 | 0.72774 132 | 1.73602 133 | -3.77365 134 | 4.88498 135 | -4.79721 136 | 3.53190 137 | -1.39962 138 | -1.07621 139 | 3.28787 140 | -4.69247 141 | 4.94523 142 | -3.98411 143 | 2.04503 144 | 0.39604 145 | -2.73990 146 | 4.41120 147 | -4.99971 148 | 4.36096 149 | -2.65174 150 | 0.29162 151 | 2.14009 152 | -4.04648 153 | 4.95960 154 | -4.65530 155 | 3.20830 156 | -0.97376 157 | -1.49980 158 | 3.60521 159 | -4.82567 160 | 4.86159 161 | -3.70416 162 | 1.63748 163 | 0.83113 164 | -3.09574 165 | 4.60045 166 | -4.97590 167 | 4.12995 168 | -2.27023 169 | -0.14675 170 | 2.52770 171 | -4.28820 172 | 4.99609 173 | -4.47761 174 | 2.86003 175 | -0.54041 176 | -1.91185 177 | 3.89483 178 | -4.92176 179 | 4.74056 180 | -3.39573 181 | 1.21735 182 | 1.25984 183 | -3.42778 184 | 4.75432 185 | -4.91384 186 | 3.86718 187 | -1.87126 188 | -0.58399 189 | 2.89589 190 | -4.49695 191 | 4.99416 192 | -4.26548 193 | 2.48978 194 | -0.10291 195 | -2.30921 196 | 4.15450 197 | -4.98001 198 | 4.58309 199 | -3.06119 200 | 0.78786 201 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/M2only-Stime.vel: -------------------------------------------------------------------------------- 1 | 1.35142 2 | 0.33785 3 | -1.89323 4 | -0.47331 5 | 1.97033 6 | 0.49258 7 | -1.56377 8 | -0.39094 9 | 0.77337 10 | 0.19334 11 | 0.20687 12 | 0.05172 13 | -1.13633 14 | -0.28408 15 | 1.78686 16 | 0.44672 17 | -1.99878 18 | -0.49970 19 | 1.72007 20 | 0.43002 21 | -1.01913 22 | -0.25478 23 | 0.06804 24 | 0.01701 25 | 0.89976 26 | 0.22494 27 | -1.64669 28 | -0.41167 29 | 1.98942 30 | 0.49736 31 | -1.84382 32 | -0.46095 33 | 1.24562 34 | 0.31141 35 | -0.34167 36 | -0.08542 37 | -0.64616 38 | -0.16154 39 | 1.47537 40 | 0.36884 41 | -1.94243 42 | -0.48561 43 | 1.93269 44 | 0.48317 45 | -1.44854 46 | -0.36214 47 | 0.60883 48 | 0.15221 49 | 0.38033 50 | 0.09508 51 | -1.27614 52 | -0.31903 53 | 1.85869 54 | 0.46467 55 | -1.98500 56 | -0.49625 57 | 1.62406 58 | 0.40602 59 | -0.86447 60 | -0.21612 61 | -0.10732 62 | -0.02683 63 | 1.05276 64 | 0.26319 65 | -1.73979 66 | -0.43495 67 | 1.99976 68 | 0.49994 69 | -1.76886 70 | -0.44222 71 | 1.10376 72 | 0.27594 73 | -0.16773 74 | -0.04193 75 | -0.80947 76 | -0.20237 77 | 1.58798 78 | 0.39700 79 | -1.97669 80 | -0.49417 81 | 1.88020 82 | 0.47005 83 | -1.32218 84 | -0.33054 85 | 0.43961 86 | 0.10990 87 | 0.55087 88 | 0.13772 89 | -1.40613 90 | -0.35153 91 | 1.91623 92 | 0.47906 93 | -1.95596 94 | -0.48899 95 | 1.51557 96 | 0.37889 97 | -0.70316 98 | -0.17579 99 | -0.28185 100 | -0.07046 101 | 1.19768 102 | 0.29942 103 | -1.81952 104 | -0.45488 105 | 1.99473 106 | 0.49868 107 | -1.68030 108 | -0.42008 109 | 0.95342 110 | 0.23836 111 | 0.00749 112 | 0.00187 113 | -0.96657 114 | -0.24164 115 | 1.68838 116 | 0.42210 117 | -1.99576 118 | -0.49894 119 | 1.81324 120 | 0.45331 121 | -1.18564 122 | -0.29641 123 | 0.26700 124 | 0.06675 125 | 0.71717 126 | 0.17929 127 | -1.52531 128 | -0.38133 129 | 1.95903 130 | 0.48976 131 | -1.91188 132 | -0.47797 133 | 1.39543 134 | 0.34886 135 | -0.53645 136 | -0.13411 137 | -0.45421 138 | -0.11355 139 | 1.33338 140 | 0.33335 141 | -1.88525 142 | -0.47131 143 | 1.97436 144 | 0.49359 145 | -1.57883 146 | -0.39471 147 | 0.79575 148 | 0.19894 149 | 0.18266 150 | 0.04566 151 | -1.11623 152 | -0.27906 153 | 1.77580 154 | 0.44395 155 | -1.99948 156 | -0.49987 157 | 1.73235 158 | 0.43309 159 | -1.03999 160 | -0.26000 161 | 0.09235 162 | 0.02309 163 | 0.87796 164 | 0.21949 165 | -1.63276 166 | -0.40819 167 | 1.98678 168 | 0.49669 169 | -1.85311 170 | -0.46328 171 | 1.26456 172 | 0.31614 173 | -0.36561 174 | -0.09140 175 | -0.62308 176 | -0.15577 177 | 1.45883 178 | 0.36471 179 | -1.93649 180 | -0.48412 181 | 1.93881 182 | 0.48470 183 | -1.46521 184 | -0.36630 185 | 0.63196 186 | 0.15799 187 | 0.35642 188 | 0.08911 189 | -1.25731 190 | -0.31433 191 | 1.84957 192 | 0.46239 193 | -1.98783 194 | -0.49696 195 | 1.63814 196 | 0.40954 197 | -0.88635 198 | -0.22159 199 | -0.08301 200 | -0.02075 201 | 1.03200 202 | 0.25800 203 | -1.72766 204 | -0.43192 205 | 1.99925 206 | 0.49981 207 | -1.78008 208 | -0.44502 209 | 1.12397 210 | 0.28099 211 | -0.19196 212 | -0.04799 213 | -0.78717 214 | -0.19679 215 | 1.57307 216 | 0.39327 217 | -1.97284 218 | -0.49321 219 | 1.88835 220 | 0.47209 221 | -1.34033 222 | -0.33508 223 | 0.46331 224 | 0.11583 225 | 0.52744 226 | 0.13186 227 | -1.38872 228 | -0.34718 229 | 1.90912 230 | 0.47728 231 | -1.96089 232 | -0.49022 233 | 1.53134 234 | 0.38283 235 | -0.72589 236 | -0.18147 237 | -0.25774 238 | -0.06443 239 | 1.17810 240 | 0.29453 241 | -1.80928 242 | -0.45232 243 | 1.99634 244 | 0.49909 245 | -1.69337 246 | -0.42334 247 | 0.97474 248 | 0.24368 249 | -0.01684 250 | -0.00421 251 | -0.94520 252 | -0.23630 253 | 1.67522 254 | 0.41880 255 | -1.99403 256 | -0.49851 257 | 1.82338 258 | 0.45584 259 | -1.20515 260 | -0.30129 261 | 0.29110 262 | 0.07277 263 | 0.69441 264 | 0.17360 265 | -1.50946 266 | -0.37736 267 | 1.95399 268 | 0.48850 269 | -1.91888 270 | -0.47972 271 | 1.41276 272 | 0.35319 273 | -0.55985 274 | -0.13996 275 | -0.43048 276 | -0.10762 277 | 1.31515 278 | 0.32879 279 | -1.87699 280 | -0.46925 281 | 1.97809 282 | 0.49452 283 | -1.59364 284 | -0.39841 285 | 0.81801 286 | 0.20450 287 | 0.15842 288 | 0.03960 289 | -1.09596 290 | -0.27399 291 | 1.76448 292 | 0.44112 293 | -1.99988 294 | -0.49997 295 | 1.74438 296 | 0.43610 297 | -1.06070 298 | -0.26517 299 | 0.11665 300 | 0.02916 301 | 0.85604 302 | 0.21401 303 | -1.61859 304 | -0.40465 305 | 1.98384 306 | 0.49596 307 | -1.86212 308 | -0.46553 309 | 1.28332 310 | 0.32083 311 | -0.38950 312 | -0.09738 313 | -0.59992 314 | -0.14998 315 | 1.44208 316 | 0.36052 317 | -1.93027 318 | -0.48257 319 | 1.94463 320 | 0.48616 321 | -1.48166 322 | -0.37042 323 | 0.65499 324 | 0.16375 325 | 0.33245 326 | 0.08311 327 | -1.23830 328 | -0.30957 329 | 1.84018 330 | 0.46004 331 | -1.99036 332 | -0.49759 333 | 1.65198 334 | 0.41299 335 | -0.90809 336 | -0.22702 337 | -0.05870 338 | -0.01467 339 | 1.01108 340 | 0.25277 341 | -1.71528 342 | -0.42882 343 | 1.99843 344 | 0.49961 345 | -1.79104 346 | -0.44776 347 | 1.14401 348 | 0.28600 349 | -0.21617 350 | -0.05404 351 | -0.76474 352 | -0.19119 353 | 1.55793 354 | 0.38948 355 | -1.96870 356 | -0.49218 357 | 1.89623 358 | 0.47406 359 | -1.35829 360 | -0.33957 361 | 0.48694 362 | 0.12174 363 | 0.50393 364 | 0.12598 365 | -1.37111 366 | -0.34278 367 | 1.90173 368 | 0.47543 369 | -1.96554 370 | -0.49138 371 | 1.54687 372 | 0.38672 373 | -0.74851 374 | -0.18713 375 | -0.23359 376 | -0.05840 377 | 1.15835 378 | 0.28959 379 | -1.79878 380 | -0.44969 381 | 1.99767 382 | 0.49942 383 | -1.70619 384 | -0.42655 385 | 0.99591 386 | 0.24898 387 | -0.04117 388 | -0.01029 389 | -0.92368 390 | -0.23092 391 | 1.66180 392 | 0.41545 393 | -1.99200 394 | -0.49800 395 | 1.83324 396 | 0.45831 397 | -1.22447 398 | -0.30612 399 | 0.31515 400 | 0.07879 401 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/M2only.elev: -------------------------------------------------------------------------------- 1 | 4.92550 2 | -3.90827 3 | 1.93169 4 | 0.51905 5 | -2.84238 6 | 4.46800 7 | -4.99689 8 | 4.29921 9 | -2.54622 10 | 0.16822 11 | 2.25107 12 | -4.11780 13 | 4.97375 14 | -4.60882 15 | 3.11258 16 | -0.85231 17 | -1.61717 18 | 3.68969 19 | -4.85652 20 | 4.83124 21 | -3.62006 22 | 1.52028 23 | 0.95268 24 | -3.19179 25 | 4.64742 26 | -4.96228 27 | 4.05906 28 | -2.15949 29 | -0.27017 30 | 2.63350 31 | -4.35041 32 | 4.99943 33 | -4.42127 34 | 2.75784 35 | -0.41746 36 | -2.02540 37 | 3.97109 38 | -4.94202 39 | 4.69985 40 | -3.30403 41 | 1.09718 42 | 1.37898 43 | -3.51666 44 | 4.79111 45 | -4.88951 46 | 3.78771 47 | -1.75615 48 | -0.70648 49 | 2.99569 50 | -4.54957 51 | 4.98668 52 | -4.19974 53 | 2.38190 54 | 0.02061 55 | -2.41806 56 | 4.22196 57 | -4.98952 58 | 4.53232 59 | -2.96259 60 | 0.66565 61 | 1.79468 62 | -3.81449 63 | 4.89796 64 | -4.77916 65 | 3.48724 66 | -1.33932 67 | -1.13736 68 | 3.33485 69 | -4.71375 70 | 4.93559 71 | -3.94591 72 | 1.98765 73 | 0.45852 74 | -2.79213 75 | 4.44037 76 | -4.99866 77 | 4.32994 78 | -2.59838 79 | 0.22900 80 | 2.19659 81 | -4.08299 82 | 4.96716 83 | -4.63206 84 | 3.15995 85 | -0.91218 86 | -1.55949 87 | 3.64837 88 | -4.84170 89 | 4.84656 90 | -3.66175 91 | 1.57811 92 | 0.89290 93 | -3.14473 94 | 4.62464 95 | -4.96936 96 | 4.09428 97 | -2.21419 98 | -0.20941 99 | 2.58160 100 | -4.32010 101 | 4.99817 102 | -4.44935 103 | 2.80837 104 | -0.47804 105 | -1.96964 106 | 3.93384 107 | -4.93242 108 | 4.72026 109 | -3.34944 110 | 1.15644 111 | 1.32042 112 | -3.47316 113 | 4.77336 114 | -4.90187 115 | 3.82713 116 | -1.81297 117 | -0.64621 118 | 2.94677 119 | -4.52400 120 | 4.99075 121 | -4.23243 122 | 2.43520 123 | -0.04022 124 | -2.36464 125 | 4.18906 126 | -4.98522 127 | 4.55767 128 | -3.01137 129 | 0.72588 130 | 1.73778 131 | -3.77488 132 | 4.88538 133 | -4.79668 134 | 3.53057 135 | -1.39782 136 | -1.07804 137 | 3.28929 138 | -4.69312 139 | 4.94496 140 | -3.98298 141 | 2.04331 142 | 0.39791 143 | -2.74147 144 | 4.41208 145 | -4.99969 146 | 4.36004 147 | -2.65015 148 | 0.28974 149 | 2.14179 150 | -4.04758 151 | 4.95983 152 | -4.65462 153 | 3.20686 154 | -0.97192 155 | -1.50159 156 | 3.60651 157 | -4.82616 158 | 4.86115 159 | -3.70290 160 | 1.63571 161 | 0.83299 162 | -3.09721 163 | 4.60118 164 | -4.97572 165 | 4.12889 166 | -2.26856 167 | -0.14862 168 | 2.52932 169 | -4.28916 170 | 4.99616 171 | -4.47677 172 | 2.85849 173 | -0.53855 174 | -1.91359 175 | 3.89601 176 | -4.92209 177 | 4.73997 178 | -3.39435 179 | 1.21553 180 | 1.26165 181 | -3.42915 182 | 4.75490 183 | -4.91349 184 | 3.86599 185 | -1.86952 186 | -0.58585 187 | 2.89742 188 | -4.49777 189 | 4.99407 190 | -4.26450 191 | 2.48815 192 | -0.10104 193 | -2.31088 194 | 4.15555 195 | -4.98018 196 | 4.58234 197 | -3.05970 198 | 0.78601 199 | 1.68062 200 | -3.73472 201 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/M2only.vel: -------------------------------------------------------------------------------- 1 | 1.97020 2 | 0.49255 3 | -1.56331 4 | -0.39083 5 | 0.77268 6 | 0.19317 7 | 0.20762 8 | 0.05190 9 | -1.13695 10 | -0.28424 11 | 1.78720 12 | 0.44680 13 | -1.99875 14 | -0.49969 15 | 1.71968 16 | 0.42992 17 | -1.01849 18 | -0.25462 19 | 0.06729 20 | 0.01682 21 | 0.90043 22 | 0.22511 23 | -1.64712 24 | -0.41178 25 | 1.98950 26 | 0.49737 27 | -1.84353 28 | -0.46088 29 | 1.24503 30 | 0.31126 31 | -0.34093 32 | -0.08523 33 | -0.64687 34 | -0.16172 35 | 1.47588 36 | 0.36897 37 | -1.94261 38 | -0.48565 39 | 1.93250 40 | 0.48312 41 | -1.44803 42 | -0.36201 43 | 0.60811 44 | 0.15203 45 | 0.38107 46 | 0.09527 47 | -1.27671 48 | -0.31918 49 | 1.85897 50 | 0.46474 51 | -1.98491 52 | -0.49623 53 | 1.62362 54 | 0.40591 55 | -0.86380 56 | -0.21595 57 | -0.10807 58 | -0.02702 59 | 1.05340 60 | 0.26335 61 | -1.74016 62 | -0.43504 63 | 1.99977 64 | 0.49994 65 | -1.76851 66 | -0.44213 67 | 1.10314 68 | 0.27578 69 | -0.16698 70 | -0.04175 71 | -0.81016 72 | -0.20254 73 | 1.58844 74 | 0.39711 75 | -1.97681 76 | -0.49420 77 | 1.87994 78 | 0.46998 79 | -1.32161 80 | -0.33040 81 | 0.43887 82 | 0.10972 83 | 0.55159 84 | 0.13790 85 | -1.40666 86 | -0.35167 87 | 1.91644 88 | 0.47911 89 | -1.95581 90 | -0.48895 91 | 1.51508 92 | 0.37877 93 | -0.70246 94 | -0.17562 95 | -0.28259 96 | -0.07065 97 | 1.19828 98 | 0.29957 99 | -1.81983 100 | -0.45496 101 | 1.99467 102 | 0.49867 103 | -1.67990 104 | -0.41997 105 | 0.95276 106 | 0.23819 107 | 0.00824 108 | 0.00206 109 | -0.96722 110 | -0.24181 111 | 1.68878 112 | 0.42220 113 | -1.99581 114 | -0.49895 115 | 1.81293 116 | 0.45323 117 | -1.18504 118 | -0.29626 119 | 0.26626 120 | 0.06657 121 | 0.71787 122 | 0.17947 123 | -1.52579 124 | -0.38145 125 | 1.95919 126 | 0.48980 127 | -1.91166 128 | -0.47792 129 | 1.39489 130 | 0.34872 131 | -0.53573 132 | -0.13393 133 | -0.45494 134 | -0.11374 135 | 1.33394 136 | 0.33349 137 | -1.88550 138 | -0.47138 139 | 1.97424 140 | 0.49356 141 | -1.57837 142 | -0.39459 143 | 0.79506 144 | 0.19876 145 | 0.18341 146 | 0.04585 147 | -1.11685 148 | -0.27921 149 | 1.77615 150 | 0.44404 151 | -1.99946 152 | -0.49987 153 | 1.73198 154 | 0.43299 155 | -1.03935 156 | -0.25984 157 | 0.09160 158 | 0.02290 159 | 0.87864 160 | 0.21966 161 | -1.63320 162 | -0.40830 163 | 1.98686 164 | 0.49672 165 | -1.85282 166 | -0.46321 167 | 1.26398 168 | 0.31600 169 | -0.36487 170 | -0.09122 171 | -0.62380 172 | -0.15595 173 | 1.45935 174 | 0.36484 175 | -1.93668 176 | -0.48417 177 | 1.93862 178 | 0.48466 179 | -1.46470 180 | -0.36618 181 | 0.63124 182 | 0.15781 183 | 0.35716 184 | 0.08929 185 | -1.25789 186 | -0.31447 187 | 1.84986 188 | 0.46246 189 | -1.98775 190 | -0.49694 191 | 1.63771 192 | 0.40943 193 | -0.88567 194 | -0.22142 195 | -0.08376 196 | -0.02094 197 | 1.03264 198 | 0.25816 199 | -1.72804 200 | -0.43201 201 | 1.99927 202 | 0.49982 203 | -1.77974 204 | -0.44494 205 | 1.12335 206 | 0.28084 207 | -0.19122 208 | -0.04780 209 | -0.78786 210 | -0.19696 211 | 1.57354 212 | 0.39338 213 | -1.97297 214 | -0.49324 215 | 1.88810 216 | 0.47203 217 | -1.33977 218 | -0.33494 219 | 0.46258 220 | 0.11564 221 | 0.52817 222 | 0.13204 223 | -1.38926 224 | -0.34732 225 | 1.90934 226 | 0.47734 227 | -1.96075 228 | -0.49019 229 | 1.53085 230 | 0.38271 231 | -0.72519 232 | -0.18130 233 | -0.25848 234 | -0.06462 235 | 1.17871 236 | 0.29468 237 | -1.80960 238 | -0.45240 239 | 1.99630 240 | 0.49907 241 | -1.69297 242 | -0.42324 243 | 0.97408 244 | 0.24352 245 | -0.01609 246 | -0.00402 247 | -0.94586 248 | -0.23646 249 | 1.67563 250 | 0.41891 251 | -1.99409 252 | -0.49852 253 | 1.82307 254 | 0.45577 255 | -1.20455 256 | -0.30114 257 | 0.29035 258 | 0.07259 259 | 0.69511 260 | 0.17378 261 | -1.50995 262 | -0.37749 263 | 1.95415 264 | 0.48854 265 | -1.91867 266 | -0.47967 267 | 1.41223 268 | 0.35306 269 | -0.55913 270 | -0.13978 271 | -0.43122 272 | -0.10780 273 | 1.31571 274 | 0.32893 275 | -1.87725 276 | -0.46931 277 | 1.97798 278 | 0.49450 279 | -1.59319 280 | -0.39830 281 | 0.81732 282 | 0.20433 283 | 0.15917 284 | 0.03979 285 | -1.09659 286 | -0.27415 287 | 1.76483 288 | 0.44121 289 | -1.99987 290 | -0.49997 291 | 1.74402 292 | 0.43600 293 | -1.06006 294 | -0.26502 295 | 0.11590 296 | 0.02897 297 | 0.85671 298 | 0.21418 299 | -1.61903 300 | -0.40476 301 | 1.98393 302 | 0.49598 303 | -1.86185 304 | -0.46546 305 | 1.28274 306 | 0.32069 307 | -0.38877 308 | -0.09719 309 | -0.60064 310 | -0.15016 311 | 1.44260 312 | 0.36065 313 | -1.93046 314 | -0.48262 315 | 1.94446 316 | 0.48611 317 | -1.48116 318 | -0.37029 319 | 0.65428 320 | 0.16357 321 | 0.33319 322 | 0.08330 323 | -1.23889 324 | -0.30972 325 | 1.84047 326 | 0.46012 327 | -1.99029 328 | -0.49757 329 | 1.65155 330 | 0.41289 331 | -0.90742 332 | -0.22686 333 | -0.05945 334 | -0.01486 335 | 1.01173 336 | 0.25293 337 | -1.71567 338 | -0.42892 339 | 1.99846 340 | 0.49962 341 | -1.79071 342 | -0.44768 343 | 1.14340 344 | 0.28585 345 | -0.21542 346 | -0.05385 347 | -0.76544 348 | -0.19136 349 | 1.55840 350 | 0.38960 351 | -1.96883 352 | -0.49221 353 | 1.89599 354 | 0.47400 355 | -1.35774 356 | -0.33943 357 | 0.48621 358 | 0.12155 359 | 0.50466 360 | 0.12617 361 | -1.37166 362 | -0.34291 363 | 1.90196 364 | 0.47549 365 | -1.96540 366 | -0.49135 367 | 1.54640 368 | 0.38660 369 | -0.74781 370 | -0.18695 371 | -0.23434 372 | -0.05859 373 | 1.15897 374 | 0.28974 375 | -1.79911 376 | -0.44978 377 | 1.99763 378 | 0.49941 379 | -1.70580 380 | -0.42645 381 | 0.99526 382 | 0.24881 383 | -0.04041 384 | -0.01010 385 | -0.92435 386 | -0.23109 387 | 1.66222 388 | 0.41555 389 | -1.99207 390 | -0.49802 391 | 1.83294 392 | 0.45823 393 | -1.22388 394 | -0.30597 395 | 0.31440 396 | 0.07860 397 | 0.67225 398 | 0.16806 399 | -1.49389 400 | -0.37347 401 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/NoArgs.elev: -------------------------------------------------------------------------------- 1 | 4.92528 2 | -3.90872 3 | 1.93181 4 | 0.51986 5 | -2.84227 6 | 4.46785 7 | -4.99620 8 | 4.29849 9 | -2.54657 10 | 0.16809 11 | 2.25123 12 | -4.11728 13 | 4.97376 14 | -4.60868 15 | 3.11286 16 | -0.85264 17 | -1.61754 18 | 3.69004 19 | -4.85666 20 | 4.83051 21 | -3.61925 22 | 1.52043 23 | 0.95228 24 | -3.19103 25 | 4.64674 26 | -4.96311 27 | 4.05979 28 | -2.15933 29 | -0.27104 30 | 2.63428 31 | -4.34970 32 | 4.99813 33 | -4.42042 34 | 2.75797 35 | -0.41852 36 | -2.02482 37 | 3.97188 38 | -4.94282 39 | 4.69994 40 | -3.30336 41 | 1.09635 42 | 1.37928 43 | -3.51567 44 | 4.79009 45 | -4.88967 46 | 3.78794 47 | -1.75675 48 | -0.70632 49 | 2.99642 50 | -4.54960 51 | 4.98634 52 | -4.19942 53 | 2.38130 54 | 0.01998 55 | -2.41795 56 | 4.22211 57 | -4.98829 58 | 4.53236 59 | -2.96275 60 | 0.66531 61 | 1.79409 62 | -3.81488 63 | 4.89853 64 | -4.77872 65 | 3.48741 66 | -1.33846 67 | -1.13775 68 | 3.33381 69 | -4.71327 70 | 4.93479 71 | -3.94644 72 | 1.98909 73 | 0.45902 74 | -2.79291 75 | 4.44074 76 | -4.99866 77 | 4.32850 78 | -2.59785 79 | 0.22931 80 | 2.19559 81 | -4.08162 82 | 4.96783 83 | -4.63270 84 | 3.15985 85 | -0.91195 86 | -1.56092 87 | 3.64863 88 | -4.84051 89 | 4.84616 90 | -3.66121 91 | 1.57891 92 | 0.89197 93 | -3.14523 94 | 4.62444 95 | -4.96972 96 | 4.09438 97 | -2.21311 98 | -0.20911 99 | 2.58140 100 | -4.32047 101 | 4.99720 102 | -4.44931 103 | 2.80852 104 | -0.47793 105 | -1.96895 106 | 3.93370 107 | -4.93218 108 | 4.72003 109 | -3.34994 110 | 1.15597 111 | 1.32144 112 | -3.47320 113 | 4.77303 114 | -4.90089 115 | 3.82666 116 | -1.81380 117 | -0.64520 118 | 2.94668 119 | -4.52464 120 | 4.99119 121 | -4.23243 122 | 2.43427 123 | -0.03918 124 | -2.36441 125 | 4.18779 126 | -4.98426 127 | 4.55792 128 | -3.01264 129 | 0.72625 130 | 1.73814 131 | -3.77541 132 | 4.88575 133 | -4.79553 134 | 3.52939 135 | -1.39769 136 | -1.07768 137 | 3.28865 138 | -4.69293 139 | 4.94545 140 | -3.98329 141 | 2.04348 142 | 0.39842 143 | -2.74160 144 | 4.41167 145 | -4.99962 146 | 4.35940 147 | -2.65001 148 | 0.29000 149 | 2.14194 150 | -4.04714 151 | 4.95951 152 | -4.65465 153 | 3.20681 154 | -0.97295 155 | -1.50187 156 | 3.60737 157 | -4.82542 158 | 4.86096 159 | -3.70189 160 | 1.63471 161 | 0.83197 162 | -3.09678 163 | 4.60095 164 | -4.97571 165 | 4.13049 166 | -2.26836 167 | -0.14951 168 | 2.52971 169 | -4.28964 170 | 4.99433 171 | -4.47562 172 | 2.85939 173 | -0.53891 174 | -1.91281 175 | 3.89594 176 | -4.92341 177 | 4.73993 178 | -3.39401 179 | 1.21472 180 | 1.26213 181 | -3.42791 182 | 4.75417 183 | -4.91300 184 | 3.86591 185 | -1.87028 186 | -0.58616 187 | 2.89798 188 | -4.49777 189 | 4.99429 190 | -4.26397 191 | 2.48811 192 | -0.10114 193 | -2.31105 194 | 4.15488 195 | -4.98002 196 | 4.58204 197 | -3.05918 198 | 0.78682 199 | 1.68028 200 | -3.73520 201 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/NoArgs.vel: -------------------------------------------------------------------------------- 1 | 1.97021 2 | 0.49255 3 | -1.56372 4 | -0.39093 5 | 0.77262 6 | 0.19315 7 | 0.20823 8 | 0.05206 9 | -1.13680 10 | -0.28420 11 | 1.78684 12 | 0.44671 13 | -1.99853 14 | -0.49963 15 | 1.71968 16 | 0.42992 17 | -1.01869 18 | -0.25467 19 | 0.06696 20 | 0.01674 21 | 0.90067 22 | 0.22517 23 | -1.64663 24 | -0.41166 25 | 1.98925 26 | 0.49731 27 | -1.84375 28 | -0.46094 29 | 1.24542 30 | 0.31136 31 | -0.34083 32 | -0.08521 33 | -0.64729 34 | -0.16182 35 | 1.47589 36 | 0.36897 37 | -1.94239 38 | -0.48560 39 | 1.93221 40 | 0.48305 41 | -1.44799 42 | -0.36200 43 | 0.60825 44 | 0.15206 45 | 0.38121 46 | 0.09530 47 | -1.27652 48 | -0.31913 49 | 1.85843 50 | 0.46461 51 | -1.98515 52 | -0.49629 53 | 1.62410 54 | 0.40603 55 | -0.86383 56 | -0.21596 57 | -0.10850 58 | -0.02713 59 | 1.05382 60 | 0.26346 61 | -1.73987 62 | -0.43497 63 | 1.99912 64 | 0.49978 65 | -1.76817 66 | -0.44204 67 | 1.10330 68 | 0.27582 69 | -0.16738 70 | -0.04185 71 | -0.80997 72 | -0.20249 73 | 1.58871 74 | 0.39718 75 | -1.97717 76 | -0.49429 77 | 1.88002 78 | 0.47001 79 | -1.32124 80 | -0.33031 81 | 0.43850 82 | 0.10962 83 | 0.55160 84 | 0.13790 85 | -1.40620 86 | -0.35155 87 | 1.91610 88 | 0.47903 89 | -1.95600 90 | -0.48900 91 | 1.51516 92 | 0.37879 93 | -0.70247 94 | -0.17562 95 | -0.28253 96 | -0.07063 97 | 1.19827 98 | 0.29957 99 | -1.81982 100 | -0.45495 101 | 1.99484 102 | 0.49871 103 | -1.67983 104 | -0.41996 105 | 0.95226 106 | 0.23807 107 | 0.00813 108 | 0.00203 109 | -0.96698 110 | -0.24174 111 | 1.68859 112 | 0.42215 113 | -1.99549 114 | -0.49887 115 | 1.81328 116 | 0.45332 117 | -1.18495 118 | -0.29624 119 | 0.26576 120 | 0.06644 121 | 0.71753 122 | 0.17938 123 | -1.52562 124 | -0.38141 125 | 1.95944 126 | 0.48986 127 | -1.91177 128 | -0.47794 129 | 1.39505 130 | 0.34876 131 | -0.53513 132 | -0.13378 133 | -0.45528 134 | -0.11382 135 | 1.33328 136 | 0.33332 137 | -1.88509 138 | -0.47127 139 | 1.97414 140 | 0.49353 141 | -1.57877 142 | -0.39469 143 | 0.79548 144 | 0.19887 145 | 0.18376 146 | 0.04594 147 | -1.11711 148 | -0.27928 149 | 1.77616 150 | 0.44404 151 | -1.99944 152 | -0.49986 153 | 1.73153 154 | 0.43288 155 | -1.03919 156 | -0.25980 157 | 0.09160 158 | 0.02290 159 | 0.87826 160 | 0.21957 161 | -1.63257 162 | -0.40814 163 | 1.98716 164 | 0.49679 165 | -1.85308 166 | -0.46327 167 | 1.26388 168 | 0.31597 169 | -0.36485 170 | -0.09121 171 | -0.62429 172 | -0.15607 173 | 1.45953 174 | 0.36488 175 | -1.93629 176 | -0.48407 177 | 1.93843 178 | 0.48461 179 | -1.46436 180 | -0.36609 181 | 0.63152 182 | 0.15788 183 | 0.35660 184 | 0.08915 185 | -1.25799 186 | -0.31450 187 | 1.85003 188 | 0.46251 189 | -1.98802 190 | -0.49701 191 | 1.63749 192 | 0.40937 193 | -0.88509 194 | -0.22127 195 | -0.08343 196 | -0.02086 197 | 1.03236 198 | 0.25809 199 | -1.72831 200 | -0.43208 201 | 1.99917 202 | 0.49979 203 | -1.77967 204 | -0.44492 205 | 1.12305 206 | 0.28076 207 | -0.19117 208 | -0.04779 209 | -0.78719 210 | -0.19680 211 | 1.57345 212 | 0.39336 213 | -1.97322 214 | -0.49330 215 | 1.88810 216 | 0.47202 217 | -1.33971 218 | -0.33493 219 | 0.46222 220 | 0.11555 221 | 0.52838 222 | 0.13210 223 | -1.38902 224 | -0.34726 225 | 1.90936 226 | 0.47734 227 | -1.96065 228 | -0.49016 229 | 1.53054 230 | 0.38264 231 | -0.72524 232 | -0.18131 233 | -0.25800 234 | -0.06450 235 | 1.17846 236 | 0.29462 237 | -1.80987 238 | -0.45247 239 | 1.99662 240 | 0.49916 241 | -1.69304 242 | -0.42326 243 | 0.97360 244 | 0.24340 245 | -0.01557 246 | -0.00389 247 | -0.94566 248 | -0.23642 249 | 1.67503 250 | 0.41876 251 | -1.99379 252 | -0.49845 253 | 1.82318 254 | 0.45580 255 | -1.20502 256 | -0.30125 257 | 0.29055 258 | 0.07264 259 | 0.69528 260 | 0.17382 261 | -1.51025 262 | -0.37756 263 | 1.95425 264 | 0.48856 265 | -1.91812 266 | -0.47953 267 | 1.41176 268 | 0.35294 269 | -0.55917 270 | -0.13979 271 | -0.43100 272 | -0.10775 273 | 1.31559 274 | 0.32890 275 | -1.87734 276 | -0.46933 277 | 1.97801 278 | 0.49450 279 | -1.59310 280 | -0.39827 281 | 0.81758 282 | 0.20439 283 | 0.15913 284 | 0.03978 285 | -1.09678 286 | -0.27419 287 | 1.76491 288 | 0.44123 289 | -1.99981 290 | -0.49995 291 | 1.74348 292 | 0.43587 293 | -1.05994 294 | -0.26498 295 | 0.11633 296 | 0.02908 297 | 0.85664 298 | 0.21416 299 | -1.61921 300 | -0.40480 301 | 1.98398 302 | 0.49599 303 | -1.86155 304 | -0.46539 305 | 1.28253 306 | 0.32063 307 | -0.38940 308 | -0.09735 309 | -0.60051 310 | -0.15013 311 | 1.44306 312 | 0.36076 313 | -1.93046 314 | -0.48262 315 | 1.94435 316 | 0.48609 317 | -1.48042 318 | -0.37011 319 | 0.65388 320 | 0.16347 321 | 0.33247 322 | 0.08312 323 | -1.23869 324 | -0.30967 325 | 1.84062 326 | 0.46015 327 | -1.99034 328 | -0.49758 329 | 1.65205 330 | 0.41301 331 | -0.90723 332 | -0.22681 333 | -0.05972 334 | -0.01493 335 | 1.01174 336 | 0.25293 337 | -1.71592 338 | -0.42898 339 | 1.99787 340 | 0.49947 341 | -1.79019 342 | -0.44755 343 | 1.14369 344 | 0.28592 345 | -0.21561 346 | -0.05390 347 | -0.76514 348 | -0.19128 349 | 1.55839 350 | 0.38960 351 | -1.96929 352 | -0.49232 353 | 1.89598 354 | 0.47400 355 | -1.35769 356 | -0.33942 357 | 0.48590 358 | 0.12147 359 | 0.50492 360 | 0.12623 361 | -1.37125 362 | -0.34281 363 | 1.90161 364 | 0.47540 365 | -1.96502 366 | -0.49125 367 | 1.54643 368 | 0.38661 369 | -0.74837 370 | -0.18709 371 | -0.23454 372 | -0.05864 373 | 1.15947 374 | 0.28987 375 | -1.79907 376 | -0.44977 377 | 1.99746 378 | 0.49936 379 | -1.70554 380 | -0.42639 381 | 0.99549 382 | 0.24887 383 | -0.04062 384 | -0.01015 385 | -0.92467 386 | -0.23117 387 | 1.66221 388 | 0.41555 389 | -1.99175 390 | -0.49794 391 | 1.83252 392 | 0.45813 393 | -1.22390 394 | -0.30597 395 | 0.31502 396 | 0.07875 397 | 0.67225 398 | 0.16806 399 | -1.49437 400 | -0.37359 401 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/NoOutput.elev: -------------------------------------------------------------------------------- 1 | 4.92571 2 | -3.90879 3 | 1.93141 4 | 0.52008 5 | -2.84194 6 | 4.46751 7 | -4.99640 8 | 4.29890 9 | -2.54651 10 | 0.16766 11 | 2.25133 12 | -4.11689 13 | 4.97352 14 | -4.60898 15 | 3.11322 16 | -0.85246 17 | -1.61796 18 | 3.69001 19 | -4.85623 20 | 4.83038 21 | -3.61963 22 | 1.52069 23 | 0.95256 24 | -3.19140 25 | 4.64659 26 | -4.96269 27 | 4.05979 28 | -2.15976 29 | -0.27089 30 | 2.63465 31 | -4.34998 32 | 4.99786 33 | -4.42004 34 | 2.75810 35 | -0.41894 36 | -2.02480 37 | 3.97230 38 | -4.94299 39 | 4.69959 40 | -3.30306 41 | 1.09660 42 | 1.37889 43 | -3.51578 44 | 4.79052 45 | -4.88972 46 | 3.78753 47 | -1.75655 48 | -0.70598 49 | 2.99610 50 | -4.54982 51 | 4.98674 52 | -4.19934 53 | 2.38088 54 | 0.02006 55 | -2.41755 56 | 4.22189 57 | -4.98861 58 | 4.53270 59 | -2.96255 60 | 0.66490 61 | 1.79404 62 | -3.81445 63 | 4.89843 64 | -4.77911 65 | 3.48765 66 | -1.33816 67 | -1.13810 68 | 3.33364 69 | -4.71286 70 | 4.93481 71 | -3.94687 72 | 1.98922 73 | 0.45940 74 | -2.79317 75 | 4.44046 76 | -4.99830 77 | 4.32865 78 | -2.59827 79 | 0.22931 80 | 2.19601 81 | -4.08177 82 | 4.96746 83 | -4.63241 84 | 3.16011 85 | -0.91233 86 | -1.56104 87 | 3.64906 88 | -4.84054 89 | 4.84575 90 | -3.66103 91 | 1.57926 92 | 0.89167 93 | -3.14548 94 | 4.62483 95 | -4.96962 96 | 4.09396 97 | -2.21305 98 | -0.20870 99 | 2.58120 100 | -4.32081 101 | 4.99752 102 | -4.44909 103 | 2.80811 104 | -0.47800 105 | -1.96852 106 | 3.93362 107 | -4.93258 108 | 4.72026 109 | -3.34962 110 | 1.15563 111 | 1.32124 112 | -3.47279 113 | 4.77308 114 | -4.90131 115 | 3.82677 116 | -1.81341 117 | -0.64544 118 | 2.94638 119 | -4.52429 120 | 4.99136 121 | -4.23285 122 | 2.43425 123 | -0.03876 124 | -2.36454 125 | 4.18741 126 | -4.98400 127 | 4.55820 128 | -3.01301 129 | 0.72610 130 | 1.73856 131 | -3.77542 132 | 4.88533 133 | -4.79537 134 | 3.52975 135 | -1.39798 136 | -1.07794 137 | 3.28903 138 | -4.69281 139 | 4.94503 140 | -3.98326 141 | 2.04390 142 | 0.39824 143 | -2.74195 144 | 4.41197 145 | -4.99938 146 | 4.35901 147 | -2.65011 148 | 0.29043 149 | 2.14189 150 | -4.04755 151 | 4.95971 152 | -4.65432 153 | 3.20649 154 | -0.97317 155 | -1.50147 156 | 3.60744 157 | -4.82585 158 | 4.86104 159 | -3.70149 160 | 1.63448 161 | 0.83165 162 | -3.09644 163 | 4.60114 164 | -4.97612 165 | 4.13044 166 | -2.26793 167 | -0.14961 168 | 2.52932 169 | -4.28939 170 | 4.99463 171 | -4.47597 172 | 2.85922 173 | -0.53850 174 | -1.91279 175 | 3.89552 176 | -4.92328 177 | 4.74031 178 | -3.39428 179 | 1.21444 180 | 1.26250 181 | -3.42776 182 | 4.75375 183 | -4.91299 184 | 3.86633 185 | -1.87044 186 | -0.58652 187 | 2.89827 188 | -4.49751 189 | 4.99391 190 | -4.26409 191 | 2.48853 192 | -0.10117 193 | -2.31147 194 | 4.15506 195 | -4.97967 196 | 4.58173 197 | -3.05942 198 | 0.78721 199 | 1.68037 200 | -3.73563 201 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/NoOutput.vel: -------------------------------------------------------------------------------- 1 | 1.97008 2 | 0.49252 3 | -1.56365 4 | -0.39091 5 | 0.77277 6 | 0.19319 7 | 0.20810 8 | 0.05203 9 | -1.13697 10 | -0.28424 11 | 1.78698 12 | 0.44675 13 | -1.99840 14 | -0.49960 15 | 1.71955 16 | 0.42989 17 | -1.01872 18 | -0.25468 19 | 0.06709 20 | 0.01677 21 | 0.90059 22 | 0.22515 23 | -1.64678 24 | -0.41169 25 | 1.98939 26 | 0.49735 27 | -1.84360 28 | -0.46090 29 | 1.24527 30 | 0.31132 31 | -0.34094 32 | -0.08524 33 | -0.64715 34 | -0.16179 35 | 1.47591 36 | 0.36898 37 | -1.94252 38 | -0.48563 39 | 1.93229 40 | 0.48307 41 | -1.44785 42 | -0.36196 43 | 0.60810 44 | 0.15202 45 | 0.38107 46 | 0.09527 47 | -1.27635 48 | -0.31909 49 | 1.85853 50 | 0.46463 51 | -1.98529 52 | -0.49632 53 | 1.62408 54 | 0.40602 55 | -0.86370 56 | -0.21593 57 | -0.10859 58 | -0.02715 59 | 1.05370 60 | 0.26342 61 | -1.73971 62 | -0.43493 63 | 1.99925 64 | 0.49981 65 | -1.76834 66 | -0.44209 67 | 1.10320 68 | 0.27580 69 | -0.16724 70 | -0.04181 71 | -0.80996 72 | -0.20249 73 | 1.58859 74 | 0.39715 75 | -1.97708 76 | -0.49427 77 | 1.88014 78 | 0.47003 79 | -1.32141 80 | -0.33035 81 | 0.43838 82 | 0.10960 83 | 0.55178 84 | 0.13795 85 | -1.40612 86 | -0.35153 87 | 1.91595 88 | 0.47899 89 | -1.95601 90 | -0.48900 91 | 1.51528 92 | 0.37882 93 | -0.70256 94 | -0.17564 95 | -0.28264 96 | -0.07066 97 | 1.19844 98 | 0.29961 99 | -1.81972 100 | -0.45493 101 | 1.99465 102 | 0.49866 103 | -1.67990 104 | -0.41998 105 | 0.95242 106 | 0.23810 107 | 0.00813 108 | 0.00203 109 | -0.96709 110 | -0.24177 111 | 1.68869 112 | 0.42217 113 | -1.99539 114 | -0.49885 115 | 1.81310 116 | 0.45328 117 | -1.18504 118 | -0.29626 119 | 0.26596 120 | 0.06649 121 | 0.71759 122 | 0.17940 123 | -1.52579 124 | -0.38145 125 | 1.95945 126 | 0.48986 127 | -1.91166 128 | -0.47791 129 | 1.39495 130 | 0.34874 131 | -0.53521 132 | -0.13380 133 | -0.45510 134 | -0.11377 135 | 1.33335 136 | 0.33334 137 | -1.88530 138 | -0.47132 139 | 1.97409 140 | 0.49352 141 | -1.57860 142 | -0.39465 143 | 0.79547 144 | 0.19887 145 | 0.18365 146 | 0.04591 147 | -1.11700 148 | -0.27925 149 | 1.77624 150 | 0.44406 151 | -1.99962 152 | -0.49991 153 | 1.73147 154 | 0.43287 155 | -1.03899 156 | -0.25975 157 | 0.09164 158 | 0.02291 159 | 0.87809 160 | 0.21952 161 | -1.63255 162 | -0.40814 163 | 1.98727 164 | 0.49682 165 | -1.85319 166 | -0.46330 167 | 1.26381 168 | 0.31595 169 | -0.36466 170 | -0.09116 171 | -0.62425 172 | -0.15606 173 | 1.45932 174 | 0.36483 175 | -1.93631 176 | -0.48408 177 | 1.93861 178 | 0.48465 179 | -1.46439 180 | -0.36610 181 | 0.63141 182 | 0.15785 183 | 0.35671 184 | 0.08918 185 | -1.25794 186 | -0.31448 187 | 1.84984 188 | 0.46246 189 | -1.98805 190 | -0.49701 191 | 1.63770 192 | 0.40943 193 | -0.88508 194 | -0.22127 195 | -0.08361 196 | -0.02090 197 | 1.03239 198 | 0.25810 199 | -1.72821 200 | -0.43205 201 | 1.99905 202 | 0.49976 203 | -1.77972 204 | -0.44493 205 | 1.12323 206 | 0.28081 207 | -0.19116 208 | -0.04779 209 | -0.78741 210 | -0.19685 211 | 1.57346 212 | 0.39336 213 | -1.97304 214 | -0.49326 215 | 1.88805 216 | 0.47201 217 | -1.33981 218 | -0.33495 219 | 0.46233 220 | 0.11558 221 | 0.52842 222 | 0.13210 223 | -1.38921 224 | -0.34730 225 | 1.90936 226 | 0.47734 227 | -1.96044 228 | -0.49011 229 | 1.53052 230 | 0.38263 231 | -0.72542 232 | -0.18136 233 | -0.25794 234 | -0.06449 235 | 1.17856 236 | 0.29464 237 | -1.80998 238 | -0.45250 239 | 1.99660 240 | 0.49915 241 | -1.69285 242 | -0.42321 243 | 0.97358 244 | 0.24339 245 | -0.01578 246 | -0.00394 247 | -0.94562 248 | -0.23641 249 | 1.67521 250 | 0.41880 251 | -1.99385 252 | -0.49846 253 | 1.82309 254 | 0.45577 255 | -1.20490 256 | -0.30123 257 | 0.29057 258 | 0.07264 259 | 0.69509 260 | 0.17377 261 | -1.51022 262 | -0.37755 263 | 1.95446 264 | 0.48862 265 | -1.91817 266 | -0.47954 267 | 1.41159 268 | 0.35290 269 | -0.55910 270 | -0.13977 271 | -0.43090 272 | -0.10773 273 | 1.31547 274 | 0.32887 275 | -1.87734 276 | -0.46934 277 | 1.97819 278 | 0.49455 279 | -1.59315 280 | -0.39829 281 | 0.81737 282 | 0.20434 283 | 0.15920 284 | 0.03980 285 | -1.09660 286 | -0.27415 287 | 1.76483 288 | 0.44121 289 | -1.99990 290 | -0.49998 291 | 1.74360 292 | 0.43590 293 | -1.05994 294 | -0.26498 295 | 0.11615 296 | 0.02904 297 | 0.85670 298 | 0.21417 299 | -1.61900 300 | -0.40475 301 | 1.98390 302 | 0.49597 303 | -1.86172 304 | -0.46543 305 | 1.28262 306 | 0.32065 307 | -0.38931 308 | -0.09733 309 | -0.60063 310 | -0.15016 311 | 1.44307 312 | 0.36077 313 | -1.93030 314 | -0.48257 315 | 1.94428 316 | 0.48607 317 | -1.48062 318 | -0.37015 319 | 0.65398 320 | 0.16349 321 | 0.33264 322 | 0.08316 323 | -1.23879 324 | -0.30970 325 | 1.84053 326 | 0.46013 327 | -1.99021 328 | -0.49755 329 | 1.65203 330 | 0.41301 331 | -0.90740 332 | -0.22685 333 | -0.05964 334 | -0.01491 335 | 1.01192 336 | 0.25298 337 | -1.71603 338 | -0.42901 339 | 1.99771 340 | 0.49943 341 | -1.79008 342 | -0.44752 343 | 1.14377 344 | 0.28594 345 | -0.21574 346 | -0.05393 347 | -0.76512 348 | -0.19128 349 | 1.55855 350 | 0.38964 351 | -1.96939 352 | -0.49235 353 | 1.89580 354 | 0.47395 355 | -1.35757 356 | -0.33939 357 | 0.48606 358 | 0.12151 359 | 0.50480 360 | 0.12620 361 | -1.37132 362 | -0.34283 363 | 1.90173 364 | 0.47543 365 | -1.96504 366 | -0.49126 367 | 1.54628 368 | 0.38657 369 | -0.74826 370 | -0.18707 371 | -0.23437 372 | -0.05859 373 | 1.15933 374 | 0.28983 375 | -1.79921 376 | -0.44980 377 | 1.99759 378 | 0.49940 379 | -1.70547 380 | -0.42637 381 | 0.99536 382 | 0.24884 383 | -0.04058 384 | -0.01015 385 | -0.92453 386 | -0.23113 387 | 1.66209 388 | 0.41552 389 | -1.99191 390 | -0.49798 391 | 1.83267 392 | 0.45817 393 | -1.22376 394 | -0.30594 395 | 0.31488 396 | 0.07872 397 | 0.67218 398 | 0.16805 399 | -1.49424 400 | -0.37356 401 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/PandasOut.elev: -------------------------------------------------------------------------------- 1 | 4.92561 2 | -3.90889 3 | 1.93142 4 | 0.52018 5 | -2.84186 6 | 4.46750 7 | -4.99650 8 | 4.29881 9 | -2.54650 10 | 0.16777 11 | 2.25141 12 | -4.11691 13 | 4.97341 14 | -4.60906 15 | 3.11324 16 | -0.85236 17 | -1.61788 18 | 3.68998 19 | -4.85634 20 | 4.83031 21 | -3.61959 22 | 1.52080 23 | 0.95263 24 | -3.19144 25 | 4.64648 26 | -4.96275 27 | 4.05983 28 | -2.15964 29 | -0.27083 30 | 2.63460 31 | -4.35009 32 | 4.99781 33 | -4.41999 34 | 2.75821 35 | -0.41889 36 | -2.02486 37 | 3.97219 38 | -4.94304 39 | 4.69965 40 | -3.30295 41 | 1.09664 42 | 1.37882 43 | -3.51589 44 | 4.79048 45 | -4.88965 46 | 3.78764 47 | -1.75651 48 | -0.70605 49 | 2.99599 50 | -4.54986 51 | 4.98682 52 | -4.19923 53 | 2.38091 54 | 0.01998 55 | -2.41766 56 | 4.22186 57 | -4.98853 58 | 4.53280 59 | -2.96253 60 | 0.66481 61 | 1.79394 62 | -3.81447 63 | 4.89851 64 | -4.77901 65 | 3.48767 66 | -1.33824 67 | -1.13820 68 | 3.33363 69 | -4.71276 70 | 4.93491 71 | -3.94686 72 | 1.98912 73 | 0.45930 74 | -2.79317 75 | 4.44055 76 | -4.99820 77 | 4.32864 78 | -2.59837 79 | 0.22922 80 | 2.19602 81 | -4.08167 82 | 4.96755 83 | -4.63243 84 | 3.16001 85 | -0.91242 86 | -1.56103 87 | 3.64916 88 | -4.84046 89 | 4.84572 90 | -3.66114 91 | 1.57918 92 | 0.89169 93 | -3.14537 94 | 4.62491 95 | -4.96965 96 | 4.09385 97 | -2.21313 98 | -0.20867 99 | 2.58131 100 | -4.32074 101 | 4.99749 102 | -4.44920 103 | 2.80805 104 | -0.47796 105 | -1.96841 106 | 3.93369 107 | -4.93263 108 | 4.72015 109 | -3.34968 110 | 1.15568 111 | 1.32135 112 | -3.47274 113 | 4.77302 114 | -4.90142 115 | 3.82672 116 | -1.81335 117 | -0.64533 118 | 2.94643 119 | -4.52435 120 | 4.99125 121 | -4.23289 122 | 2.43432 123 | -0.03865 124 | -2.36450 125 | 4.18734 126 | -4.98411 127 | 4.55816 128 | -3.01294 129 | 0.72621 130 | 1.73859 131 | -3.77549 132 | 4.88522 133 | -4.79540 134 | 3.52983 135 | -1.39788 136 | -1.07792 137 | 3.28895 138 | -4.69291 139 | 4.94501 140 | -3.98317 141 | 2.04400 142 | 0.39826 143 | -2.74204 144 | 4.41187 145 | -4.99939 146 | 4.35910 147 | -2.65001 148 | 0.29043 149 | 2.14180 150 | -4.04765 151 | 4.95971 152 | -4.65422 153 | 3.20658 154 | -0.97317 155 | -1.50157 156 | 3.60735 157 | -4.82584 158 | 4.86114 159 | -3.70140 160 | 1.63447 161 | 0.83155 162 | -3.09653 163 | 4.60116 164 | -4.97601 165 | 4.13052 166 | -2.26795 167 | -0.14972 168 | 2.52924 169 | -4.28937 170 | 4.99473 171 | -4.47589 172 | 2.85919 173 | -0.53860 174 | -1.91286 175 | 3.89555 176 | -4.92317 177 | 4.74038 178 | -3.39432 179 | 1.21433 180 | 1.26243 181 | -3.42772 182 | 4.75386 183 | -4.91293 184 | 3.86628 185 | -1.87055 186 | -0.58658 187 | 2.89832 188 | -4.49740 189 | 4.99397 190 | -4.26415 191 | 2.48842 192 | -0.10122 193 | -2.31141 194 | 4.15518 195 | -4.97962 196 | 4.58167 197 | -3.05953 198 | 0.78717 199 | 1.68044 200 | -3.73552 201 | -------------------------------------------------------------------------------- /ttide/tests/data/predict/PandasOut.vel: -------------------------------------------------------------------------------- 1 | 1.97022 2 | 0.49255 3 | -1.56344 4 | -0.39086 5 | 0.77258 6 | 0.19315 7 | 0.20788 8 | 0.05197 9 | -1.13685 10 | -0.28421 11 | 1.78718 12 | 0.44679 13 | -1.99841 14 | -0.49960 15 | 1.71947 16 | 0.42987 17 | -1.01874 18 | -0.25468 19 | 0.06711 20 | 0.01678 21 | 0.90058 22 | 0.22515 23 | -1.64685 24 | -0.41171 25 | 1.98937 26 | 0.49734 27 | -1.84343 28 | -0.46086 29 | 1.24541 30 | 0.31135 31 | -0.34112 32 | -0.08528 33 | -0.64735 34 | -0.16184 35 | 1.47605 36 | 0.36901 37 | -1.94238 38 | -0.48559 39 | 1.93211 40 | 0.48303 41 | -1.44790 42 | -0.36197 43 | 0.60839 44 | 0.15210 45 | 0.38110 46 | 0.09528 47 | -1.27671 48 | -0.31918 49 | 1.85847 50 | 0.46462 51 | -1.98499 52 | -0.49625 53 | 1.62408 54 | 0.40602 55 | -0.86392 56 | -0.21598 57 | -0.10845 58 | -0.02711 59 | 1.05391 60 | 0.26348 61 | -1.73993 62 | -0.43498 63 | 1.99902 64 | 0.49976 65 | -1.76814 66 | -0.44204 67 | 1.10336 68 | 0.27584 69 | -0.16739 70 | -0.04185 71 | -0.80995 72 | -0.20249 73 | 1.58877 74 | 0.39719 75 | -1.97720 76 | -0.49430 77 | 1.87991 78 | 0.46998 79 | -1.32129 80 | -0.33032 81 | 0.43855 82 | 0.10964 83 | 0.55167 84 | 0.13792 85 | -1.40614 86 | -0.35154 87 | 1.91614 88 | 0.47903 89 | -1.95608 90 | -0.48902 91 | 1.51500 92 | 0.37875 93 | -0.70249 94 | -0.17562 95 | -0.28239 96 | -0.07060 97 | 1.19837 98 | 0.29959 99 | -1.81985 100 | -0.45496 101 | 1.99482 102 | 0.49870 103 | -1.67983 104 | -0.41996 105 | 0.95215 106 | 0.23804 107 | 0.00804 108 | 0.00201 109 | -0.96684 110 | -0.24171 111 | 1.68880 112 | 0.42220 113 | -1.99555 114 | -0.49889 115 | 1.81309 116 | 0.45327 117 | -1.18494 118 | -0.29623 119 | 0.26588 120 | 0.06647 121 | 0.71746 122 | 0.17936 123 | -1.52573 124 | -0.38143 125 | 1.95958 126 | 0.48989 127 | -1.91161 128 | -0.47790 129 | 1.39491 130 | 0.34873 131 | -0.53531 132 | -0.13383 133 | -0.45516 134 | -0.11379 135 | 1.33343 136 | 0.33336 137 | -1.88525 138 | -0.47131 139 | 1.97399 140 | 0.49350 141 | -1.57856 142 | -0.39464 143 | 0.79569 144 | 0.19892 145 | 0.18356 146 | 0.04589 147 | -1.11734 148 | -0.27934 149 | 1.77630 150 | 0.44407 151 | -1.99927 152 | -0.49982 153 | 1.73138 154 | 0.43285 155 | -1.03928 156 | -0.25982 157 | 0.09186 158 | 0.02297 159 | 0.87838 160 | 0.21959 161 | -1.63291 162 | -0.40823 163 | 1.98693 164 | 0.49673 165 | -1.85280 166 | -0.46320 167 | 1.26414 168 | 0.31604 169 | -0.36502 170 | -0.09125 171 | -0.62445 172 | -0.15611 173 | 1.45971 174 | 0.36493 175 | -1.93624 176 | -0.48406 177 | 1.93813 178 | 0.48453 179 | -1.46443 180 | -0.36611 181 | 0.63190 182 | 0.15797 183 | 0.35677 184 | 0.08919 185 | -1.25832 186 | -0.31458 187 | 1.84983 188 | 0.46246 189 | -1.98778 190 | -0.49695 191 | 1.63760 192 | 0.40940 193 | -0.88533 194 | -0.22133 195 | -0.08348 196 | -0.02087 197 | 1.03267 198 | 0.25817 199 | -1.72825 200 | -0.43206 201 | 1.99884 202 | 0.49971 203 | -1.77977 204 | -0.44494 205 | 1.12333 206 | 0.28083 207 | -0.19111 208 | -0.04778 209 | -0.78747 210 | -0.19687 211 | 1.57343 212 | 0.39336 213 | -1.97290 214 | -0.49322 215 | 1.88814 216 | 0.47204 217 | -1.34003 218 | -0.33501 219 | 0.46213 220 | 0.11553 221 | 0.52862 222 | 0.13216 223 | -1.38897 224 | -0.34724 225 | 1.90918 226 | 0.47729 227 | -1.96060 228 | -0.49015 229 | 1.53078 230 | 0.38270 231 | -0.72534 232 | -0.18133 233 | -0.25833 234 | -0.06458 235 | 1.17847 236 | 0.29462 237 | -1.80956 238 | -0.45239 239 | 1.99671 240 | 0.49918 241 | -1.69322 242 | -0.42330 243 | 0.97356 244 | 0.24339 245 | -0.01547 246 | -0.00387 247 | -0.94576 248 | -0.23644 249 | 1.67488 250 | 0.41872 251 | -1.99365 252 | -0.49841 253 | 1.82343 254 | 0.45586 255 | -1.20507 256 | -0.30127 257 | 0.29032 258 | 0.07258 259 | 0.69525 260 | 0.17381 261 | -1.51013 262 | -0.37753 263 | 1.95425 264 | 0.48856 265 | -1.91818 266 | -0.47955 267 | 1.41185 268 | 0.35296 269 | -0.55908 270 | -0.13977 271 | -0.43108 272 | -0.10777 273 | 1.31548 274 | 0.32887 275 | -1.87730 276 | -0.46932 277 | 1.97808 278 | 0.49452 279 | -1.59313 280 | -0.39828 281 | 0.81756 282 | 0.20439 283 | 0.15920 284 | 0.03980 285 | -1.09674 286 | -0.27419 287 | 1.76486 288 | 0.44121 289 | -1.99987 290 | -0.49997 291 | 1.74346 292 | 0.43587 293 | -1.05994 294 | -0.26499 295 | 0.11637 296 | 0.02909 297 | 0.85674 298 | 0.21418 299 | -1.61917 300 | -0.40479 301 | 1.98387 302 | 0.49597 303 | -1.86165 304 | -0.46541 305 | 1.28254 306 | 0.32063 307 | -0.38936 308 | -0.09734 309 | -0.60048 310 | -0.15012 311 | 1.44315 312 | 0.36079 313 | -1.93039 314 | -0.48260 315 | 1.94422 316 | 0.48605 317 | -1.48062 318 | -0.37016 319 | 0.65392 320 | 0.16348 321 | 0.33267 322 | 0.08317 323 | -1.23865 324 | -0.30966 325 | 1.84052 326 | 0.46013 327 | -1.99032 328 | -0.49758 329 | 1.65210 330 | 0.41302 331 | -0.90737 332 | -0.22684 333 | -0.05985 334 | -0.01496 335 | 1.01191 336 | 0.25298 337 | -1.71570 338 | -0.42893 339 | 1.99775 340 | 0.49944 341 | -1.79039 342 | -0.44760 343 | 1.14378 344 | 0.28594 345 | -0.21546 346 | -0.05387 347 | -0.76528 348 | -0.19132 349 | 1.55824 350 | 0.38956 351 | -1.96910 352 | -0.49228 353 | 1.89618 354 | 0.47404 355 | -1.35786 356 | -0.33946 357 | 0.48572 358 | 0.12143 359 | 0.50508 360 | 0.12627 361 | -1.37112 362 | -0.34278 363 | 1.90139 364 | 0.47535 365 | -1.96515 366 | -0.49129 367 | 1.54672 368 | 0.38668 369 | -0.74815 370 | -0.18704 371 | -0.23480 372 | -0.05870 373 | 1.15922 374 | 0.28980 375 | -1.79890 376 | -0.44972 377 | 1.99762 378 | 0.49940 379 | -1.70571 380 | -0.42643 381 | 0.99543 382 | 0.24886 383 | -0.04033 384 | -0.01008 385 | -0.92460 386 | -0.23115 387 | 1.66182 388 | 0.41546 389 | -1.99195 390 | -0.49799 391 | 1.83285 392 | 0.45821 393 | -1.22366 394 | -0.30592 395 | 0.31481 396 | 0.07870 397 | 0.67211 398 | 0.16803 399 | -1.49416 400 | -0.37354 401 | -------------------------------------------------------------------------------- /ttide/tests/data/print/5constit.elev: -------------------------------------------------------------------------------- 1 | ----------------------------------- 2 | nobs = 1001 3 | ngood = 1001 4 | record length (days) = 41.71 5 | rayleigh criterion = 1.0 6 | 7 | Phases at central time 8 | x0= 2.34e-06 xtrend= 0 9 | var(data)= 12.53 var(prediction)= 12.53 var(residual)= 0.00 10 | var(prediction)/var(data) (%) = 100.0 11 | 12 | tidal amplitude and phase with 95 % CI estimates 13 | tide freq amp amp_err pha pha_err snr 14 | * O1 0.0387307 0.0004 0.000 268.21 23.81 5.2 15 | * K1 0.0417807 0.0004 0.000 87.97 27.03 5.3 16 | N2 0.0789992 0.0029 0.006 267.20 155.00 0.28 17 | * M2 0.0805114 5.0002 0.009 267.25 0.09 3.2e+05 18 | S2 0.0833333 0.0060 0.008 267.14 75.90 0.55 19 | -------------------------------------------------------------------------------- /ttide/tests/data/print/5constit.vel: -------------------------------------------------------------------------------- 1 | ----------------------------------- 2 | nobs = 1001 3 | ngood = 1001 4 | record length (days) = 41.71 5 | rayleigh criterion = 1.0 6 | 7 | Phases at central time 8 | x0= 9.35e-07 xtrend= 0 9 | var(data)= 2.00 var(prediction)= 2.00 var(residual)= 0.00 10 | var(prediction)/var(data) (%) = 100.0 11 | 12 | y0= 2.34e-07 ytrend= 0 13 | var(data)= 0.13 var(prediction)= 0.13 var(residual)= 0.00 14 | var(prediction)/var(data) (%) = 100.0 15 | 16 | total_var= 2.129597 pred_var= 2.129714 17 | total_var/pred_var (%) = 100.0 18 | ellipse parameters with 95 % CI estimates 19 | tide freq major emaj minor emin inc einc pha epha snr 20 | * O1 0.0387307 0.0002 0.000 0.0000 0.000 14.04 8.27 268.21 22.19 5.8 21 | * K1 0.0417807 0.0001 0.000 0.0000 0.000 14.04 8.45 87.97 25.74 6.2 22 | N2 0.0789992 0.0012 0.002 0.0000 0.001 14.04 26.38 267.20 136.95 0.24 23 | * M2 0.0805114 2.0617 0.003 0.0000 0.001 14.04 0.03 267.25 0.10 3.8e+05 24 | S2 0.0833333 0.0025 0.003 0.0000 0.001 14.04 18.82 267.14 72.87 0.86 25 | -------------------------------------------------------------------------------- /ttide/tests/data/print/M2-Stime.shallowM10: -------------------------------------------------------------------------------- 1 | ----------------------------------- 2 | nobs = 1001 3 | ngood = 1001 4 | record length (days) = 41.71 5 | start time: 2103-09-18 00:00:00 6 | rayleigh criterion = 1.0 7 | 8 | Greenwich phase computed, no nodal corrections 9 | x0= 3.41e-06 xtrend= 0 10 | var(data)= 13.04 var(prediction)= 13.04 var(residual)= 0.00 11 | var(prediction)/var(data) (%) = 100.0 12 | 13 | tidal amplitude and phase with 95 % CI estimates 14 | tide freq amp amp_err pha pha_err snr 15 | * M2 0.0805114 5.0000 0.008 324.64 0.09 3.5e+05 16 | * M10 0.4025570 1.0000 0.000 186.70 0.00 1.1e+11 17 | -------------------------------------------------------------------------------- /ttide/tests/data/print/M2.shallowM10: -------------------------------------------------------------------------------- 1 | ----------------------------------- 2 | nobs = 1001 3 | ngood = 1001 4 | record length (days) = 41.71 5 | rayleigh criterion = 1.0 6 | 7 | Phases at central time 8 | x0= 3.41e-06 xtrend= 0 9 | var(data)= 13.04 var(prediction)= 13.04 var(residual)= 0.00 10 | var(prediction)/var(data) (%) = 100.0 11 | 12 | tidal amplitude and phase with 95 % CI estimates 13 | tide freq amp amp_err pha pha_err snr 14 | * M2 0.0805114 5.0000 0.008 267.25 0.09 3.5e+05 15 | * M10 0.4025570 1.0000 0.000 259.74 0.00 1.1e+11 16 | -------------------------------------------------------------------------------- /ttide/tests/data/print/M2only-Stime-lat.elev: -------------------------------------------------------------------------------- 1 | ----------------------------------- 2 | nobs = 1001 3 | ngood = 1001 4 | record length (days) = 41.71 5 | start time: 2103-09-18 00:00:00 6 | rayleigh criterion = 1.0 7 | 8 | Greenwich phase computed with nodal 9 | corrections applied to amplitude 10 | and phase relative to center time 11 | 12 | x0= 3.42e-06 xtrend= 0 13 | var(data)= 12.53 var(prediction)= 12.64 var(residual)= 0.02 14 | var(prediction)/var(data) (%) = 100.9 15 | 16 | tidal amplitude and phase with 95 % CI estimates 17 | tide freq amp amp_err pha pha_err snr 18 | * M2 0.0805114 5.0219 0.009 326.60 0.09 3.5e+05 19 | -------------------------------------------------------------------------------- /ttide/tests/data/print/M2only-Stime-lat.vel: -------------------------------------------------------------------------------- 1 | ----------------------------------- 2 | nobs = 1001 3 | ngood = 1001 4 | record length (days) = 41.71 5 | start time: 2103-09-18 00:00:00 6 | rayleigh criterion = 1.0 7 | 8 | Greenwich phase computed with nodal 9 | corrections applied to amplitude 10 | and phase relative to center time 11 | 12 | x0= 1.37e-06 xtrend= 0 13 | var(data)= 2.00 var(prediction)= 2.02 var(residual)= 0.00 14 | var(prediction)/var(data) (%) = 100.9 15 | 16 | y0= 3.42e-07 ytrend= 0 17 | var(data)= 0.13 var(prediction)= 0.13 var(residual)= 0.00 18 | var(prediction)/var(data) (%) = 100.9 19 | 20 | total_var= 2.129597 pred_var= 2.148228 21 | total_var/pred_var (%) = 100.9 22 | ellipse parameters with 95 % CI estimates 23 | tide freq major emaj minor emin inc einc pha epha snr 24 | * M2 0.0805114 2.0706 0.003 0.0000 0.001 14.04 0.03 326.60 0.08 3.7e+05 25 | -------------------------------------------------------------------------------- /ttide/tests/data/print/M2only-Stime.elev: -------------------------------------------------------------------------------- 1 | ----------------------------------- 2 | nobs = 1001 3 | ngood = 1001 4 | record length (days) = 41.71 5 | start time: 2103-09-18 00:00:00 6 | rayleigh criterion = 1.0 7 | 8 | Greenwich phase computed, no nodal corrections 9 | x0= 3.42e-06 xtrend= 0 10 | var(data)= 12.53 var(prediction)= 12.53 var(residual)= 0.00 11 | var(prediction)/var(data) (%) = 100.0 12 | 13 | tidal amplitude and phase with 95 % CI estimates 14 | tide freq amp amp_err pha pha_err snr 15 | * M2 0.0805114 5.0000 0.008 324.64 0.09 3.5e+05 16 | -------------------------------------------------------------------------------- /ttide/tests/data/print/M2only-Stime.vel: -------------------------------------------------------------------------------- 1 | ----------------------------------- 2 | nobs = 1001 3 | ngood = 1001 4 | record length (days) = 41.71 5 | start time: 2103-09-18 00:00:00 6 | rayleigh criterion = 1.0 7 | 8 | Greenwich phase computed, no nodal corrections 9 | x0= 1.37e-06 xtrend= 0 10 | var(data)= 2.00 var(prediction)= 2.00 var(residual)= 0.00 11 | var(prediction)/var(data) (%) = 100.0 12 | 13 | y0= 3.42e-07 ytrend= 0 14 | var(data)= 0.13 var(prediction)= 0.13 var(residual)= 0.00 15 | var(prediction)/var(data) (%) = 100.0 16 | 17 | total_var= 2.129597 pred_var= 2.129491 18 | total_var/pred_var (%) = 100.0 19 | ellipse parameters with 95 % CI estimates 20 | tide freq major emaj minor emin inc einc pha epha snr 21 | * M2 0.0805114 2.0615 0.003 0.0000 0.001 14.04 0.03 324.64 0.08 3.7e+05 22 | -------------------------------------------------------------------------------- /ttide/tests/data/print/M2only.elev: -------------------------------------------------------------------------------- 1 | ----------------------------------- 2 | nobs = 1001 3 | ngood = 1001 4 | record length (days) = 41.71 5 | rayleigh criterion = 1.0 6 | 7 | Phases at central time 8 | x0= 3.42e-06 xtrend= 0 9 | var(data)= 12.53 var(prediction)= 12.53 var(residual)= 0.00 10 | var(prediction)/var(data) (%) = 100.0 11 | 12 | tidal amplitude and phase with 95 % CI estimates 13 | tide freq amp amp_err pha pha_err snr 14 | * M2 0.0805114 5.0000 0.008 267.25 0.09 3.5e+05 15 | -------------------------------------------------------------------------------- /ttide/tests/data/print/M2only.vel: -------------------------------------------------------------------------------- 1 | ----------------------------------- 2 | nobs = 1001 3 | ngood = 1001 4 | record length (days) = 41.71 5 | rayleigh criterion = 1.0 6 | 7 | Phases at central time 8 | x0= 1.37e-06 xtrend= 0 9 | var(data)= 2.00 var(prediction)= 2.00 var(residual)= 0.00 10 | var(prediction)/var(data) (%) = 100.0 11 | 12 | y0= 3.42e-07 ytrend= 0 13 | var(data)= 0.13 var(prediction)= 0.13 var(residual)= 0.00 14 | var(prediction)/var(data) (%) = 100.0 15 | 16 | total_var= 2.129597 pred_var= 2.129491 17 | total_var/pred_var (%) = 100.0 18 | ellipse parameters with 95 % CI estimates 19 | tide freq major emaj minor emin inc einc pha epha snr 20 | * M2 0.0805114 2.0615 0.003 0.0000 0.001 14.04 0.03 267.25 0.08 3.7e+05 21 | -------------------------------------------------------------------------------- /ttide/tests/data/print/NoArgs.elev: -------------------------------------------------------------------------------- 1 | ----------------------------------- 2 | nobs = 1001 3 | ngood = 1001 4 | record length (days) = 41.71 5 | rayleigh criterion = 1.0 6 | 7 | Phases at central time 8 | x0= 3.66e-06 xtrend= 0 9 | var(data)= 12.53 var(prediction)= 12.53 var(residual)= 0.00 10 | var(prediction)/var(data) (%) = 100.0 11 | 12 | tidal amplitude and phase with 95 % CI estimates 13 | tide freq amp amp_err pha pha_err snr 14 | MM 0.0015122 0.0004 0.000 89.79 54.10 0.87 15 | MSF 0.0028219 0.0001 0.000 266.87 136.60 0.2 16 | ALP1 0.0343966 0.0004 0.000 269.34 53.53 1.7 17 | 2Q1 0.0357064 0.0004 0.000 88.36 43.39 1.9 18 | Q1 0.0372185 0.0003 0.000 89.82 60.76 0.83 19 | O1 0.0387307 0.0004 0.000 268.05 46.05 1.4 20 | NO1 0.0402686 0.0004 0.000 269.19 48.41 1.8 21 | K1 0.0417807 0.0004 0.000 87.64 51.69 1.5 22 | J1 0.0432929 0.0005 0.000 88.85 41.65 2 23 | OO1 0.0448308 0.0003 0.000 266.97 74.05 1.1 24 | * UPS1 0.0463430 0.0006 0.000 268.43 33.04 3.5 25 | EPS2 0.0761773 0.0009 0.005 267.80 251.11 0.026 26 | MU2 0.0776895 0.0053 0.007 87.30 88.33 0.56 27 | N2 0.0789992 0.0017 0.006 267.09 175.81 0.09 28 | * M2 0.0805114 4.9998 0.008 267.25 0.09 4.3e+05 29 | L2 0.0820236 0.0016 0.006 87.01 178.44 0.075 30 | S2 0.0833333 0.0057 0.008 267.14 87.83 0.48 31 | ETA2 0.0850736 0.0015 0.006 266.89 203.01 0.074 32 | * MO3 0.1192421 0.0002 0.000 264.35 41.96 2.1 33 | * M3 0.1207671 0.0003 0.000 87.16 25.12 4.4 34 | * MK3 0.1222921 0.0003 0.000 85.64 19.88 5.3 35 | SK3 0.1251141 0.0001 0.000 263.45 60.98 1.4 36 | * MN4 0.1595106 0.0002 0.000 264.90 30.36 4.8 37 | M4 0.1610228 0.0000 0.000 147.67 228.18 0.017 38 | SN4 0.1623326 0.0001 0.000 83.74 40.20 1.8 39 | MS4 0.1638447 0.0001 0.000 272.36 70.65 0.64 40 | * S4 0.1666667 0.0001 0.000 87.31 38.99 2.5 41 | * 2MK5 0.2028035 0.0001 0.000 89.11 31.00 3.1 42 | * 2SK5 0.2084474 0.0001 0.000 84.70 22.96 6.5 43 | 2MN6 0.2400221 0.0000 0.000 278.41 97.18 0.36 44 | * M6 0.2415342 0.0001 0.000 266.15 31.65 3.8 45 | * 2MS6 0.2443561 0.0001 0.000 83.27 41.37 3.2 46 | 2SM6 0.2471781 0.0000 0.000 258.44 57.93 0.91 47 | * 3MK7 0.2833149 0.0000 0.000 261.56 14.92 23 48 | * M8 0.3220456 0.0000 0.000 28.15 5.42 2.5e+02 49 | -------------------------------------------------------------------------------- /ttide/tests/data/print/NoArgs.vel: -------------------------------------------------------------------------------- 1 | ----------------------------------- 2 | nobs = 1001 3 | ngood = 1001 4 | record length (days) = 41.71 5 | rayleigh criterion = 1.0 6 | 7 | Phases at central time 8 | x0= 1.47e-06 xtrend= 0 9 | var(data)= 2.00 var(prediction)= 2.00 var(residual)= 0.00 10 | var(prediction)/var(data) (%) = 100.0 11 | 12 | y0= 3.66e-07 ytrend= 0 13 | var(data)= 0.13 var(prediction)= 0.13 var(residual)= 0.00 14 | var(prediction)/var(data) (%) = 100.0 15 | 16 | total_var= 2.129597 pred_var= 2.129334 17 | total_var/pred_var (%) = 100.0 18 | ellipse parameters with 95 % CI estimates 19 | tide freq major emaj minor emin inc einc pha epha snr 20 | MM 0.0015122 0.0001 0.000 0.0000 0.000 14.04 16.77 89.79 51.68 1 21 | MSF 0.0028219 0.0000 0.000 0.0000 0.000 14.04 25.30 266.87 134.49 0.21 22 | ALP1 0.0343966 0.0001 0.000 0.0000 0.000 14.04 14.15 269.34 47.13 1.7 23 | * 2Q1 0.0357064 0.0002 0.000 0.0000 0.000 14.04 13.65 88.36 34.72 2.1 24 | Q1 0.0372185 0.0001 0.000 0.0000 0.000 14.04 17.98 89.82 60.72 1.1 25 | O1 0.0387307 0.0002 0.000 0.0000 0.000 14.04 14.64 268.05 39.88 1.9 26 | NO1 0.0402686 0.0002 0.000 0.0000 0.000 14.04 13.18 269.19 43.44 1.8 27 | K1 0.0417807 0.0001 0.000 0.0000 0.000 14.04 15.55 87.64 47.04 1.4 28 | * J1 0.0432929 0.0002 0.000 0.0000 0.000 14.04 11.00 88.85 37.50 2.1 29 | OO1 0.0448308 0.0001 0.000 0.0000 0.000 14.04 19.01 266.97 73.33 1 30 | * UPS1 0.0463430 0.0003 0.000 0.0000 0.000 14.04 8.60 268.43 31.67 4.4 31 | EPS2 0.0761773 0.0004 0.002 0.0000 0.001 14.04 28.07 267.80 249.50 0.035 32 | MU2 0.0776895 0.0022 0.003 0.0000 0.001 14.04 19.96 87.30 83.89 0.58 33 | N2 0.0789992 0.0007 0.002 0.0000 0.001 14.04 25.27 267.09 177.68 0.097 34 | * M2 0.0805114 2.0615 0.003 0.0000 0.001 14.04 0.03 267.25 0.09 4.8e+05 35 | L2 0.0820236 0.0007 0.002 0.0000 0.001 14.04 24.50 87.01 172.31 0.095 36 | S2 0.0833333 0.0024 0.003 0.0000 0.001 14.04 20.95 267.14 85.25 0.53 37 | ETA2 0.0850736 0.0006 0.002 0.0000 0.001 14.04 23.79 266.89 199.54 0.088 38 | * MO3 0.1192421 0.0001 0.000 0.0000 0.000 14.04 13.20 264.35 39.35 2.4 39 | * M3 0.1207671 0.0001 0.000 0.0000 0.000 14.04 7.35 87.16 24.50 5.2 40 | * MK3 0.1222921 0.0001 0.000 0.0000 0.000 14.04 8.64 85.64 19.17 5.7 41 | SK3 0.1251141 0.0000 0.000 0.0000 0.000 14.04 17.06 263.45 59.49 1.5 42 | * MN4 0.1595106 0.0001 0.000 0.0000 0.000 14.04 9.24 264.90 28.37 5.6 43 | M4 0.1610228 0.0000 0.000 0.0000 0.000 14.04 31.35 147.67 229.67 0.02 44 | * SN4 0.1623326 0.0000 0.000 0.0000 0.000 14.04 10.57 83.74 36.69 2.1 45 | MS4 0.1638447 0.0000 0.000 0.0000 0.000 14.04 19.87 272.36 67.53 0.76 46 | * S4 0.1666667 0.0000 0.000 0.0000 0.000 14.04 10.59 87.31 35.55 2.8 47 | * 2MK5 0.2028035 0.0000 0.000 0.0000 0.000 14.04 9.46 89.11 28.20 3.9 48 | * 2SK5 0.2084474 0.0000 0.000 0.0000 0.000 14.04 7.86 84.70 21.38 6.9 49 | 2MN6 0.2400221 0.0000 0.000 0.0000 0.000 14.04 21.54 278.41 95.80 0.39 50 | * M6 0.2415342 0.0000 0.000 0.0000 0.000 14.04 10.60 266.15 28.83 4.4 51 | * 2MS6 0.2443561 0.0000 0.000 0.0000 0.000 14.04 10.66 83.27 38.60 4 52 | 2SM6 0.2471781 0.0000 0.000 0.0000 0.000 14.04 16.63 258.44 51.66 1.1 53 | * 3MK7 0.2833149 0.0000 0.000 0.0000 0.000 14.04 4.81 261.56 13.94 25 54 | * M8 0.3220456 0.0000 0.000 0.0000 0.000 14.04 1.78 28.15 5.00 1.2e+02 55 | -------------------------------------------------------------------------------- /ttide/tests/data/print/NoOutput.elev: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moflaher/ttide_py/60b10119e0d984aa2502d4075fd5267ec703491e/ttide/tests/data/print/NoOutput.elev -------------------------------------------------------------------------------- /ttide/tests/data/print/NoOutput.vel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moflaher/ttide_py/60b10119e0d984aa2502d4075fd5267ec703491e/ttide/tests/data/print/NoOutput.vel -------------------------------------------------------------------------------- /ttide/tests/data/print/PandasOut.elev: -------------------------------------------------------------------------------- 1 | ====================================================================== 2 | Number of observations = 1001 3 | Number of observations used = 1001 4 | Record length (days) = 41.71 5 | Phases at central time 6 | 7 | x0= 3.66e-06 xtrend= 0 8 | var(data)= 12.53 var(prediction)= 12.53 var(residual)= 0.00 9 | var(prediction)/var(data) (%) = 100.0 10 | 11 | Tidal amplitude and phase with 95 % CI estimates 12 | Freq Amp Amp Err Phase Phase Err SNR 13 | Tide 14 | MM 0.001512 0.00 0.00 89.8 54.1 0.9 15 | MSF 0.002822 0.00 0.00 266.9 136.6 0.2 16 | ALP1 0.034397 0.00 0.00 269.3 53.5 2 17 | 2Q1 0.035706 0.00 0.00 88.4 43.4 2 18 | Q1 0.037219 0.00 0.00 89.8 60.8 0.8 19 | O1 0.038731 0.00 0.00 268.0 46.1 1 20 | NO1 0.040269 0.00 0.00 269.2 48.4 2 21 | K1 0.041781 0.00 0.00 87.6 51.7 2 22 | J1 0.043293 0.00 0.00 88.9 41.7 2 23 | OO1 0.044831 0.00 0.00 267.0 74.0 1 24 | UPS1 0.046343 0.00 0.00 268.4 33.0 3 25 | EPS2 0.076177 0.00 0.01 267.8 251.1 0.03 26 | MU2 0.077689 0.01 0.01 87.3 88.3 0.6 27 | N2 0.078999 0.00 0.01 267.1 175.8 0.09 28 | M2 0.080511 5.00 0.01 267.2 0.1 4e+05 29 | L2 0.082024 0.00 0.01 87.0 178.4 0.08 30 | S2 0.083333 0.01 0.01 267.1 87.8 0.5 31 | ETA2 0.085074 0.00 0.01 266.9 203.0 0.07 32 | MO3 0.119242 0.00 0.00 264.4 42.0 2 33 | M3 0.120767 0.00 0.00 87.2 25.1 4 34 | MK3 0.122292 0.00 0.00 85.6 19.9 5 35 | SK3 0.125114 0.00 0.00 263.4 61.0 1 36 | MN4 0.159511 0.00 0.00 264.9 30.4 5 37 | M4 0.161023 0.00 0.00 147.7 228.2 0.02 38 | SN4 0.162333 0.00 0.00 83.7 40.2 2 39 | MS4 0.163845 0.00 0.00 272.4 70.7 0.6 40 | S4 0.166667 0.00 0.00 87.3 39.0 3 41 | 2MK5 0.202804 0.00 0.00 89.1 31.0 3 42 | 2SK5 0.208447 0.00 0.00 84.7 23.0 6 43 | 2MN6 0.240022 0.00 0.00 278.4 97.2 0.4 44 | M6 0.241534 0.00 0.00 266.2 31.7 4 45 | 2MS6 0.244356 0.00 0.00 83.3 41.4 3 46 | 2SM6 0.247178 0.00 0.00 258.4 57.9 0.9 47 | 3MK7 0.283315 0.00 0.00 261.6 14.9 2e+01 48 | M8 0.322046 0.00 0.00 28.1 5.4 3e+02 49 | ====================================================================== 50 | -------------------------------------------------------------------------------- /ttide/tests/data/print/PandasOut.vel: -------------------------------------------------------------------------------- 1 | ==================================================================================================================== 2 | Number of observations = 1001 3 | Number of observations used = 1001 4 | Record length (days) = 41.71 5 | Phases at central time 6 | 7 | x0= 1.47e-06 xtrend= 0 8 | var(data)= 2.00 var(prediction)= 2.00 var(residual)= 0.00 9 | var(prediction)/var(data) (%) = 100.0 10 | 11 | y0= 3.66e-07 ytrend= 0 12 | var(data)= 0.13 var(prediction)= 0.13 var(residual)= 0.00 13 | var(prediction)/var(data) (%) = 100.0 14 | 15 | total_var= 2.129597 pred_var= 2.129334 16 | total_var/pred_var (%) = 100.0 17 | Ellipse parameters with 95 % CI estimates 18 | Freq Major Major Err Minor Minor Err Inc Inc Err Phase Phase Err SNR 19 | Tide 20 | MM 0.001512 0.00 0.00 0.00 0.00 14.0 16.8 89.8 51.7 1 21 | MSF 0.002822 0.00 0.00 0.00 0.00 14.0 25.3 266.9 134.5 0.2 22 | ALP1 0.034397 0.00 0.00 0.00 0.00 14.0 14.1 269.3 47.1 2 23 | 2Q1 0.035706 0.00 0.00 0.00 0.00 14.0 13.7 88.4 34.7 2 24 | Q1 0.037219 0.00 0.00 0.00 0.00 14.0 18.0 89.8 60.7 1 25 | O1 0.038731 0.00 0.00 0.00 0.00 14.0 14.6 268.0 39.9 2 26 | NO1 0.040269 0.00 0.00 0.00 0.00 14.0 13.2 269.2 43.4 2 27 | K1 0.041781 0.00 0.00 0.00 0.00 14.0 15.6 87.6 47.0 1 28 | J1 0.043293 0.00 0.00 0.00 0.00 14.0 11.0 88.9 37.5 2 29 | OO1 0.044831 0.00 0.00 0.00 0.00 14.0 19.0 267.0 73.3 1 30 | UPS1 0.046343 0.00 0.00 0.00 0.00 14.0 8.6 268.4 31.7 4 31 | EPS2 0.076177 0.00 0.00 0.00 0.00 14.0 28.1 267.8 249.5 0.03 32 | MU2 0.077689 0.00 0.00 0.00 0.00 14.0 20.0 87.3 83.9 0.6 33 | N2 0.078999 0.00 0.00 0.00 0.00 14.0 25.3 267.1 177.7 0.1 34 | M2 0.080511 2.06 0.00 0.00 0.00 14.0 0.0 267.2 0.1 5e+05 35 | L2 0.082024 0.00 0.00 0.00 0.00 14.0 24.5 87.0 172.3 0.09 36 | S2 0.083333 0.00 0.00 0.00 0.00 14.0 20.9 267.1 85.3 0.5 37 | ETA2 0.085074 0.00 0.00 0.00 0.00 14.0 23.8 266.9 199.5 0.09 38 | MO3 0.119242 0.00 0.00 0.00 0.00 14.0 13.2 264.4 39.4 2 39 | M3 0.120767 0.00 0.00 0.00 0.00 14.0 7.4 87.2 24.5 5 40 | MK3 0.122292 0.00 0.00 0.00 0.00 14.0 8.6 85.6 19.2 6 41 | SK3 0.125114 0.00 0.00 0.00 0.00 14.0 17.1 263.4 59.5 2 42 | MN4 0.159511 0.00 0.00 0.00 0.00 14.0 9.2 264.9 28.4 6 43 | M4 0.161023 0.00 0.00 0.00 0.00 14.0 31.4 147.7 229.7 0.02 44 | SN4 0.162333 0.00 0.00 0.00 0.00 14.0 10.6 83.7 36.7 2 45 | MS4 0.163845 0.00 0.00 0.00 0.00 14.0 19.9 272.4 67.5 0.8 46 | S4 0.166667 0.00 0.00 0.00 0.00 14.0 10.6 87.3 35.6 3 47 | 2MK5 0.202804 0.00 0.00 0.00 0.00 14.0 9.5 89.1 28.2 4 48 | 2SK5 0.208447 0.00 0.00 0.00 0.00 14.0 7.9 84.7 21.4 7 49 | 2MN6 0.240022 0.00 0.00 0.00 0.00 14.0 21.5 278.4 95.8 0.4 50 | M6 0.241534 0.00 0.00 0.00 0.00 14.0 10.6 266.2 28.8 4 51 | 2MS6 0.244356 0.00 0.00 0.00 0.00 14.0 10.7 83.3 38.6 4 52 | 2SM6 0.247178 0.00 0.00 0.00 0.00 14.0 16.6 258.4 51.7 1 53 | 3MK7 0.283315 0.00 0.00 0.00 0.00 14.0 4.8 261.6 13.9 3e+01 54 | M8 0.322046 0.00 0.00 0.00 0.00 14.0 1.8 28.1 5.0 1e+02 55 | ==================================================================================================================== 56 | -------------------------------------------------------------------------------- /ttide/tests/predict_tests.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from ttide.t_tide import t_tide 3 | from ttide.tests import base as bmod 4 | import copy 5 | 6 | cases = copy.deepcopy(bmod.cases) 7 | 8 | t = np.arange(0, 60, 0.3) 9 | 10 | 11 | def compare_vec2file(x0, fname): 12 | x1 = np.loadtxt(bmod.testdir + 'data/predict/' + fname) 13 | if len(x1) == 2 * len(x0): 14 | x1 = x1.view(complex) 15 | assert (np.abs(x0 - x1) < 1e-2).all(), ("Test failed on file '%s'" % fname) 16 | 17 | 18 | def gen_predict_tests(make_data=False): 19 | 20 | for kwargs, fname in cases: 21 | kwargs['out_style'] = None 22 | out = t_tide(**kwargs) 23 | xout = out.t_predic(t) 24 | if make_data: 25 | np.savetxt(bmod.testdir + 'data/predict/' + fname, xout.view(float), fmt='%0.5f') 26 | yield None 27 | else: 28 | yield compare_vec2file, xout, fname 29 | 30 | # if __name__ == '__main__': 31 | 32 | # ### 33 | # # This block generates the output files. 34 | # # USE WITH CAUTION! 35 | # for tst in gen_predict_tests(make_data=True): 36 | # pass 37 | 38 | # # for f, vec, fname in gen_predict_tests(): 39 | # # f(vec, fname) 40 | -------------------------------------------------------------------------------- /ttide/tests/print_tests.py: -------------------------------------------------------------------------------- 1 | from ttide.t_tide import t_tide 2 | import ttide.tests.base as bmod 3 | from cStringIO import StringIO 4 | import sys 5 | import numpy as np 6 | 7 | 8 | def compare_string2file(string, fname): 9 | with open(bmod.testdir + 'data/print/' + fname, 'r') as fl: 10 | tdata = fl.read().replace('\r\n', '\n') 11 | string = string.replace('\r\n', '\n') 12 | # The above .replace() calls makes sure that line-endings are 13 | # consistent 14 | assert string == tdata, ("Test failed on file '%s'" % fname) 15 | 16 | 17 | def gen_print_tests(make_data=False): 18 | """A generator function for the 'print' tests. 19 | 20 | If make_data=True, this will write out the data files. 21 | """ 22 | out_old = sys.stdout 23 | for kwargs, fname in bmod.cases: 24 | np.random.seed(29034230) 25 | # Redirect stdout to a StringIO instance 26 | sys.stdout = stdout = StringIO() 27 | t_tide(**kwargs) 28 | sys.stdout = out_old 29 | if make_data: 30 | with open(bmod.testdir + 'data/print/' + fname, 'w') as fl: 31 | fl.write(stdout.getvalue()) 32 | yield None 33 | else: 34 | yield compare_string2file, stdout.getvalue(), fname 35 | 36 | 37 | # if __name__ == '__main__': 38 | 39 | # # ### 40 | # # # This block generates the output files. 41 | # # # USE WITH CAUTION! 42 | # # for t in gen_print_tests(make_data=True): 43 | # # pass 44 | 45 | # ### 46 | # # This block is for joining files for comparison to the old testdata.out file. 47 | # # It is not identical, but nearly so... 48 | # outstr = '' 49 | # for kwargs, fl in cases: 50 | # with open(testdir + 'data/' + fl, 'r') as fl: 51 | # outstr += fl.read() 52 | # outstr += '\n' + '*' * 80 + '\n\n' 53 | # with open(testdir + 'data/testdata.out2', 'w') as fl: 54 | # fl.write(outstr) 55 | -------------------------------------------------------------------------------- /ttide/time.py: -------------------------------------------------------------------------------- 1 | """ 2 | This modules is a reimplemntation of the MatPlotLib 'mpltime' format 3 | (ordinal + fractional time). 4 | 5 | This is an independent implementation of the mpltime format so that a 6 | package that uses mpltime does not require the entire MPL library. 7 | 8 | See this for more information: 9 | http://matplotlib.org/api/dates_api.html 10 | 11 | """ 12 | from __future__ import division 13 | import numpy as np 14 | from datetime import datetime, timedelta 15 | 16 | 17 | def num2date(mpltime): 18 | if np.ndarray in mpltime.__class__.__mro__: 19 | out = np.empty(len(mpltime), dtype='O') 20 | for idx, val in enumerate(mpltime.flat): 21 | out[idx] = num2date(val) 22 | out.shape = mpltime.shape 23 | return out 24 | return datetime.fromordinal(int(mpltime)) + timedelta(days=mpltime % 1) 25 | 26 | 27 | def date2num(dt): 28 | if isinstance(dt, np.ndarray): 29 | if dt.dtype.name.startswith('datetime64'): 30 | dt = dt.astype('O') 31 | out = np.empty(len(dt), dtype=np.float64) 32 | for idx, val in enumerate(dt.flat): 33 | out[idx] = date2num(val) 34 | out.shape = dt.shape 35 | return out 36 | return (dt.toordinal() + 37 | (((dt.microsecond / 1e6 + 38 | dt.second) / 60 + 39 | dt.minute) / 60 + 40 | dt.hour) / 24) 41 | 42 | 43 | # Not sure this is useful here... 44 | # def mpltime2matlab_datenum(time): 45 | # return time.view(np.ndarray) + 366 46 | --------------------------------------------------------------------------------