Metadata-Version: 2.4
Name: wootils
Version: 0.0.4
Summary: Grab-bag of Python utilities for oceanographic/scientific data analysis.
Author-email: William Edge <william.edge@uwa.edu.au>
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://github.com/williamedge/wootils
Project-URL: Bug Tracker, https://github.com/williamedge/wootils/issues
Project-URL: Changelog, https://github.com/williamedge/wootils/releases
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Developers
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: xarray
Requires-Dist: matplotlib
Requires-Dist: pandas
Requires-Dist: pyproj
Requires-Dist: tqdm
Requires-Dist: xrft
Requires-Dist: colorstamps
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

[![Documentation status](https://readthedocs.org/projects/wootils/badge/?version=latest)](https://wootils.readthedocs.io/en/latest/?badge=latest)
[![PyPI version](https://badge.fury.io/py/wootils.svg)](https://badge.fury.io/py/wootils)
[![Downloads](https://static.pepy.tech/personalized-badge/wootils?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads)](https://pepy.tech/project/wootils)

# wootils

A grab-bag of Python utilities for oceanographic/scientific data analysis: harmonic-model
fitting, rolling-window filtering of unevenly spaced data, spectral analysis, geodesic/UTM
coordinate conversion, time-coordinate helpers, and plotting convenience functions built on
`numpy`, `scipy`, and `xarray`.

Please see the [examples](https://wootils.readthedocs.io/en/latest/examples.html) for a few
worked snippets.

## Documentation

Documentation is available on [read the docs](https://wootils.readthedocs.io/en/latest/).

## Installation

### pip

`pip install wootils`

### To install a local development version

`pip install -e ./`

### To install latest from github

`pip install git+https://github.com/williamedge/wootils.git`

## Features

- Harmonic-model fitting: design-matrix construction and least-squares fit/predict for
  annual (and other) harmonics, in `wootils.linalg`.
- Rolling-window filtering of unevenly spaced `xarray` data (boxcar, Gaussian-weighted,
  Savitzky-Golay), via the `.ufilt` accessor in `wootils.ufilters`.
- Spectral analysis: Nyquist/fundamental frequency estimation, chunked/overlapped PSD
  estimation, and quadratic barotropic-component removal, in `wootils.ofreqs`/`fft_utils`.
- Geodesic distance and lon/lat &rarr; UTM coordinate conversion, in `wootils.spatial`.
- Time-coordinate helpers (regularity/gap checks, season labeling) in `wootils.time_wutils`.
- Bivariate (u/v velocity) colormap plotting and other matplotlib convenience helpers, in
  `wootils.plotcolours`/`plotnice`/`plottimeseries`.

## Quick Usage

```python
import numpy as np
from wootils.linalg import fit_harmonic_model, predict_harmonic_model

# Fit the first two annual harmonics to a time series and evaluate the fit
params = fit_harmonic_model(time_sec, data, n_harmonics=2, mean=True)
fitted = predict_harmonic_model(time_sec, params, mean=True)
```

See the [examples](https://wootils.readthedocs.io/en/latest/examples.html) page for rolling
filters, UTM conversion, and frequency estimation.
