This crate contains tools to analyzer Crystal/Lattice Preffered Orientation (CPO/LPO) data. It is currently designed to easily create pole figure from the CPO data produced by ASPECT (geodynamics/aspect#3885), but it is not limited to that. However, other type of inputs and plots of analysis are in the scope of this crate.
Note that this crate is a very early (beta) release, and it functions for the specific purpose it was build for, but a lot of functionality that is currently hard-coded can be generalized and expanded if there is interest. This also means that the current interface and input file structure are subject to change.
To run the analyzer, a configuration file is needed. The configuration files are written in the .toml
language. Here is a example file to create pole figures from ASPECT data:
base_dir = "/path/to/base/dir/"
experiment_dirs = ["experiment_1","experiment2"]
compressed = true
[pole_figures]
elastisity_header = false
times = [1.0,5.0,10]
particle_ids = [1,10]
axes = ["AAxis","BAxis","CAxis"]
minerals = ["Olivine","Enstatite"]
The configuration file with some comments (lines starting with a #
) explaining the options:
# the location of the experiment dirs.
base_dir = "/path/to/base/dir/"
# the directories containing the experiments. Currently only ASPECT output directories
# are supported.
experiment_dirs = ["experiment_1","experiment2"]
# Whether the Data was compressed with ZLIB.
compressed = true
[pole_figures]
# Wheter to include elasticity information in the header of the polefigure plots.
elastisity_header = false
# For each time in this vector a new polefigure plot is made.
times = [1.0,5.0,10]
# For each id in this vector a new polefigure plot is made.
particle_ids = [1,10]
# A vector containing the pole figure axis to be plotted. These will be added as a
# horizontal axis to the plot. Available options are `AAxis`, `BAxis` and `CAxis`.
axes = ["AAxis","BAxis","CAxis"]
# A vector containing the minerals to be plotted. These will be added as a vertical
# axis to the plot. Available options are `Olivine` and `Enstatite`.
minerals = ["Olivine","Enstatite"]
# Optional: Set the location where the particles are stored and the prefix which is
# for the file names.
particle_data_dir = "particle_CPO"
# Optional: Set the location where the grain data are stored and the prefix which is
# for the file names.
grain_data_file_prefix = "weighted_CPO"
# for more extensive documentation and other options see:
# https://docs.rs/cpo_analyzer/latest/cpo_analyzer/configuration/pole_figure_configuration/struct.PoleFiguresConfiguration.html
Note that there are more options availble then shown in this example, which are currently only visible in the code (src/configuration/
dir) and the code documentation. There is also a more elaborate example in the example
folder.
The CPO Analyzer is written in rust and starting from version 0.1.0 published on crates.io, and can therefore be installed with cargo install cpo_analyzer
. For this option, first cargo
needs to be installed.
There are no special instructions for installation by cloning the git repository and running cargo build
or cargo run config_file.toml
. Just note that this build the debug version, which is significantly slower than the release version. To build/run the release version add the --release
flag.
sudo apt install pkg-config libfreetype6-dev libfontconfig1-dev