Skip to main content

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

Project description

pytides-py3

Tidal analysis and prediction library for Python 3.10+. 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.10, < 3.14
  • NumPy >= 2.2.6
  • SciPy >= 1.15.3

Development

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

Python version matrix test with uv:

bash scripts/test-python-matrix.sh

Supported-only or experimental-only runs are also available:

bash scripts/test-python-matrix.sh --supported-only
bash scripts/test-python-matrix.sh --experimental-only

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.1.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.1-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytides_py3-0.8.1.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.1.tar.gz
Algorithm Hash digest
SHA256 5db7af8ed7a7d6f8f503a1b42e04d5bbed770117a151d3c2ed94b73e20bae87f
MD5 b8bffef02b7b8f6a1347ac18801eb7b6
BLAKE2b-256 79017f6e718378a9b66ccb4926ee6af9349b47ee9ae2850db2a8d23444cb8c34

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytides_py3-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e830b61d8c2ac95ccec9994b42cd09a63e6f1d6a60ff2c8b5da7f7d36e526cac
MD5 404fdda9af89287bac5229b8ad871ed3
BLAKE2b-256 d952c8cae7df683992c5075e15252db2c7d9c102ecb61bbf0dc25763e268b15b

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