Skip to content

Commit d18db87

Browse files
committed
Paraview_output.jl
1 parent 8e2dae2 commit d18db87

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+196
-196
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Some of the key features are:
3333
- Create initial model setups for the 3D geodynamic code [LaMEM](https://github.com/UniMainzGeo/LaMEM).
3434
- Import LaMEM timesteps.
3535

36-
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)
36+
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)
3737

3838
## Usage
3939
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/).

docs/src/man/Tutorial_AlpineData.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ The data is available in different resolutions; see [here](http://gmt.soest.hawa
3636

3737
If you have issues with loading the topography with `GMT`, there is also the alternative to download the data yourself and import it using `Rasters.jl`.
3838

39-
We can now export this data to a `VTK` format so that we can visualize it with `Paraview`. To do so, `GMG` provides the function `Write_Paraview`:
39+
We can now export this data to a `VTK` format so that we can visualize it with `Paraview`. To do so, `GMG` provides the function `write_Paraview`:
4040

4141
```julia
42-
Write_Paraview(Topo, "Topography_Alps")
42+
write_Paraview(Topo, "Topography_Alps")
4343
```
4444

4545
Also, if you want to save this data for later use in julia, you can save it as `*.jld2` file using the function `save_GMG`:
@@ -156,7 +156,7 @@ for iunit = 1:length(units)
156156
#for later checking, we can now save the original point data as a VTK file:
157157
data_Moho = GeophysicalModelGenerator.GeoData(lon_tmp,lat_tmp,depth_tmp,(MohoDepth=depth_tmp*km,))
158158
filename = "Mroczek_Moho_" * units[iunit]
159-
Write_Paraview(data_Moho, filename, PointsData=true)
159+
write_Paraview(data_Moho, filename, PointsData=true)
160160

161161
#Now we create a KDTree for an effective nearest neighbor determination;
162162
kdtree = KDTree([lon_tmp';lat_tmp']; leafsize = 10)
@@ -187,7 +187,7 @@ for iunit = 1:length(units)
187187
#Finally, we can now export that data to VTK and save a `jld2` file using the `save_GMG` routine
188188
Data_Moho = GeophysicalModelGenerator.GeoData(Lon, Lat, Depth, (MohoDepth=Depth,PointDist=Dist),Data_attribs)
189189
filename = "Mrozek_Moho_Grid_" * units[iunit]
190-
Write_Paraview(Data_Moho, filename)
190+
write_Paraview(Data_Moho, filename)
191191
save_GMG(filename,Topo)
192192

193193
end
@@ -218,7 +218,7 @@ nothing #hide
218218
As before, we can export this dataset to `VTK` and also save it as a `jld2` file (as we are now exporting point data, we have to use the option `PointsData=true`):
219219

220220
```julia
221-
Write_Paraview(Data_ISC, "EQ_ISC", PointsData=true);
221+
write_Paraview(Data_ISC, "EQ_ISC", PointsData=true);
222222
save_GMG("EQ_ISC",Data_ISC)
223223
```
224224

@@ -380,7 +380,7 @@ Data_GPS_Sanchez = GeoData(Lon,Lat,topo_v,(Velocity_mm_year=(Ve,Vn,Vz),V_north=V
380380
And as always, we'll save everything in `VTK` format and in `jld2` format
381381

382382
```julia
383-
Write_Paraview(Data_GPS_Sanchez, "GPS_Sanchez")
383+
write_Paraview(Data_GPS_Sanchez, "GPS_Sanchez")
384384
save_GMG("GPS_Sanchez",Data_GPS_Sanchez)
385385
```
386386

@@ -445,7 +445,7 @@ nothing #hide
445445
And then we save it again.
446446

447447
```julia
448-
Write_Paraview(Data, "Rappisi2022")
448+
write_Paraview(Data, "Rappisi2022")
449449
save_GMG("Rappisi2022",Data)
450450
```
451451

docs/src/man/Tutorial_Basic.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This is a so-called `GeoData` object, which is a 3D grid of seismic velocities a
3434
We can save this in `VTK` format, which is a widely used format that can for exampke be read by the 3D open-source visualization tool [Paraview](https://www.paraview.org/):
3535

3636
```julia
37-
Write_Paraview(Tomo_Alps_full,"Tomo_Alps_full")
37+
write_Paraview(Tomo_Alps_full,"Tomo_Alps_full")
3838
```
3939

4040
````
@@ -62,7 +62,7 @@ Different than the 3D tomographic model, the topography has size 1 for the last
6262
We can write this to disk as well
6363

6464
```julia
65-
Write_Paraview(Topo_Alps,"Topo_Alps")
65+
write_Paraview(Topo_Alps,"Topo_Alps")
6666
```
6767

6868
````
@@ -81,7 +81,7 @@ It is thus advantageous to cut out a piece of the dataset that we are interested
8181
```julia
8282
Tomo_Alps = ExtractSubvolume(Tomo_Alps_full,Lon_level=(4,20),Lat_level=(36,50), Depth_level=(-600,-10))
8383

84-
Write_Paraview(Tomo_Alps,"Tomo_Alps");
84+
write_Paraview(Tomo_Alps,"Tomo_Alps");
8585
```
8686

8787
````
@@ -188,8 +188,8 @@ GeoData
188188
And write them to paraview:
189189

190190
```julia
191-
Write_Paraview(Cross_vert,"Cross_vert");
192-
Write_Paraview(data_200km,"data_200km");
191+
write_Paraview(Cross_vert,"Cross_vert");
192+
write_Paraview(data_200km,"data_200km");
193193
```
194194

195195
````
@@ -241,8 +241,8 @@ CartData
241241
Save:
242242

243243
```julia
244-
Write_Paraview(Tomo_cart,"Tomo_cart");
245-
Write_Paraview(Topo_cart,"Topo_cart");
244+
write_Paraview(Tomo_cart,"Tomo_cart");
245+
write_Paraview(Topo_cart,"Topo_cart");
246246
```
247247

248248
````
@@ -298,8 +298,8 @@ CartData
298298
Save it:
299299

300300
```julia
301-
Write_Paraview(Tomo_rect,"Tomo_rect");
302-
Write_Paraview(Topo_rect,"Topo_rect");
301+
write_Paraview(Tomo_rect,"Tomo_rect");
302+
write_Paraview(Topo_rect,"Topo_rect");
303303
```
304304

305305
````

docs/src/man/Tutorial_Jura.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ Note that we transfer the boolean to an integer
194194
Let's have a look at this in Paraview:
195195

196196
```julia
197-
Write_Paraview(Basement_cart,"Basement_cart")
198-
Write_Paraview(TopoGeology_cart,"TopoGeology_cart")
199-
Write_Paraview(CrossSection_1_cart,"CrossSection_1_cart")
197+
write_Paraview(Basement_cart,"Basement_cart")
198+
write_Paraview(TopoGeology_cart,"TopoGeology_cart")
199+
write_Paraview(CrossSection_1_cart,"CrossSection_1_cart")
200200
```
201201

202202
The result looks like:
@@ -261,10 +261,10 @@ ComputationalGrid = RemoveField(ComputationalGrid,"Z")
261261
Save the surfaces, cross-section and the grid:
262262

263263
```julia
264-
Write_Paraview(GeologyTopo_comp_surf,"GeologyTopo_comp_surf")
265-
Write_Paraview(Basement_comp_surf, "Basement_comp_surf")
266-
Write_Paraview(CrossSection_1_cart_rot,"CrossSection_1_cart_rot")
267-
Write_Paraview(ComputationalGrid,"ComputationalGrid")
264+
write_Paraview(GeologyTopo_comp_surf,"GeologyTopo_comp_surf")
265+
write_Paraview(Basement_comp_surf, "Basement_comp_surf")
266+
write_Paraview(CrossSection_1_cart_rot,"CrossSection_1_cart_rot")
267+
write_Paraview(ComputationalGrid,"ComputationalGrid")
268268
```
269269

270270
We can visualize this in paraview:

docs/src/man/Tutorial_LaPalma.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ data_all_EQ = GeoData(lon,lat,depth, (Magnitude=Mag,))
5353
Next, we can write the data to paraview along with the topography. Note that we have to specify that we have `PointData`:
5454

5555
```julia
56-
Write_Paraview(data_all_EQ,"data_all_EQ",PointsData=true)
57-
Write_Paraview(Topo,"Topo")
56+
write_Paraview(data_all_EQ,"data_all_EQ",PointsData=true)
57+
write_Paraview(Topo,"Topo")
5858
```
5959

6060
![LaPalma_EQTopo_GeoData](../assets/img/TopoEQs_LaPalma_GeoData.png)
@@ -93,8 +93,8 @@ Topo_model = projectCartData(Topo_model, Topo, proj)
9393
Let's have a look at the data:
9494

9595
```julia
96-
Write_Paraview(EQ_cart,"EQ_cart",PointsData=true)
97-
Write_Paraview(Topo_model,"Topo_model")
96+
write_Paraview(EQ_cart,"EQ_cart",PointsData=true)
97+
write_Paraview(Topo_model,"Topo_model")
9898
```
9999

100100
## 3. Create a volumetric earthquake plot
@@ -146,7 +146,7 @@ Grid_3D = AddField(Grid_3D,"Phases",Phases)
146146
We can save this to paraview format
147147

148148
```julia
149-
Write_Paraview(Grid_3D,"Grid_3D")
149+
write_Paraview(Grid_3D,"Grid_3D")
150150
```
151151

152152
The paraview statefile `/tutorials/LaPalma.pvsm` can be used to reproduce the following plot:

docs/src/man/Tutorial_MohoTopo_Spada.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ GeoData
7676
```
7777

7878
```julia
79-
Write_Paraview(data_Moho1, "Spada_Moho_Europe", PointsData=true)
79+
write_Paraview(data_Moho1, "Spada_Moho_Europe", PointsData=true)
8080
```
8181

8282
And we can do the same with the other two Moho's:
@@ -85,11 +85,11 @@ And we can do the same with the other two Moho's:
8585
data = readdlm("Moho_Map_Data-WesternAlps-SpadaETAL2013_Moho2.txt",' ',Float64,'\n', skipstart=38,header=false);
8686
lon, lat, depth = data[:,1], data[:,2], -data[:,3];
8787
data_Moho2 = GeoData(lon,lat,depth,(MohoDepth=depth*km,))
88-
Write_Paraview(data_Moho2, "Spada_Moho_Adria", PointsData=true)
88+
write_Paraview(data_Moho2, "Spada_Moho_Adria", PointsData=true)
8989
data =readdlm("Moho_Map_Data-WesternAlps-SpadaETAL2013_Moho3.txt",' ',Float64,'\n', skipstart=38,header=false);
9090
lon, lat, depth = data[:,1], data[:,2], -data[:,3];
9191
data_Moho3 = GeoData(lon,lat,depth,(MohoDepth=depth*km,))
92-
Write_Paraview(data_Moho3, "Spada_Moho_Tyrrhenia", PointsData=true)
92+
write_Paraview(data_Moho3, "Spada_Moho_Tyrrhenia", PointsData=true)
9393
```
9494

9595
If we plot this in paraview, it looks like this:
@@ -123,7 +123,7 @@ Now, we can create a `GeoData` structure with the regular surface and save it to
123123

124124
```julia
125125
data_Moho = GeoData(Lon, Lat, Depth, (MohoDepth=Depth,))
126-
Write_Paraview(data_Moho, "Spada_Moho_combined")
126+
write_Paraview(data_Moho, "Spada_Moho_combined")
127127
```
128128

129129
The result is shown here, where the previous points are colored white and are a bit smaller. Obviously, the datasets coincide well.

docs/src/man/Tutorial_Votemaps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ GeoData
7878
And from this, we can generate profiles, visualize 3D features in Paraview etc. etc.
7979

8080
```julia
81-
Write_Paraview(Data_VoteMap, "VoteMap_Alps")
81+
write_Paraview(Data_VoteMap, "VoteMap_Alps")
8282
```
8383

8484
In paraview, this gives

docs/src/man/movies.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The first one takes `*.png` images generated with the `Save Animation` option in
66
movie_from_images
77
```
88

9-
The other one creates `*.pvd` files that can be saved with the `pvd=...` optional option in `Write_Paraview`, such that you can animate temporal data in paraview (yif you're happy you can save the result as images and use `movies_from_pics`). See the corresponding tutorial on how to generate `*.pvd` files.
9+
The other one creates `*.pvd` files that can be saved with the `pvd=...` optional option in `write_Paraview`, such that you can animate temporal data in paraview (yif you're happy you can save the result as images and use `movies_from_pics`). See the corresponding tutorial on how to generate `*.pvd` files.
1010
```@docs
11-
Write_Paraview
11+
write_Paraview
1212
```

docs/src/man/paraview_output.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ We have one main routine to generate Paraview output for data that is either sto
44
If `GeoData` is supplied it is internally automatically converted to the right format. Vectors, such as velocity, are also converted accordingly.
55
You can also visualize time-dependent data, or combine existing paraview files into a `*.pvd` paraview collection (that can be used to show a movie)
66
```@docs
7-
Write_Paraview
8-
Movie_Paraview
7+
write_Paraview
8+
movie_Paraview
99
make_paraview_collection
1010
```

docs/src/man/projection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ GeoData
1919
lat ϵ [ 25.0 : 49.666666666666664]
2020
depth ϵ [ -4.9855 km : 3.123 km]
2121
fields: (:Topography,)
22-
julia> Write_Paraview(Topo,"Topo")
22+
julia> write_Paraview(Topo,"Topo")
2323
Saved file: Topo.vts
2424
```
2525
The result is shown on the globe as:
@@ -94,7 +94,7 @@ CartData
9494
y ϵ [ -1000.0 km : 1000.0 km]
9595
z ϵ [ -4.485650671162607 km : 2.5909655318121865 km]
9696
fields : (:Topography,)
97-
julia> Write_Paraview(Topo_Cart_orth,"Topo_Cart_orth");
97+
julia> write_Paraview(Topo_Cart_orth,"Topo_Cart_orth");
9898
```
9999
![Topo_Europe_CartData_Proj](../assets/img/Topo_Europe_CartData_Proj.png)
100100
So this interpolates the topographic data from the `GeoData` to the orthogonal cartesian grid (which can be used with LaMEM, for example).

0 commit comments

Comments
 (0)