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.5.0.tar.gz (43.3 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.5.0-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dct_toolkit-0.5.0.tar.gz
  • Upload date:
  • Size: 43.3 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.5.0.tar.gz
Algorithm Hash digest
SHA256 9650850ae15600cef28b87350a7c80d61fd9f868a246f4727bc5959e4bb2e7d8
MD5 710212387c6cba03bb39556c081b5d32
BLAKE2b-256 b2ff2d9b1f06a06fd2ec9c7ae6391e91cce6b7da2369f856a57f4831f35d054c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dct_toolkit-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 23.5 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae2ec46a75b8ea374f152ca6dc5ba0e1a3dce0ea5fc78f40ab82ac1c6c46f25c
MD5 233631bd5f4c985c16365311982faa29
BLAKE2b-256 3dd55c5309456b5ae17a2015ca288020254296293716348d5e5862172ff95c6f

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