Skip to main content

조석 분석 및 예측을 위한 Python 라이브러리 (Tidal analysis and prediction library)

Project description

pytides-py3

Tidal analysis and prediction library for Python 3.11+. An improved fork of the original pytides, updated for NumPy 2.x and modern SciPy.

Installation

pip install pytides-py3

Or with UV:

uv add pytides-py3

Quick Start

from datetime import datetime, timedelta
from pytidespy3 import Tide, constituent

# Build a model from known constituents
model = Tide(
    constituents=[constituent._M2, constituent._S2, constituent._K1],
    amplitudes=[1.0, 0.5, 0.3],
    phases=[0.0, 90.0, 180.0],
)

# Predict tidal heights
times = [datetime(2023, 1, 1) + timedelta(hours=i) for i in range(24)]
heights = model.at(times)

# Get high/low water times
highs = list(model.highs(datetime(2023, 1, 1), datetime(2023, 1, 8)))
lows = list(model.lows(datetime(2023, 1, 1), datetime(2023, 1, 8)))

# Decompose observed data into harmonic constituents
fitted = Tide.decompose(heights=observed_heights, t=observed_times)

Main Features

  • Tidal analysis and prediction via Schureman's harmonic constituent method
  • 37 NOAA harmonic constituents (M2, S2, K1, O1, N2, etc.)
  • Robust fitting: NaN/inf auto-removal, weighted least squares, robust loss functions (huber, soft_l1, cauchy, arctan)
  • High/low water prediction with highs(), lows(), extrema()
  • Tide classification: form number-based (semidiurnal, mixed, diurnal)

Requirements

  • Python >= 3.11, < 3.14
  • NumPy >= 2.3.1
  • SciPy >= 1.16.0

Development

uv sync
uv run python -m unittest discover -s tests -v
uv build

References

  • Original pytides: https://github.com/sam-cox/pytides
  • Schureman, P. (1958). Manual of Harmonic Analysis and Prediction of Tides. U.S. Coast and Geodetic Survey, Special Publication No. 98.
  • Meeus, J. (1991). Astronomical Algorithms. Willmann-Bell.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytides_py3-0.8.0.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytides_py3-0.8.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file pytides_py3-0.8.0.tar.gz.

File metadata

  • Download URL: pytides_py3-0.8.0.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pytides_py3-0.8.0.tar.gz
Algorithm Hash digest
SHA256 8f618ad9b06cfbf1ee9ef837f648252129950480643ec148d87fa9d45a878db4
MD5 3b2e40aae0ab85978d7325ef0c02a9b0
BLAKE2b-256 4f81e375a70c5e2082083798db500ba85f25c08397ff2ff8a4b7cbe4477e202c

See more details on using hashes here.

File details

Details for the file pytides_py3-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: pytides_py3-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pytides_py3-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11e589eeb4ca7e4a46816f7e53515f03c105698ac89e46fb711f3a5ed344b45f
MD5 ce3c85a3891beac4143fc4ab74ea4067
BLAKE2b-256 393ac00c9ddb0ed3fd4d2a8810a59201c780ebe93347f4c1499e917df420103b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page