Skip to content

Commit

Permalink
Merge pull request #144 from JuliaGeodynamics/pa-joss
Browse files Browse the repository at this point in the history
Address JOSS Paper review
  • Loading branch information
aelligp authored Oct 18, 2024
2 parents a742627 + 92d77bf commit 6b6d07d
Show file tree
Hide file tree
Showing 19 changed files with 267 additions and 248 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GeophysicalModelGenerator"
uuid = "3700c31b-fa53-48a6-808a-ef22d5a84742"
authors = ["Boris Kaus", "Marcel Thielmann"]
version = "0.7.9"
version = "0.7.10"

[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

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.

A short summary of the package and its features are given below. For a detailed description of the package and to learn how to use it, have a look at the [documentation](https://juliageodynamics.github.io/GeophysicalModelGenerator.jl/dev/).
A short summary of the package and its features are given below. For a detailed description of the package and to learn how to use it, have a look at the [documentation](https://juliageodynamics.github.io/GeophysicalModelGenerator.jl/dev/).

![README_img](./docs/src/assets/img/Readme_pic.png)
### Contents
Expand Down Expand Up @@ -43,17 +43,17 @@ The best way to learn how to use this is to install the package (see below) and
## 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
```julia-repl
julia> ]
(@v1.10) pkg> add GeophysicalModelGenerator
(@1.6) pkg> add GeophysicalModelGenerator
```
You can test whether it works on your system with
```julia
```julia-repl
julia> ]
(@v1.10) pkg> test GeophysicalModelGenerator
(@1.6) pkg> test GeophysicalModelGenerator
```
and use it with
```julia
```julia-repl
julia> using GeophysicalModelGenerator
```

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 26 additions & 15 deletions docs/src/man/Tutorial_Basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Tomo_Alps_full = load_GMG("https://zenodo.org/records/10738510/files/Paffrath_20
```

````
GeoData
GeoData
size : (162, 130, 42)
lon ϵ [ -13.3019 : 35.3019]
lat ϵ [ 30.7638 : 61.2362]
Expand Down Expand Up @@ -49,7 +49,7 @@ Topo_Alps = load_GMG("https://zenodo.org/records/10738510/files/AlpsTopo.jld2?do
```

````
GeoData
GeoData
size : (961, 841, 1)
lon ϵ [ 4.0 : 20.0]
lat ϵ [ 36.0 : 50.0]
Expand All @@ -70,9 +70,17 @@ Saved file: Topo_Alps.vts
````

If we open both datasets in Paraview, we see this (after giving some color to the topography):
If we open both datasets in Paraview, and changing both files from outline/solid colors to the corresponding data field, we see:
![Basic_Tutorial_1](../assets/img/Basic_Tutorial_Paraview_1.png)
Now we can change the colormap on the right side, marked by a red square. For topography we use the `Oleron` colormap, which you can download [here](https://www.fabiocrameri.ch/colourmaps/).
For the tomography we use the `Roma` scientific colormap. You will now see a blue'ish box of the tomography, this is not the best color to visualise the data. Let's invert the colormap by clicking on the item marked by the blue arrow.
Now we see the tomography in a more intuitive way, but the topography is not visible anymore. We can change the opacity of the tomography by setting a value in the `Opacity` field marked by the red square.
Note that you will need to adapt the range of the topography colormap as the change in color is not at 0.0. By clicking on the item marked by the black arrow, you can set your desired range.

![Basic_Tutorial_1](../assets/img/Basic_Tutorial_Paraview_2.png)

Now you should see something like this:
![Basic_Tutorial_1](../assets/img/Basic_Tutorial_1.png)
Note that I use the `Oleron` scientific colormap for the tomography which you can download [here](https://www.fabiocrameri.ch/colourmaps/)

### 2. Extract subset of data
As you can see the tomographic data covers a much larger area than the Alps itself, and in most of that area there is no data.
Expand All @@ -89,7 +97,7 @@ Saved file: Tomo_Alps.vts
````

Which looks like:
After loading the new data again in paraview, switching to the proper data field and adjusting the colormap, you should see something like this:
![Basic_Tutorial_2](../assets/img/Basic_Tutorial_2.png)

### 3. Create cross sections
Expand All @@ -102,7 +110,7 @@ data_200km = cross_section(Tomo_Alps, Depth_level=-200)
```

````
GeoData
GeoData
size : (54, 60, 1)
lon ϵ [ 3.9057 : 19.9057]
lat ϵ [ 35.9606 : 49.8976]
Expand All @@ -118,7 +126,7 @@ data_200km_exact = cross_section(Tomo_Alps, Depth_level=-200, Interpolate=true)
```

````
GeoData
GeoData
size : (100, 100, 1)
lon ϵ [ 3.9057 : 19.9057]
lat ϵ [ 35.9606 : 49.8976]
Expand All @@ -128,7 +136,7 @@ GeoData
````

In general, you can get help info for all functions with `?`:
```julia
```julia-repl
help?> cross_section
search: cross_section cross_section_volume cross_section_points cross_section_surface flatten_cross_section
Expand Down Expand Up @@ -176,7 +184,7 @@ Cross_vert = cross_section(Tomo_Alps, Start=(5,47), End=(15,44))
```

````
GeoData
GeoData
size : (100, 100, 1)
lon ϵ [ 5.0 : 15.0]
lat ϵ [ 47.0 : 44.0]
Expand All @@ -198,8 +206,12 @@ Saved file: data_200km.vts
````

After loading the data in Paraview, you can use the `Clip` tool on the topography to only show the topography above sealevel and make it 60% transparent. Also adjust the colormap of the tomography to 5.0 and -5.0

![Basic_Tutorial_3](../assets/img/Basic_Tutorial_Paraview_3.png)

After doing all these steps, you should see something like this:
![Basic_Tutorial_3](../assets/img/Basic_Tutorial_3.png)
In creating this image, I used the `Clip` tool of Paraview to only show topography above sealevel and made it 50% transparent.

### 4. Cartesian data
As you can see, the curvature or the Earth is taken into account here. Yet, for many applications it is more convenient to work in Cartesian coordinates (kilometers) rather then in geographic coordinates.
Expand All @@ -213,7 +225,7 @@ Topo_cart = convert2CartData(Topo_Alps, proj)
```

````
CartData
CartData
size : (961, 841, 1)
x ϵ [ -748.7493528015041 : 695.3491277129204]
y ϵ [ -781.2344794653393 : 831.6826244089501]
Expand All @@ -229,7 +241,7 @@ Tomo_cart = convert2CartData(Tomo_Alps, proj)
```

````
CartData
CartData
size : (54, 60, 39)
x ϵ [ -757.8031278236692 : 687.0608438357591]
y ϵ [ -785.601866956207 : 821.3433749818317]
Expand Down Expand Up @@ -269,7 +281,7 @@ Tomo_rect = project_CartData(Tomo_rect, Tomo_Alps, proj)
```

````
CartData
CartData
size : (116, 121, 117)
x ϵ [ -550.0 : 600.0]
y ϵ [ -500.0 : 700.0]
Expand All @@ -286,7 +298,7 @@ Topo_rect = project_CartData(Topo_rect, Topo_Alps, proj)
```

````
CartData
CartData
size : (1151, 1201, 1)
x ϵ [ -550.0 : 600.0]
y ϵ [ -500.0 : 700.0]
Expand Down Expand Up @@ -315,4 +327,3 @@ At this stage, the data can directly be used to generate cartesian numerical mod
---

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

3 changes: 1 addition & 2 deletions docs/src/man/Tutorial_Chmy_MPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,8 @@ You can than run it with:
mpiexecjl -n 4 --project=. julia Tutorial_Chmy_MPI.jl
```

The full file can be downloaded [here](../../../tutorials/Tutorial_Chmy_MPI.jl)
The full file can be downloaded [here](https://github.com/JuliaGeodynamics/GeophysicalModelGenerator.jl/blob/main/tutorials/Tutorial_Chmy_MPI.jl)

---

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

48 changes: 22 additions & 26 deletions docs/src/man/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You start julia on the command line with:
kausb$ julia
```
This will start the command-line interface of julia:
```julia
```julia-repl
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
Expand All @@ -25,32 +25,32 @@ 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>
```julia-repl
(@1.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:
```julia
```julia-repl
julia>;
shell>
shell>
```
In the shell, you can use the normal commands like listing the content of a directory, or the current path:
```julia
```julia-repl
shell> ls
LICENSE Manifest.toml Project.toml README.md docs src test tutorial
shell> pwd
/Users/kausb/.julia/dev/GeophysicalModelGenerator
```
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
```julia-repl
help?> tan
search: tan tanh tand atan atanh atand instances transpose transcode contains UnitRange ReentrantLock StepRange StepRangeLen trailing_ones trailing_zeros
Expand All @@ -73,59 +73,55 @@ 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
```julia-repl
shell> code runtests.jl
```
Execute the file with:
```julia
```julia-repl
julia> include("runtests")
```
Note that you do not include the `*.jl` extension.


### 4. Install GeophysicalModelGenerator.jl
In order to install GeophysicalModelGenerator.jl, start julia and go to the package manager:
```julia
```julia-repl
julia> ]
(@v1.6) pkg> add GeophysicalModelGenerator
(@v1.11) pkg> add GeophysicalModelGenerator
```
This will automatically install various other packages it relies on (using the correct version).

If you want, you can test if it works on your machine by running the test suite in the package manager:
```julia
```julia-repl
julia> ]
(@v1.6) pkg> test GeophysicalModelGenerator
(@1.6) pkg> test GeophysicalModelGenerator
```
Note that we run these tests automatically on Windows, Linux and Mac every time we add a new feature to GeophysicalModelGenerator (using different julia versions). This Continuous Integration (CI) ensures that new features do not break others in the package. The results can be seen [here](https://github.com/JuliaGeodynamics/GeophysicalModelGenerator.jl/actions).

The installation of `GMG` only needs to be done once, and will precompile the package and all other dependencies.

If you, at a later stage, want to upgrade to the latest version of `GMG`, you can type:
```julia
```julia-repl
julia> ]
(@v1.6) pkg> update GeophysicalModelGenerator
(@1.6) pkg> update GeophysicalModelGenerator
```

You can load GeophysicalModelGenerator, for example to create cross-sections, with:
```julia
```julia-repl
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.




Loading

2 comments on commit 6b6d07d

@aelligp
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/117569

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.10 -m "<description of version>" 6b6d07dbc595f2252b8ec877b96b8c6ab8044b2f
git push origin v0.7.10

Please sign in to comment.