Sediment Source Analysis
Summary of Features
- Import grain data from Excel files
- Perform kernel density estimation on grain data by sinks and features
- Decompose sink distributions into weighted combination of sources
- Label grains based on learned sources
- Plot kernel densities, sink, and source distributions
How setup the environment
Temporary method
For v1.1.1, MatrixTensorFactor must be installed separatly first.
add https://github.com/MPF-Optimization-Laboratory/MatrixTensorFactor.jl.git/#e92375d add https://github.com/njericha/SedimentSourceAnalysis.jl/tree/v1.1.1
Prefered Method
- Run
julia - Add the package with
pkg> add https://github.com/njericha/SedimentSourceAnalysis.jl.git
(use julia> ] to get to the package manager)
- Resolve dependency issues with
pkg> resolveand check it works withpkg> precompile(if you have an error with dependencies not downloading, trypkg> instantiate) - Import with
using SedimentSourceAnalysis
OR
In Browser
- Go to https://github.com/njericha/SedimentSourceAnalysis.jl
- Click "<> Code" and press "+" to "Create a codespace on main". It make take a few moments to set up.
- Open the command palett with
Ctrl+Shift+P(Windows) orCmd+Shift+P(Mac) - Enter
>Julia: Start REPL - In the REPL, resolve any dependency issues with
pkg> resolveandpkg> instantiate(usejulia> ]to get to the package manager). It may take a few minutes to download dependencies.
Run one of the example files by opening the file and pressing the triangular "run" button, or >Julia: Execute active File in REPL.
OR
On your own device
- Clone the repo at https://github.com/njericha/SedimentSourceAnalysis.jl
- Navigate to the root of the repository in a terminal and run
julia - Activate the project with
pkg> activate .(usejulia> ]to get to the package manager) - resolve any dependency issues with
pkg> resolve
Importing the package
Type julia> using SedimentSourceAnalysis to load all submodules (currently only SedimentTools), or if only one of the modules is desired, type using SedimentSourceAnalysis.XXX.
Examples
knownsources.jl: Uses data from Sundel et al where we know the sources of each Grain. Use this to see how well the factorization performs with realistic data. unknownsources.jl: Uses data from Lee et al where we don't have a ground truth. Showcases how the method would be used in practice. randomtensor: Factorizes a random 50x50x50 tensor. See how the factorization performs in theory when a perfect factorization exists.
Submodules
The main submodule is SedimentTools. SedimentSourceAnalysis also builds off of MatrixTensorFactor.jl.
MatrixTensorFactor
Defines the main factorization function and related mathematical functions. See the full documentation here Matrix Tensor Factorization.
SedimentTools
Holds various types at the Grain, and Sink level, importing (read_raw_data) and processing data (make_densities) functions, and additional methods of some Plots.jl functions for visualization with these custom types.
Index
SedimentSourceAnalysis.SedimentToolsSedimentSourceAnalysis.SedimentTools.DensityTensorSedimentSourceAnalysis.SedimentTools.GrainSedimentSourceAnalysis.SedimentTools.RockSedimentSourceAnalysis.SedimentTools.SinkSedimentSourceAnalysis.SedimentTools.SourceBase.getindexBase.namesMatrixTensorFactor.make_densitiesMatrixTensorFactor.make_densities2dPlots.heatmapSedimentSourceAnalysis.SedimentTools.arraySedimentSourceAnalysis.SedimentTools.confidence_scoreSedimentSourceAnalysis.SedimentTools.eachdensitySedimentSourceAnalysis.SedimentTools.eachmeasurementSedimentSourceAnalysis.SedimentTools.eachsinkSedimentSourceAnalysis.SedimentTools.eachsourceSedimentSourceAnalysis.SedimentTools.estimate_which_2d_sourceSedimentSourceAnalysis.SedimentTools.estimate_which_nd_sourceSedimentSourceAnalysis.SedimentTools.estimate_which_sourceSedimentSourceAnalysis.SedimentTools.getdomainSedimentSourceAnalysis.SedimentTools.getdomainsSedimentSourceAnalysis.SedimentTools.getmeasurementsSedimentSourceAnalysis.SedimentTools.getsinkSedimentSourceAnalysis.SedimentTools.getsourceSedimentSourceAnalysis.SedimentTools.getsourcenameSedimentSourceAnalysis.SedimentTools.getsourcenamesSedimentSourceAnalysis.SedimentTools.getstepsizesSedimentSourceAnalysis.SedimentTools.label_accuracySedimentSourceAnalysis.SedimentTools.match_sources!SedimentSourceAnalysis.SedimentTools.measurement_heatmapsSedimentSourceAnalysis.SedimentTools.namedarraySedimentSourceAnalysis.SedimentTools.normalize_density_sumsSedimentSourceAnalysis.SedimentTools.normalize_density_sums!SedimentSourceAnalysis.SedimentTools.plot_convergenceSedimentSourceAnalysis.SedimentTools.plot_densitiesSedimentSourceAnalysis.SedimentTools.plot_source_indexSedimentSourceAnalysis.SedimentTools.read_raw_dataSedimentSourceAnalysis.SedimentTools.setsourcename!SedimentSourceAnalysis.SedimentTools.source_heatmaps