Skip to main content

Sedimentological data‐analysis tools (grain‐size, XRF, forams, bryozoans)

Project description

grainsize

Sedimentological Data Analysis Made Easy

The grainsize Python package provides a suite of tools for processing, analyzing, and visualizing grain size distributions, elemental data, and micropaleontological proxies (foraminifera and bryozoans) from sediment cores.


Features

  • Grain Size Analysis:

    • Clean and normalize grain size distributions.
    • Calculate statistical parameters (mean, median, mode, std, skewness, kurtosis).
    • Create grain size categories (clay, silt, sand, gravel).
    • Visualize statistics and fine fraction (<63 µm).
  • XRF Data Analysis:

    • Import and clean XRF elemental data.
    • Convert percentages to ppm.
    • Plot elemental abundances and elemental ratios.
  • Cluster Analysis:

    • Perform Bray-Curtis dissimilarity analysis.
    • Create dendrograms for stratigraphic clustering.
  • Foraminifera Data Analysis:

    • Calculate normalized abundance per 1cc.
    • Plot planktic and benthic foraminifera abundance with color scaling.
  • Bryozoans Data Analysis:

    • Compare abundance categories across cores.
    • Perform statistical tests (Chi-square, Mann-Whitney U).
    • Visualize depth distribution of bryozoan types.
  • Integrated Core Analysis:

    • Plot combined grain size and XRF results side-by-side for stratigraphic interpretation.

Installation

Manually clone the repository and install dependencies listed in requirements


Quickstart Example

from grainsize import GrainSize, XRF, Forams, Bryozoans, Stratigraphy, BCD

# Grain Size Example
gs = GrainSize(fname="grainsize_data.xlsx")
gs.clean_data()
stats = gs.create_stats_df()
stats.plot_stats(core_name="Core A")

# XRF Example
xrf = XRF(fname="xrf_data.xlsx")
xrf_clean = xrf.clean_data()
xrf_clean.plot_elements(core_name="Core A")

# Bray-Curtis Clustering
bcd = BCD.from_grain_size(gs)
bcd.plot_dendrogram(core_name="Core A")

# Foraminifera Example
forams = Forams(fname="forams.csv")
forams.plot_forams(core_name="Core A")

# Bryozoans Example
bryo = Bryozoans(fname="bryozoans.xlsx")
bryo.plot_corr_matrix(core_name="Core A")

Main Classes and Functionalities

GrainSize

  • clean_data() → Clean raw MasterSizer data.
  • normalize_gs() → Normalize grain size percentages.
  • create_stats_df() → Calculate median, mode, mean, std, skewness, kurtosis.
  • create_categories() → Create clay, silt, sand, gravel summaries.
  • plot_stats() → Plot statistics.
  • compare_gs() → Compare multiple cores.

XRF

  • clean_data() → Clean depth intervals.
  • to_ppm() → Convert % values to ppm.
  • plot_elements() → Plot elemental concentrations.
  • plot_ratios() → Plot elemental ratios.
  • compare_ratios() → Compare elemental ratios across cores.

Forams

  • Automatically calculates normalized abundance, p/b ratios, and percentages.
  • plot_forams() → Plot total abundance colored by planktic %.
  • compare_forams_plot() → Compare cores.
  • plot_benthic() → Plot benthic abundance.

Bryozoans

  • calc_chi2() → Chi-square test for presence/absence.
  • calc_mann_whitney() → Mann-Whitney U test.
  • calc_corr() + plot_corr_matrix() → Correlation analysis.
  • plot_large_bryo() → Compare large bryozoans categories.
  • plot_depth_bars() → Bryozoan types vs. depth.

BCD (Bray-Curtis Dissimilarity)

  • compute_BCD() → Compute Bray-Curtis distances.
  • plot_dendrogram() → Create a stratigraphic dendrogram.
  • merge_interp() → Merge and interpolate two cores.

Requirements

  • Python 3.8+
  • pandas
  • numpy
  • matplotlib
  • seaborn
  • scipy

License

MIT License


Acknowledgements

Developed to assist sedimentological and micropaleontological research workflows, with a special focus on making complex laboratory datasets ready for visualization and statistical analysis.


Author

Jarden Aaltonen Feel free to report issues or suggest improvements!

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

grainsize-0.1.1.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

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

grainsize-0.1.1-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file grainsize-0.1.1.tar.gz.

File metadata

  • Download URL: grainsize-0.1.1.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for grainsize-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0add102ed2a0d039547dfe6435a590821d9ad32a7a198ee1770d43c909453e02
MD5 e59bc3b29350ba4a7c6cec33c852dc6c
BLAKE2b-256 937f061220c837e66d729b8fb5dd0cf841593984f192bdce6a3a4ea3d56fbf78

See more details on using hashes here.

File details

Details for the file grainsize-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: grainsize-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for grainsize-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 40a6323d0ab7ebbbbe6e6ae165e74b67192e42e9a716272dad80c996bd82492b
MD5 57ad9c9680edc87b1d33b25c565f3754
BLAKE2b-256 96ad095b925144f2a8d145ec0dee9226ee8d8268b57e80b061ffad7dd0acbef3

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