Giter VIP home page Giter VIP logo

mfraters_cpo_analyzer's Introduction

Build Build Status codecov crates.io doc.rs

CPO analyzer

pole figure

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_file_prefix = "particle_CPO/particles"

  # Optional: Set the location where the grain data are stored and the prefix which is 
  # for the file names.
  grain_data_file_prefix = "particle_CPO/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.

Installation

User installation

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.

Developer installation

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.

Dependencies

Ubuntu Linux

sudo apt install pkg-config libfreetype6-dev libfontconfig1-dev

mfraters_cpo_analyzer's People

Contributors

mfraters avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.