Skip to content

Commit 0cef01a

Browse files
committed
add test for summing 2 GeoData surface grids
1 parent b4c1610 commit 0cef01a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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)