Skip to content

Commit 808ea9d

Browse files
committed
data_types
1 parent 9d519e9 commit 808ea9d

Some content is hidden

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

57 files changed

+246
-246
lines changed

docs/src/man/Tutorial_AlpineData.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ units = unique(tag) #get different units
126126
We will use these units later to save the Moho data separately for each tectonic unit.
127127

128128
### 2.2 Converting the data to a `GMG` dataset
129-
To convert this data to a `GMG` dataset, we now have to interpolate it to a regular grid. You can generate the respective grid with the `GMG` function `lonlatdepthGrid`
129+
To convert this data to a `GMG` dataset, we now have to interpolate it to a regular grid. You can generate the respective grid with the `GMG` function `lonlatdepth_grid`
130130

131131
```julia
132-
Lon,Lat,Depth = lonlatdepthGrid(9.9:0.02:15.1,45.0:.02:49.0,0km);
132+
Lon,Lat,Depth = lonlatdepth_grid(9.9:0.02:15.1,45.0:.02:49.0,0km);
133133
nothing #hide
134134
```
135135

docs/src/man/Tutorial_Basic.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ search: cross_section cross_section_volume cross_section_points cross_section_su
156156
Example:
157157
≡≡≡≡≡≡≡≡
158158

159-
julia> Lon,Lat,Depth = lonlatdepthGrid(10:20,30:40,(-300:25:0)km);
159+
julia> Lon,Lat,Depth = lonlatdepth_grid(10:20,30:40,(-300:25:0)km);
160160
julia> Data = Depth*2; # some data
161161
julia> Vx,Vy,Vz = ustrip(Data*3),ustrip(Data*4),ustrip(Data*5);
162162
julia> Data_set3D = GeoData(Lon,Lat,Depth,(Depthdata=Data,LonData=Lon, Velocity=(Vx,Vy,Vz)));
@@ -204,10 +204,10 @@ In creating this image, I used the `Clip` tool of Paraview to only show topograp
204204
### 4. Cartesian data
205205
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.
206206
`GeophysicalModelGenerator` has a number of tools for this.
207-
First we need do define a `projectionPoint` around which we project the data
207+
First we need do define a `ProjectionPoint` around which we project the data
208208

209209
```julia
210-
proj = projectionPoint(Lon=12.0,Lat =43)
210+
proj = ProjectionPoint(Lon=12.0,Lat =43)
211211

212212
Topo_cart = convert2CartData(Topo_Alps, proj)
213213
```
@@ -259,7 +259,7 @@ Yet, because of the curvature of the Earth, the resulting 3D model is not strict
259259
This can be achieved in a relatively straightforward manner, by creating a new 3D dataset that is slightly within the curved boundaries of the projected data set:
260260

261261
```julia
262-
Tomo_rect = CartData(xyzGrid(-550.0:10:600, -500.0:10:700, -600.0:5:-17));
262+
Tomo_rect = CartData(xyz_grid(-550.0:10:600, -500.0:10:700, -600.0:5:-17));
263263
```
264264

265265
the routine `project_CartData` will then project the data from the geographic coordinates to the new rectilinear grid:
@@ -281,7 +281,7 @@ CartData
281281
we can do the same with topography:
282282

283283
```julia
284-
Topo_rect = CartData(xyzGrid(-550.0:1:600, -500.0:1:700, 0))
284+
Topo_rect = CartData(xyz_grid(-550.0:1:600, -500.0:1:700, 0))
285285
Topo_rect = project_CartData(Topo_rect, Topo_Alps, proj)
286286
```
287287

docs/src/man/Tutorial_FaultDensity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ data = faults.data[indlon,indlat]
7676
Create GeoData from restricted data
7777

7878
```julia
79-
Lon3D,Lat3D, Faults = lonlatdepthGrid(Lon,Lat,0);
79+
Lon3D,Lat3D, Faults = lonlatdepth_grid(Lon,Lat,0);
8080
Faults[:,:,1] = data
8181
Data_Faults = GeoData(Lon3D,Lat3D,Faults,(Faults=Faults,))
8282
```

docs/src/man/Tutorial_Jura.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ Moreover, the resolution of the grids is different. Whereas the `TopoGeology` ha
100100
It is often useful to have them on exactly the same size grid
101101

102102
We can do this in two steps:
103-
First, we define a `projectionPoint` along which we perform the projection
103+
First, we define a `ProjectionPoint` along which we perform the projection
104104

105105
```julia
106-
proj = projectionPoint(Lon=6, Lat=46.5)
106+
proj = ProjectionPoint(Lon=6, Lat=46.5)
107107
```
108108

109109
We can simply transfer the TopoGeology map to Cartesian values with:
@@ -127,7 +127,7 @@ It is therefore better to use the `project_CartData` to project the `GeoData` st
127127
Let's first create this structure by using `x`,`y` coordinates that are slightly within the ranges given above:
128128

