Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ on:
branches:
- main
tags: '*'

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]

run_tests:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
Expand Down
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-added-large-files
- repo: https://github.com/codespell-project/codespell
rev: v2.2.1
hooks:
- id: codespell
args: ["-L", "mor"]
# - repo: https://github.com/qiaojunfeng/pre-commit-julia-format
# rev: v0.1.1
# hooks:
# - id: julia-format # formatter for Julia code
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliageodynamics.github.io/GeophysicalModelGenerator.jl/dev/)
[![Build Status](https://github.com/JuliaGeodynamics/GeophysicalModelGenerator.jl/workflows/CI/badge.svg)](https://github.com/JuliaGeodynamics/GeophysicalModelGenerator.jl/actions)

Creating consistent 3D images of geophysical and geological datasets and turning that into an input model for geodynamic simulations is often challenging. The aim of this package is to help with this, by providing a number of routines to easily import data and create a consistent 3D visualisation from it in the VTK-toolkit format, which can for example be viewed with [Paraview](https://www.paraview.org). In addition, we provide a range of tools that helps to generate input models to perform geodynamic simulations and import the results of such simulations back into julia.
Creating consistent 3D images of geophysical and geological datasets and turning that into an input model for geodynamic simulations is often challenging. The aim of this package is to help with this, by providing a number of routines to easily import data and create a consistent 3D visualisation from it in the VTK-toolkit format, which can for example be viewed with [Paraview](https://www.paraview.org). In addition, we provide a range of tools that helps to generate input models to perform geodynamic simulations and import the results of such simulations back into julia.

![README_img](./docs/src/assets/img/Readme_pic.png)
### Contents
* [Main features](#main-features)
* [Main features](#main-features)
* [Usage](#usage)
* [Installation](#installation)
* [Dependencies](#dependencies)
Expand All @@ -26,14 +26,14 @@ Some of the key features are:
- Grab screenshots of cross-sections or maps in published papers and view them in 3D (together with other data).
- Create a consistent overview that includes all available data of a certain region.
- Create initial model setups for the 3D geodynamic code [LaMEM](https://bitbucket.org/bkaus/lamem/src/master/).
- Import LaMEM timesteps.
- Import LaMEM timesteps.

All data is transformed into either a `GeoData` or a `UTMData` structure which contains info about `longitude/latitude/depth`, `ew/ns/depth` coordinates along with an arbitrary number of scalar/vector datasets, respectively. All data can be exported to Paraview with the `Write_Paraview` routine, which transfers the data to a `ParaviewData` structure (that contains Cartesian Earth-Centered-Earth-Fixed (ECEF) `x/y/z` coordinates, used for plotting)
## Usage

## Usage
The best way to learn how to use this is to install the package (see below) and look at the tutorials in the [manual](https://juliageodynamics.github.io/GeophysicalModelGenerator.jl/dev/).

## Installation
## Installation
First, you need to install julia on your machine. We recommend to use the binaries from [https://julialang.org](https://julialang.org).
Next, start julia and switch to the julia package manager using `]`, after which you can add the package.
```julia
Expand All @@ -59,7 +59,7 @@ We rely on a number of additional packages, which are all automatically installe


## Visualising Alpine data
We have used this package to interpret various data sets of the Alps (mostly openly available, sometimes derived from published papers). You can download the resulting paraview files here (using the `*.vts` format), where we also included the julia scripts to do the work (some of which are also described in more detail in the tutorials). Just unzip the files and open the corresponding `*.vts` in Paraview.
We have used this package to interpret various data sets of the Alps (mostly openly available, sometimes derived from published papers). You can download the resulting paraview files here (using the `*.vts` format), where we also included the julia scripts to do the work (some of which are also described in more detail in the tutorials). Just unzip the files and open the corresponding `*.vts` in Paraview.

[https://seafile.rlp.net/d/22b0fb85550240758552/](https://seafile.rlp.net/d/22b0fb85550240758552/)

Expand All @@ -68,12 +68,12 @@ If you want your data be included here as well, give us an email (or even better
You are very welcome to request new features and point out bugs by opening an issue. You can also help by adding features and creating a pull request.

## Development roadmap
In the pipeline:
In the pipeline:
- More tutorials
- Add more import tools.
- Compute gravity anomalies for lon/lat datasets, rather than just x/y/z.
- Provide an interface to [geomIO](https://bitbucket.org/geomio/geomio/wiki/Home) (currently being translated from MATLAB to python) in order to allow creating 3D geometric model setups by drawing in Inkscape.
- Provide tools to create and export 3D geodynamic model setups.
- Provide an interface to [geomIO](https://bitbucket.org/geomio/geomio/wiki/Home) (currently being translated from MATLAB to python) in order to allow creating 3D geometric model setups by drawing in Inkscape.
- Provide tools to create and export 3D geodynamic model setups.

## Funding
Development of this software package was funded by the German Research Foundation (DFG grants TH2076/7-1 and KA3367/10-1), which are part of the [SPP 2017 4DMB project](http://www.spp-mountainbuilding.de) project as well as by the European Research Council under grant ERC CoG #771143 - [MAGMA](https://magma.uni-mainz.de). The project was initiated at a [TeMaS](https://temas.uni-mainz.de) workshop with researchers from Frankfurt and Mainz where we realized that it is way too timeconsuming to collect available data of a certain region.
5 changes: 2 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ makedocs(;
"ISC earthquake data" => "man/tutorial_ISC_data.md",
"Plot GPS vectors" => "man/tutorial_GPS.md",
"Read UTM data" => "man/tutorial_UTM.md",
"VoteMaps" => "man/Tutorial_Votemaps.md",
"VoteMaps" => "man/Tutorial_Votemaps.md",
"Kilometer-scale volcano" => "man/tutorial_local_Flegrei.md",
"Generating LaMEM model" => "man/LaPalma_example.md",
"Create movies" => "man/tutorial_time_Seismicity.md"
Expand All @@ -43,7 +43,7 @@ makedocs(;
"LaMEM" => "man/lamem.md"
],
"List of functions" => "man/listfunctions.md"
],
],
)

deploydocs(;
Expand All @@ -55,4 +55,3 @@ deploydocs(;
forcepush=true,
push_preview = true
)

2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Documentation for [GeophysicalModelGenerator](https://github.com/JuliaGeodynamic
The main purpose of this package is to simplify the process of going from 1D/2D/3D geophysical data to a 3D consistent model of the region. By simplifying the process of plotting the data, it becomes easier to compare different data sets, and generate a 3D models that can be used for other computations such as geodynamic simulations, or forward modelling of gravity anomalies.

For this, GeophysicalModelGenerator provides the following functionality:
- A consistent GeoData structure, that holds the data along with lon/lat/depth information.
- A consistent GeoData structure, that holds the data along with lon/lat/depth information.
- Routines to generate VTK files from the GeoData structure in order to visualize results in Paraview.
- The ability to deal with points, 2D profiles and 3D volumes, for both scalar and vector values.
- Rapidly import screenshots of published papers and compare them with other data sets in 3D using paraview.
Expand Down
15 changes: 7 additions & 8 deletions docs/src/man/LaPalma_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Topo = ImportTopo(lon = [-18.7, -17.1], lat=[28.0, 29.2], file="@earth_relief_03
````

````
GeoData
GeoData
size : (1921, 1441, 1)
lon ϵ [ 341.3 : 342.9]
lat ϵ [ 28.0 : 29.2]
Expand All @@ -55,7 +55,7 @@ Topo=load("Topo_LaPalma.jld2","Topo")
````

````
GeoData
GeoData
size : (1921, 1441, 1)
lon ϵ [ 341.3 : 342.9]
lat ϵ [ 28.0 : 29.2]
Expand All @@ -72,7 +72,7 @@ data_all_EQ = load("EQ_Data.jld2","data_all_EQ")
````

````
GeoData
GeoData
size : (6045,)
lon ϵ [ -18.0341 : -17.6671]
lat ϵ [ 28.3102 : 28.8144]
Expand Down Expand Up @@ -118,7 +118,7 @@ Topo_cart = Convert2CartData(Topo, proj)
````

````
CartData
CartData
size : (1921, 1441, 1)
x ϵ [ -86.09445705828863 km : 73.67229892155609 km]
y ϵ [ -63.5531883197492 km : 73.28446155584604 km]
Expand All @@ -143,7 +143,7 @@ Topo_LaMEM = ProjectCartData(Topo_LaMEM, Topo, proj)
````

````
CartData
CartData
size : (701, 651, 1)
x ϵ [ -70.0 km : 70.0 km]
y ϵ [ -60.0 km : 70.0 km]
Expand Down Expand Up @@ -177,7 +177,7 @@ Grid = ReadLaMEM_InputFile("LaPalma.dat")
````

````
LaMEM Grid:
LaMEM Grid:
nel : (64, 64, 32)
marker/cell : (3, 3, 3)
markers : (192, 192, 192)
Expand All @@ -190,7 +190,7 @@ LaMEM Grid:
The `LaMEM_grid` structure contains the number of elements in every direction and the number of markers in every cell.
It also contains `Grid.X`, `Grid.Y`, `Grid.Z`, which are the coordinates of each of the markers in the 3 directions.

In a next step we need to give each of these points a `Phase` number (which is an integer, that indicates the type of the rock that point has), as well as the temperature (in Celcius).
In a next step we need to give each of these points a `Phase` number (which is an integer, that indicates the type of the rock that point has), as well as the temperature (in Celsius).

````julia
Phases = ones(Int32,size(Grid.X))*2;
Expand Down Expand Up @@ -298,4 +298,3 @@ If you are interested in doing this, have a look at the LaMEM [wiki](https://bit
---

*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*

1 change: 0 additions & 1 deletion docs/src/man/Tutorial_Votemaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,3 @@ Similarly, you could only look at a single model (even when that is perhaps easi
---

*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*

24 changes: 10 additions & 14 deletions docs/src/man/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ In order to use then package you obviously need to install julia. We recommend d


### 2. Install Visual Studio Code
The julia files itself are text files (just like matlab scripts). You may want to edit or modify them at some stage, for which you can use any text editor for that. We prefer to use the freely available [Visual Studio Code](https://code.visualstudio.com) as it has a build-in terminal and is the comes with the (official) julia debugger (install the Julia extension for that).
The julia files itself are text files (just like matlab scripts). You may want to edit or modify them at some stage, for which you can use any text editor for that. We prefer to use the freely available [Visual Studio Code](https://code.visualstudio.com) as it has a built-in terminal and is the comes with the (official) julia debugger (install the Julia extension for that).

### 3. Getting started with julia
You start julia on the command line with:
Expand All @@ -25,19 +25,19 @@ This will start the command-line interface of julia:
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia>
julia>
```

From the julia prompt, you start the package manager by typing `]`:
```julia
(@v1.6) pkg>
(@v1.6) pkg>
```
And you return to the command line with a backspace.

Also useful is that julia has a build-in terminal, which you can reach by typing `;` on the command line:
Also useful is that julia has a built-in terminal, which you can reach by typing `;` on the command line:
```julia
julia>;
shell>
shell>
```
In the shell, you can use the normal commands like listing the content of a directory, or the current path:
```julia
Expand All @@ -48,7 +48,7 @@ shell> pwd
```
As before, return to the main command line (called `REPL`) with a backspace.

If you want to see help information for any julia function, type `?` followed by the command.
If you want to see help information for any julia function, type `?` followed by the command.
An example for `tan` is:
```julia
help?> tan
Expand All @@ -73,7 +73,7 @@ search: tan tanh tand atan atanh atand instances transpose transcode contains Un
2×2 Matrix{Float64}:
-1.09252 -1.09252
-1.09252 -1.09252
```
```

If you are in a directory that has a julia file (which have the extension `*.jl`), you can open that file with Visual Studio Code:
```julia
Expand Down Expand Up @@ -115,17 +115,13 @@ julia> using GeophysicalModelGenerator
```

### 5. Other useful packages
As you will work your way through the tutorials you will see that we often use external packages, for example to load ascii data files into julia. You will find detailed instructions in the respective tutorials.
As you will work your way through the tutorials you will see that we often use external packages, for example to load ascii data files into julia. You will find detailed instructions in the respective tutorials.

If you already want to install some of those, here our favorites. Install them through the package manager:

- [CSV](https://github.com/JuliaData/CSV.jl): Read comma-separated data files into julia.
- [Plots](https://github.com/JuliaPlots/Plots.jl): Create all kinds of plots in julia (quite an extensive package, but very useful to have).
- [CSV](https://github.com/JuliaData/CSV.jl): Read comma-separated data files into julia.
- [Plots](https://github.com/JuliaPlots/Plots.jl): Create all kinds of plots in julia (quite an extensive package, but very useful to have).
- [JLD2](https://github.com/JuliaIO/JLD2.jl): This allows saving julia objects (such as a tomographic model) to a binary file and load it again at a later stage.
- [Geodesy](https://github.com/JuliaGeo/Geodesy.jl): Convert UTM coordinates to latitude/longitude/altitude.
- [NetCDF](https://github.com/JuliaGeo/NetCDF.jl): Read NetCDF files.
- [GMT](https://github.com/GenericMappingTools/GMT.jl): A julia interface to the Generic Mapping Tools (GMT), which is a highly popular package to create (geophysical) maps. Note that installing `GMT.jl` is more complicated than installing the other packages listed above, as you first need to have a working version of `GMT` on your machine (it is not yet installed automatically). Installation instructions for Windows/Linux are on their webpage. On a mac, we made the best experiences by downloading the binaries from their webpage and not using a package manager to install GMT.




4 changes: 2 additions & 2 deletions docs/src/man/lamem.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# LaMEM

In order to generate geodynamic simulations from setups created with `GeophysicalModelGenerator.jl`, we provide a few routines that directly create marker input files for the 3D geodynamic modelling software [LaMEM](https://bitbucket.org/bkaus/lamem), which is an open-source cartesian code that is well-suited to perform crustal and lithospheric-scale simulations.
If you want to learn how to run LaMEM simulations, please have a look at the [wiki page](https://bitbucket.org/bkaus/lamem/wiki/Home).
In order to generate geodynamic simulations from setups created with `GeophysicalModelGenerator.jl`, we provide a few routines that directly create marker input files for the 3D geodynamic modelling software [LaMEM](https://bitbucket.org/bkaus/lamem), which is an open-source cartesian code that is well-suited to perform crustal and lithospheric-scale simulations.
If you want to learn how to run LaMEM simulations, please have a look at the [wiki page](https://bitbucket.org/bkaus/lamem/wiki/Home).

The routines provided here have the following functionality:
- Read LaMEM *.dat files (to get the size of the domain)
Expand Down
1 change: 0 additions & 1 deletion docs/src/man/listfunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ This page details the some of the guidelines that should be followed when contri

```@index
```

Loading