Skip to main content

AcyclePy: Advanced cyclostratigraphy toolkit

Project description

AcyclePy — Advanced Cyclostratigraphy and Time Series Analysis Toolkit

PyPI Python License

AcyclePy is the Python library companion to the Acycle desktop application for cyclostratigraphy, time series analysis, and paleoclimate research. It provides both a programmatic API for scripting and batch processing, and the full suite of Acycle desktop GUI tools.

Reference: Li, M., Hinnov, L., & Kump, L. (2019). Acycle: Time-series analysis software for paleoclimate research and education. Computers & Geosciences, 127, 12-22.


Installation

ash pip install acycle

Requirements: Python >= 3.8, numpy, scipy, pandas, matplotlib, PySide6, scikit-image, scikit-learn, Pillow, qt-material, astropy.


Quick Start — Programmatic API

`python import acycle as ac import numpy as np

Read time series data

s = ac.read_series("data.txt") # auto-detect whitespace/tab/comma s = ac.read_series("data.csv", delimiter=",") # explicit delimiter

Chain operations (fluent API)

s2 = s.clean(sort=True)
.interpolate(step=0.33)
.detrend(window=80)
.standardize()

Spectral analysis

from acycle import spectral freq, power = spectral._periodogram(s2.y) freq, power = spectral._mtm_spectrum(s2.y) # multitaper freq, power = spectral._lomb_scargle_spectrum(s2.x, s2.y) # uneven spacing

Wavelet analysis

from acycle import wavelet period, power, coi, significance = wavelet.cwt(s2.y, dt=s2.dt) coherence = wavelet.wavelet_coherence(s1.y, s2.y, dt=s1.dt)

Filtering

from acycle import filter as ft result = ft.apply_filter(y, dt=0.2, kind="bandpass", flow=0.01, fhigh=0.05)

Age modeling

from acycle import age model = age.build_age_model(depth, y, cycle_period=405) depth, age = age.tune(depth, y, model)

Load built-in datasets

lr04 = ac.load_example("lr04") # LR04 benthic stack cenogrid = ac.load_example("cenogrid_d18o") # CENOGRID d18O `

Result Objects

All analysis functions return structured result objects with a consistent interface:

`python psd = PSD(frequency=freq, power=power) psd.to_dataframe() # export to pandas DataFrame psd.save("my_spectrum") # save to CSV (my_spectrum_spectrum.csv) psd.plot() # matplotlib figure

Same interface for all result types:

EvolutiveSpectrum, WaveletResult, FilterResult, AgeModel, CocoResult, SedNoiseResult

`


CLI Tools (Acycle Desktop GUI)

These commands launch the original Acycle desktop GUI tools bundled with the package:

ash acycle-imageprocessor # Image digitizing and data extraction acycle-plot # PlotPro — publication-quality plotting acycle-interpolation # Advanced interpolation with gap filling acycle-data-extractor # Extract data segments by range acycle-section-remover # Remove sections from time series acycle-gap-adder # Insert gaps into data acycle-data-clipper # Clip data by threshold acycle-image-analyzer # Advanced image analysis


API Reference

Series Operations

Method Description
Series.from_file(path) Read from a delimited text file
.clean(sort, duplicate, dropna) Sort, deduplicate, drop NaN
.interpolate(step, method) Interpolate to uniform grid
.interpolate_pro(step, method) Advanced interpolation with gap filling
.detrend(window, method) Remove trend (lowess, loess, polynomial, savgol, moving_mean)
.standardize() Z-score standardization
.log10(handle_nonpositive) Base-10 logarithm
.derivative(order) Numerical derivative
.prewhiten(method) Prewhitening
.select(start, stop) Sub-range selection
.moving_average(n) Moving average smoothing
.gaussian_smooth(n, sigma) Gaussian smoothing
.moving_median(n) Moving median smoothing
.multiply(other_series) Element-wise multiply with another series
.clip_by_threshold(threshold) Clip or remove data by threshold
.to_dataframe() Export to pandas DataFrame
.copy() Deep copy

Spectral Analysis (cycle.spectral)

Function Description
_periodogram(y, dt) Classical periodogram
_mtm_spectrum(y, dt, nw) Multitaper method
_lomb_scargle_spectrum(x, y) Lomb-Scargle (uneven spacing)
_estimate_ar1_rho(y) AR(1) lag-1 autocorrelation
_estimate_ar1_noise(y, dt) AR(1) noise background
_ftest_mtm(y, dt, nw) F-test for significant peaks

Wavelet Analysis (cycle.wavelet)

Function Description
cwt(y, dt) Continuous wavelet transform (Torrence & Compo 1998)
wavelet_coherence(y1, y2, dt) Wavelet coherence and phase

Filtering (cycle.filter)

Function Description
pply_filter(y, dt, kind) Bandpass/lowpass/highpass (gaussian, butterworth, etc.)
dynamic_filter(x, y, window) Sliding-window dynamic filtering
mplitude_modulation(x, y, flow, fhigh) Envelope extraction

Age Modeling (cycle.age)

Function Description
uild_age_model(x, y, cycle_period) Age model from cycle counting
sedrate_to_age_model(depth, sedrate) Convert sedimentation rate to age model
une(depth, y, age_model) Depth-to-time conversion
stratigraphic_correlation(ref, target, tie_points) Correlate two stratigraphic sections

Preprocessing (cycle.preprocess)

Function Description
detrend(x, y, window, method) Remove trend
clip_by_threshold(x, y, threshold) Clip by value

| emove_sections(x, y, sections) | Remove data ranges | | dd_gaps(x, y, gaps) | Insert NaN-filled gaps | | emove_peaks(y, ymin, ymax) | Remove or cap peaks | | multiply_series(x, y1, y2) | Element-wise multiply two series | | merge_series(series_list) | Merge multiple series by x grid | | pca(data, n_components) | Principal component analysis | | changepoint(y, method) | Changepoint detection | | ransform_xy(x, y, a, b, c, d) | Affine coordinate transform | | ind_extreme(x, y, kind) | Find max or min in range |


Citation

If you use AcyclePy in your research, please cite:

Li, M., Hinnov, L., & Kump, L. (2019). Acycle: Time-series analysis software for paleoclimate research and education. Computers & Geosciences, 127, 12–22. https://doi.org/10.1016/j.cageo.2019.02.011

License

MIT License — see LICENSE file for details.

Links

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

acycle-0.6.6.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

acycle-0.6.6-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file acycle-0.6.6.tar.gz.

File metadata

  • Download URL: acycle-0.6.6.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for acycle-0.6.6.tar.gz
Algorithm Hash digest
SHA256 629af801bed806ca1f48e81f6cc7145b965990ee01b81dd5cbe2f30b2357bbd1
MD5 6ae2de965b564e6762696a7269c80758
BLAKE2b-256 7b9098cc33ce39b9de9a675aa30c8d1641d391f547bf76e9aecbaa5637343b1d

See more details on using hashes here.

File details

Details for the file acycle-0.6.6-py3-none-any.whl.

File metadata

  • Download URL: acycle-0.6.6-py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for acycle-0.6.6-py3-none-any.whl
Algorithm Hash digest
SHA256 fe466a70e587fd77791af6ff027cff46077717516612e52b36ec025b36e2f1ee
MD5 5359ebd62041a429b72e44642309e2d3
BLAKE2b-256 7f624c95987db67daf885047d8e9d70dd3733a01a35097791bbb3e12d21f7606

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