ttide_py
ttide_py copied to clipboard
function 't_get18consts' not defined
I'm trying to use ttide, and I have a time series that is longer than a year. I then get this error:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[26], line 2
1 elev = np.array(df['anomaly'])
----> 2 nameu, fu, tideconout, xout = tt.t_tide(elev, dt=1, lat=np.array(-25))
File ~/anaconda3/lib/python3.10/site-packages/ttide-0.3lfk-py3.10.egg/ttide/t_tide.py:257, in t_tide(xin, dt, stime, lat, out_style, outfile, corr_fs, corr_fac, secular, infiname, infirefname, ray, shallownames, constitnames, errcalc, synth, lsq)
254 centraltime = np.array([])
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
263 mu = len(fu)
File ~/anaconda3/lib/python3.10/site-packages/ttide-0.3lfk-py3.10.egg/ttide/t_utils.py:56, in constituents(minres, constit, shallow, infname, infref, centraltime)
53 ju = np.flatnonzero(const['df'] >= minres)
54 else:
55 # Choose them all if > 18.6 years.
---> 56 const, sat, cshallow = t_get18consts(centraltime)
58 ju = np.array([range(2,
59 (max(const['freq'].shape) + 1))]).reshape(1, -1).T
60 # Skip Z0
NameError: name 't_get18consts' is not defined
If I slice the time series in yearly periods, I have no issue.
The same problem, is there a solution?
I changed packages instead of trying to find a solution...utide works fine with long records (https://github.com/wesleybowman/UTide)
Thanks, I'll try it!