129129
```julia
130-
TopoGeology_cart = CartData(xyzGrid(range(-70,150,length=3500), range(-105,130,length=2500), 0.0))
130+
TopoGeology_cart = CartData(xyz_grid(range(-70,150,length=3500), range(-105,130,length=2500), 0.0))
131131
```
132132

133133
```julia
@@ -219,8 +219,8 @@ We create both a surface and a 3D block
219219
```julia
220220
nx, ny, nz = 1024, 1024, 128
221221
x,y,z = range(-100,180,nx), range(-50,70,ny), range(-8,4,nz)
222-
ComputationalSurf = CartData(xyzGrid(x,y,0))
223-
ComputationalGrid = CartData(xyzGrid(x,y,z))
222+
ComputationalSurf = CartData(xyz_grid(x,y,0))
223+
ComputationalGrid = CartData(xyz_grid(x,y,z))
224224
```
225225

226226
Re-interpolate the rotated to the new grid:

docs/src/man/Tutorial_LaPalma.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ In order to create model setups, it is helpful to first transfer the data to Car
6565
This requires us to first determine a *projection point*, that is fixed. Often, it is helpful to use the center of the topography for this. In the present example, we will center the model around La Palma itself:
6666

6767
```julia
68-
proj = projectionPoint(Lon=-17.84, Lat=28.56)
68+
proj = ProjectionPoint(Lon=-17.84, Lat=28.56)
6969
```
7070

7171
Once this is done you can convert the topographic data to the cartesian reference frame
@@ -80,7 +80,7 @@ In other cases, however, this is quite substantial (e.g., India-Asia collision z
8080
LaMEM needs an orthogonal grid of topography, which we can create with:
8181

8282
```julia
83-
Topo_model = CartData(xyzGrid(-35:.1:30,-15:.2:45,0));
83+
Topo_model = CartData(xyz_grid(-35:.1:30,-15:.2:45,0));
8484
nothing #hide
8585
```
8686

@@ -102,7 +102,7 @@ It is useful to plot the earthquake density in 3D, which indicates where most ac
102102
For this, we first create a 3D grid of the region:
103103

104104
```julia
105-
Grid_3D = CartData(xyzGrid(-35:.3:30,-15:.25:45,-50:.5:5))
105+
Grid_3D = CartData(xyz_grid(-35:.3:30,-15:.25:45,-50:.5:5))
106106
```
107107

108108
Next we check how many earthquakes are around the grid points:

docs/src/man/Tutorial_MohoTopo_Spada.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ data_Moho_combined = GeoData(lon, lat, depth, (MohoDepth=depth*km,))
108108
Next, we define a regular lon/lat grid
109109

110110
```julia
111-
Lon, Lat, Depth = lonlatdepthGrid(4.1:0.1:11.9,42.5:.1:49,-30km)
111+
Lon, Lat, Depth = lonlatdepth_grid(4.1:0.1:11.9,42.5:.1:49,-30km)
112112
```
113113

114114
We will use a nearest neighbor interpolation method to fit a surface through the data, which has the advantage that it will take the discontinuities into account.

docs/src/man/Tutorial_NumericalModel_2D.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ using GeophysicalModelGenerator
1717
nx,nz = 512,128
1818
x = range(-1000,1000, nx);
1919
z = range(-660,0, nz);
20-
Grid2D = CartData(xyzGrid(x,0,z))
20+
Grid2D = CartData(xyz_grid(x,0,z))
2121
```
2222

2323
````
@@ -233,7 +233,7 @@ We start with the horizontal part:
233233
nx,nz = 512,128
234234
x = range(-1000,1000, nx);
235235
z = range(-660,0, nz);
236-
Grid2D = CartData(xyzGrid(x,0,z))
236+
Grid2D = CartData(xyz_grid(x,0,z))
237237
Phases = zeros(Int64, nx, 1, nz);
238238
Temp = fill(1350.0, nx, 1, nz);
239239
addBox!(Phases, Temp, Grid2D; xlim=(-800,0.0), zlim=(-80.0, 0.0), phase = ConstantPhase(1));
@@ -271,7 +271,7 @@ Our starting basis is the example above with ridge and overriding slab
271271
nx,nz = 512,128
272272
x = range(-1000,1000, nx);
273273
z = range(-660,0, nz);
274-
Grid2D = CartData(xyzGrid(x,0,z))
274+
Grid2D = CartData(xyz_grid(x,0,z))
275275
Phases = zeros(Int64, nx, 1, nz);
276276
Temp = fill(1350.0, nx, 1, nz);
277277
lith = LithosphericPhases(Layers=[15 20 55], Phases=[3 4 5], Tlab=1250)

