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.10, matplotlib 3.5.1, pandas 1.4.1 and scipy 1.8.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.2.tar.gz
.
File metadata
- Download URL: georunes-0.1.2.tar.gz
- Upload date:
- Size: 63.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c68d7b31dcc8438bd3e81dfa933d90a7485116e5c6c15d4f18f2eba34a0b4c34 |
|
MD5 | 730223082dbfb3e51207e140f0b98bc9 |
|
BLAKE2b-256 | 913a77aaf6d6c1be4b3b5dc24e5d77e1e76b55ccf9161cd74cebcc4382aad699 |
Provenance
File details
Details for the file georunes-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: georunes-0.1.2-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 | 6d09b7705972f1f99a6b00a83bd2691473d60d591d7aa851b211a5c306097321 |
|
MD5 | 3e95335b2403e02c48d2a88aa40bf39b |
|
BLAKE2b-256 | 141e44b535a754975ce9628e12a798cd6df14399b7cc4c57763c524acb9a60ba |