ttide_py icon indicating copy to clipboard operation
ttide_py copied to clipboard

function 't_get18consts' not defined

Open carocamargo opened this issue 1 year ago • 3 comments

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.

carocamargo avatar Jul 20 '23 20:07 carocamargo

The same problem, is there a solution?

foursevenlove avatar May 28 '24 12:05 foursevenlove

I changed packages instead of trying to find a solution...utide works fine with long records (https://github.com/wesleybowman/UTide)

carocamargo avatar May 28 '24 13:05 carocamargo

Thanks, I'll try it!

foursevenlove avatar May 30 '24 09:05 foursevenlove