docs/src/man/Tutorial_NumericalModel_3D.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ nx,ny,nz = 512,512,128
1818
x = range(-1000,1000, nx);
1919
y = range(-1000,1000, ny);
2020
z = range(-660,0, nz);
21-
Grid = CartData(xyzGrid(x,y,z));
21+
Grid = CartData(xyz_grid(x,y,z));
2222
```
2323

2424
Now we create an integer array that will hold the `Phases` information (which usually refers to the material or rock type in the simulation)
@@ -94,7 +94,7 @@ nx,ny,nz = 512,512,128
9494
x = range(-1000,1000, nx);
9595
y = range(-1000,1000, ny);
9696
z = range(-660,0, nz);
97-
Grid = CartData(xyzGrid(x,y,z));
97+
Grid = CartData(xyz_grid(x,y,z));
9898

9999
Phases = fill(2,nx,ny,nz);
100100
Temp = fill(1350.0, nx,ny,nz);

docs/src/man/datastructures.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Data structures
22

33
The main data structure used in GeophysicalModelGenerator.jl is `GeoData`, which contains info about the `longitude`,`latitude`, and `depth` of a data set, as well as several data sets itself.
4-
We also provide a `UTMData`, which is essentially the same but with UTM coordinates, and a `CartData` structure, which has Cartesian coordinates in kilometers (as used in many geodynamic codes). If one wishes to transfer `GeoData` to `CartData`, one needs to provide a `projectionPoint`.
4+
We also provide a `UTMData`, which is essentially the same but with UTM coordinates, and a `CartData` structure, which has Cartesian coordinates in kilometers (as used in many geodynamic codes). If one wishes to transfer `GeoData` to `CartData`, one needs to provide a `ProjectionPoint`.
55
For plotting, we transfer this into the `ParaviewData` structure, which has cartesian coordinates centered around the center of the Earth. We employ the `wgs84` reference ellipsoid as provided by the [Geodesy.jl](https://github.com/JuliaGeo/Geodesy.jl) package to perform this transformation.
66

77
```@docs
88
GeoData
99
CartData
1010
UTMData
1111
ParaviewData
12-
lonlatdepthGrid
13-
xyzGrid
14-
projectionPoint
12+
lonlatdepth_grid
13+
xyz_grid
14+
ProjectionPoint
1515
```

docs/src/man/projection.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Typically, you load a dataset by reading it into julia and either generating a `
44

55
If you write the data to `Paraview`, it is internally converted to a Paraview structure (which involves `x,y,z` Cartesian Earth-Centered-Earth-Fixed (ECEF) coordinates using the `wgs84` ellipsoid).
66

7-
Yet, if you do geodynamic calculations the chances are that the geodynamic code does not operate in spherical coordinates, but rather use cartesian ones. In that case you should transfer your data to the `CartData` structure, which requires you to specify a `projectionPoint` that is a point on the map that will later have the coordinates `(0,0)` in the `CartData` structure.
7+
Yet, if you do geodynamic calculations the chances are that the geodynamic code does not operate in spherical coordinates, but rather use cartesian ones. In that case you should transfer your data to the `CartData` structure, which requires you to specify a `ProjectionPoint` that is a point on the map that will later have the coordinates `(0,0)` in the `CartData` structure.
88

99

1010
#### 1. Converting
@@ -41,8 +41,8 @@ As the area is large, it covers a range of `UTM` zones (and every point has a UT
4141
Yet, what we could do instead is show all data with respect to a single UTM zone. For this, we have to select a point around which we project (in this case more or less in the center):
4242

4343
```julia
44-
julia> p=projectionPoint(Lon=17.3, Lat=37.5)
45-
projectionPoint(37.5, 17.3, 703311.4380385976, 4.152826288024972e6, 33, true)
44+
julia> p=ProjectionPoint(Lon=17.3, Lat=37.5)
45+
ProjectionPoint(37.5, 17.3, 703311.4380385976, 4.152826288024972e6, 33, true)
4646
```
4747

4848
Projecting the `GeoData` set using this projection point is done with:
@@ -77,7 +77,7 @@ Whereas this is ok to look at and compare with a LaMEM model setup, we cannot us
7777
#### 2. Projecting data
7878
For use with LaMEM, you would need an orthogonal cartesian grid. From the last command above we get some idea on the area, so we can create this:
7979
```julia
80-
julia> Topo_Cart_orth = CartData(xyzGrid(-2000:20:2000,-1000:20:1000,0))
80+
julia> Topo_Cart_orth = CartData(xyz_grid(-2000:20:2000,-1000:20:1000,0))
8181
CartData
8282
size : (201, 101, 1)
8383
x ϵ [ -2000.0 km : 2000.0 km]

0 commit comments

Comments
 (0)