Skip to main content

DCT/FFT-based convolutional statistics for Cartesian and polar data

Project description

DCT-Toolkit: Convolutional Statistics

Python 3.8+ License: MIT

dct_toolkit provides DCT-based smoothing and normalized-convolution statistics for data with gaps. The current publication-prep track is intentionally focused on the convolution/statistics surface.

Current Scope (Stats-First)

  • DCT-based smoothing for 1D/N-D Cartesian data.
  • Polar smoothing with adaptive azimuth kernels.
  • Reflective boundaries via DCT and periodic azimuth boundaries via real FFT.
  • Robust local statistics (dct_mean, dct_variance, dct_std, dct_count) with NaN support.

Installation

pip

pip install .

When the package is published on PyPI, installation will be:

pip install dct-toolkit

from source

git clone <your-repo-url>
cd dct_toolkit
pip install .

conda (planned)

Conda-forge packaging is in preparation. Until the feedstock is published, you can install with pip inside a conda environment.

conda create -n dct-toolkit python=3.11 -y
conda activate dct-toolkit
pip install dct-toolkit

Quick Start

1) Robust Mean with Missing Data

import numpy as np
import dct_toolkit as dct

data = np.sin(np.linspace(0, 10, 200))
data[70:110] = np.nan

mu = dct.dct_mean(data, width=10.0)

1b) Prefill Before Full-Field Smoothing

prefilled = dct.dct_prefill(data, width=10.0, max_iter=3)
smoothed = dct.dct_smooth(prefilled, width=10.0)

2) Polar Smoothing with Periodic Azimuth

smoothed = dct.dct_smooth(
    radar_data,
    width=5.0,
    coordinates="polar",
    az_boundary="periodic",
    az_res_deg=1.0,
)

3) Local Variability Estimates

var = dct.dct_variance(data, width=10.0)
std = dct.dct_std(data, width=10.0)

Public API (Top Level)

  • dct_smooth
  • dct_count
  • dct_mean
  • dct_prefill
  • dct_variance
  • dct_std
  • smooth_cartesian
  • smooth_polar
  • get_dct_transfer_function
  • dct_convolve_1d

Notes on Gap Filling

Gap-filling methods remain in the repository for internal research, but they are de-scoped from the top-level public API for the initial convolution/statistics release.

Documentation

  • docs/MATHEMATICAL_BASIS.md
  • docs/API_REFERENCE.md

License

MIT. See LICENSE.

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

dct_toolkit-0.4.0.tar.gz (39.1 kB view details)

Uploaded Source

Built Distribution

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

dct_toolkit-0.4.0-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file dct_toolkit-0.4.0.tar.gz.

File metadata

  • Download URL: dct_toolkit-0.4.0.tar.gz
  • Upload date:
  • Size: 39.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for dct_toolkit-0.4.0.tar.gz
Algorithm Hash digest
SHA256 537979fc60ad7d335b7472e7f11f9ee2f02a35ff6c767a29d30cb2da3be2fac5
MD5 943743f6da056773daa1324a76dd4f50
BLAKE2b-256 17e499c69e5537c0fc22ac49995ce2a74bc3cfced2a683141d0bf29bb9cbbda9

See more details on using hashes here.

File details

Details for the file dct_toolkit-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: dct_toolkit-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for dct_toolkit-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e6aa346dbb6f9d03f8d536d5a591b3d41a142826ff59345669d76b32ef9bff3
MD5 6e3d804700bb1955ce767bf914c2b863
BLAKE2b-256 18ff46f8fb694a25cb4cd5d1474b0ab26c17348f19081d8d10d63556c7534e20

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