Tools for geochemical visualization and modeling
Project description
GeoRunes
GeoRunes is a bunch of tools and classes written to generate geochemical diagrams using matplotlib.
georunes.plot assits the representation of geochemical data in binary diagrams, ternary diagrams and normalized spider diagrams. It uses plotting parameters (category, color, marker, label ...) defined in the data source file along with geochemical data to construct the required figures.
georunes.modmin estimates the modal mineralogy of some whole rock compositions, provided a list of minerals with their composition.
Features
- Data source supported formats: .csv, .xls or .xlsx,
- Data loaded as pandas DataFrames,
- Plotting parameters (color, marker, label, drawing order ...) configurable automatically (see examples/preprocess_files.py),
- Support scaling of axes, layout padding, adjusting figure ratio, transparency and size of markers, configuring legends,
- Chemical conversion from wt.% oxide to element (in millications or ppm),
- Ternary diagram (based on the package python-ternary),
- Inner geochemical normalization and multiple plotting style in spider diagrams,
- Handling of translations (using gettext, pass the lang_cfg parameter as a dict{'lang', 'domain' if different, 'locales' if different}),
- CIPW norm calculation and estimation (optimization) of modal mineralogy from whole rock and mineral compositions,
- Available methods for estimation of modal mineralogy : bounded-variable least squares, non-negative least squares, gradient descent, or a random research,
- Components of a solid solution can be fixed for estimation a mineralogy,
Dependencies
- matplotlib
- pandas
- numpy
- scipy
- python-ternary
Installation
-
Install stable version with pip command:
pip install georunes
-
Install updated version from github:
git clone https://github.com/dugucrypter/georunes.git cd georunes python setup.py install --user
This code was tested with Python 3.11, matplotlib 3.7.2, pandas 2.1.0, numpy 1.24.3, and scipy 1.10.0.
Working with GeoRunes
Short example
import matplotlib.pyplot as plt
from georunes.plot.binary.versus import DiagramVs
# Initialize diagram class
diag_nb_ta = DiagramVs(datasource="path/to/data.xls", sheet="sheet1",
group_name='Category', # Attribute used for categorization
xvar="Nb", yvar="Ta", # Variables to plot
xlabel="Nb (ppm)", ylabel="Ta (ppm)", # Labels to write in axes
xscale='log', yscale='log', # Custom scaling
)
# Plot data
diag_nb_ta.plot()
# Show the figure
plt.show()
More examples with an arbitrary geochemical dataset are proposed in the \examples directory.
Roadmap
Supplementary whole-rocks and mineral-based geochemical diagrams will be added in the following versions. Long-term updates might provide utilities for geochemical modelling and normative mineralogy.
Author
W.M.-E. Bonzi, 2021-2023.
License
This work is under MIT 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
Built Distribution
File details
Details for the file georunes-0.1.3.tar.gz
.
File metadata
- Download URL: georunes-0.1.3.tar.gz
- Upload date:
- Size: 63.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34f9cb9fe111e40c7a73a3c2055a0622dcb854ba4abd9ab797b21a1aa038bba8 |
|
MD5 | 0a5d32a5df2566b979bca035bf81f81f |
|
BLAKE2b-256 | 8ab6f13b60dc70dea03625ff7d783cc6f5a9675a282224609d9f2268ef9c3e32 |
Provenance
File details
Details for the file georunes-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: georunes-0.1.3-py3-none-any.whl
- Upload date:
- Size: 91.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22ff356062a51f78f63fb480b2e915192c5bd99fc5b7ff7b79904ab193871224 |
|
MD5 | e9a42207a66d9663dc40c6b68d562869 |
|
BLAKE2b-256 | 626522835fb81f7d72a41834f3d32bbc3f5195639f9b3c576fe3912fab58ab11 |