{"id":46739,"library":"utide","title":"utide","description":"A Python port of the MATLAB UTide package for tidal analysis and prediction of water levels and currents. Handles harmonic analysis and tidal prediction with robust handling of nodal/satellite corrections. Latest version 0.3.1, released 2023-09.","status":"active","version":"0.3.1","language":"python","source_language":"en","source_url":"https://github.com/wesleybowman/UTide","tags":["tidal analysis","harmonic analysis","oceanography","UTide"],"install":[{"cmd":"pip install utide","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core array operations and linear algebra","package":"numpy","optional":false},{"reason":"Optimization and interpolation routines","package":"scipy","optional":false},{"reason":"Optional for plotting utilities (if using utide.plot)","package":"matplotlib","optional":true}],"imports":[{"note":"The old MATLAB-style 'ut_solve' is not exported from the Python package; use 'solve' instead.","wrong":"from utide import ut_solve","symbol":"solve","correct":"from utide import solve"},{"note":"Old MATLAB name 'ut_reconstr' is not available; use 'reconstruct'.","wrong":"from utide import ut_reconstr","symbol":"reconstruct","correct":"from utide import reconstruct"},{"note":"","wrong":"","symbol":"harmonic_analysis","correct":"from utide import harmonic_analysis"}],"quickstart":{"code":"import numpy as np\nfrom utide import solve, reconstruct\n\n# Example time series (hourly for 35 days)\nt = np.arange(0, 35*24, 1)  # hours\n# Simulate water level with two tidal constituents\nwl = 1.0 * np.cos(2*np.pi * t/12.42) + 0.3 * np.cos(2*np.pi * t/12.0)\n# Perform harmonic analysis\ncoef = solve(t, wl, lat=45.0, nodal=True, trend=True, method='ols')\n# Reconstruct tidal prediction for the same time period\ntide = reconstruct(t, coef)\nprint(tide.h) # tidal elevation","lang":"python","description":"Basic tidal analysis and prediction using utide."},"warnings":[{"fix":"Replace method='robust' with method='ols' or method='lss'.","message":"The 'method' parameter in solve() no longer accepts 'robust' as of v0.3.0; use 'ols' (ordinary least squares) or 'lss' (least squares with iterative reweighting). The 'robust' option was removed without fallback.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Omit conf_int from the call; confidence intervals are handled automatically.","message":"The 'conf_int' parameter in solve() is deprecated as of v0.3.0 and will be removed in a future version. Confidence intervals are now automatically computed when method='ols' and can be accessed via coef.conf_int.","severity":"deprecated","affected_versions":">=0.3.0"},{"fix":"Convert time to hours since an arbitrary start. For example, if you have datetime array 'dt', do: t = (dt - dt[0]).total_seconds() / 3600.","message":"Input time array 't' must be in hours (not days, seconds, or datetime objects). Using datetime or days will produce incorrect frequencies and wrong results.","severity":"gotcha","affected_versions":"all"},{"fix":"Always provide a numeric latitude (e.g., lat=45.0) even if you are not interested in corrections; it changes the constituents used.","message":"The 'lat' parameter in solve() is required for nodal/satellite corrections. If omitted or set to None, no nodal corrections are applied, which may cause phase errors for long records (>1 year).","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'-09':37 '0.3.1':34 '2023':36 'analysi':12,22,39,41 'correct':31 'current':19 'handl':20,28 'harmon':21,40 'latest':32 'level':17 'matlab':7 'nodal/satellite':30 'oceanographi':42 'packag':9 'port':4 'predict':14,25 'python':3 'releas':35 'robust':27 'tidal':11,24,38 'utid':1,8,43 'version':33 'water':16","created_at":"2026-06-07T13:01:23.870053+00:00","updated_at":"2026-06-07T13:01:23.870053+00:00","problems":[{"fix":"Import 'solve' directly: from utide import solve","cause":"Users try to use the old MATLAB function name 'ut_solve' which is not exported in the Python package.","error":"AttributeError: module 'utide' has no attribute 'ut_solve'"},{"fix":"Replace method='robust' with method='ols' or method='lss'.","cause":"Using method='robust' which was removed in v0.3.0.","error":"ValueError: method must be one of 'ols' or 'lss'"},{"fix":"Remove conf_int from the call. Confidence intervals are automatically computed when suitable.","cause":"The 'conf_int' parameter was deprecated and removed in some recent version. It is no longer accepted.","error":"TypeError: solve() got an unexpected keyword argument 'conf_int'"},{"fix":"Pass a numeric latitude, e.g., lat=45.0.","cause":"No 'lat' parameter passed to solve(). While not an error, it may produce inaccurate results.","error":"UserWarning: Latitude not provided; nodal corrections not applied."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["analytics","science"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}