Skip to content

Commit 909782a

Browse files
authored
Merge pull request #133 from JuliaGeodynamics/bk-bugfixes
Bugfixes for sealevel and test for GeoData surface interpolation
2 parents b21943a + 0cef01a commit 909782a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/sea_lvl.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
export sea_level_files, SeaLevel, load_sea_level, curve_name
22

3-
const sea_level_path = joinpath(pwd(), "src/sea_level_data")
3+
pkg_dir = pkgdir(GeophysicalModelGenerator)
4+
5+
const sea_level_path = joinpath(pkg_dir, joinpath("src","sea_level_data"))
46

57
const sea_level_files = Dict(
68
:Spratt_800ka => "Spratt2016-800ka.txt",

test/test_utils.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Lon,Lat,Depth = lonlatdepth_grid(10:20,30:40,-50km);
88
Data1 = Depth*2; # some data
99
Vx1,Vy1,Vz1 = Data1*3,Data1*4,Data1*5
1010
Data_set2D = GeoData(Lon,Lat,Depth,(Depthdata=Data1,LonData1=Lon, Velocity=(Vx1,Vy1,Vz1)))
11+
Data_set2D0 = GeoData(Lon,Lat,Depth,(Depthdata=Data1,LonData1=Lon))
1112
@test_throws ErrorException cross_section(Data_set2D, Depth_level=-10)
1213

1314
# Test interpolation of depth to a given cartesian XY-plane
@@ -17,6 +18,16 @@ plane1 = interpolate_datafields_2D(Data_set2D, x, y)
1718
proj = ProjectionPoint()
1819
plane2 = interpolate_datafields_2D(Data_set2D, proj, x, y)
1920

21+
22+
Lon1,Lat1,Depth1 = lonlatdepth_grid(12:18,33:39,-50km);
23+
Data2 = Depth1*2; # some data
24+
Vx1,Vy1,Vz1 = Data2*3,Data2*4,Data2*5
25+
Data_set2D_1 = GeoData(Lon1,Lat1,Depth1,(Depthdata1=Data2,LonData2=Lon1))
26+
27+
plane3 = interpolate_datafields_2D(Data_set2D0, Data_set2D_1)
28+
@test sum(plane3.fields.Depthdata) -4900.0km
29+
30+
2031
@test plane1 == plane2
2132
@test all(==(-50e0), plane1)
2233

0 commit comments

Comments
 (0)