You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added a preselection of points to cross_section_points to reduce the number of e.g. earthquakes that have to be processed when a global dataset is used.
Copy file name to clipboardExpand all lines: src/utils.jl
+23-3Lines changed: 23 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -427,6 +427,7 @@ function cross_section_points(P::GeoData; Depth_level = nothing, Lat_level = not
427
427
428
428
if!isnothing(Lat_level) # vertical slice @ given latitude
429
429
430
+
# to define the projection point, only choose events close to the desired profile
430
431
p_Point =ProjectionPoint(Lat = Lat_level, Lon =sum(P.lon.val) /length(P.lon.val)) # define the projection point (lat/lon) as the latitude and the mean of the longitudes of the data
431
432
P_UTM =convert2UTMzone(P, p_Point) # convert to UTM
432
433
ind =findall(-0.5*ustrip(uconvert(u"m", section_width)) .< (P_UTM.NS.val .- p_Point.NS) .<0.5*ustrip(uconvert(u"m", section_width))) # find all points around the desired latitude level, UTM is in m, so we have to convert the section width
@@ -443,6 +444,8 @@ function cross_section_points(P::GeoData; Depth_level = nothing, Lat_level = not
443
444
end
444
445
445
446
if!isnothing(Lon_level) # vertical slice @ given longitude
447
+
448
+
# to define the projection point, only choose events close to the desired profile
446
449
p_Point =ProjectionPoint(Lat =sum(P.lat.val) /length(P.lat.val), Lon = Lon_level) # define the projection point (lat/lon) as the latitude and the mean of the longitudes of the data
447
450
P_UTM =convert2UTMzone(P, p_Point) # convert to UTM
448
451
ind =findall(-0.5*ustrip(uconvert(u"m", section_width)) .< (P_UTM.EW.val .- p_Point.EW) .<0.5*ustrip(uconvert(u"m", section_width))) # find all points around the desired longitude level, UTM is in m, so we have to convert the section width
@@ -466,11 +469,28 @@ function cross_section_points(P::GeoData; Depth_level = nothing, Lat_level = not
466
469
error("Also define End coordinates if you indicate starting lon/lat value")
467
470
end
468
471
469
-
# choose projection point based on Start and End coordinates of the profile
0 commit comments