diff --git a/docs/src/man/tools.md b/docs/src/man/tools.md index 2d17c007..7b5d2361 100644 --- a/docs/src/man/tools.md +++ b/docs/src/man/tools.md @@ -11,6 +11,7 @@ GeophysicalModelGenerator.SubtractHorizontalMean GeophysicalModelGenerator.AboveSurface GeophysicalModelGenerator.BelowSurface GeophysicalModelGenerator.InterpolateDataOnSurface +GeophysicalModelGenerator.InterpolateTopographyOnPlane GeophysicalModelGenerator.ParseColumns_CSV_File GeophysicalModelGenerator.RotateTranslateScale! GeophysicalModelGenerator.Convert2UTMzone diff --git a/src/utils.jl b/src/utils.jl index 31ad6ff9..4f8dc2cc 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -2,7 +2,7 @@ export meshgrid, CrossSection, CrossSectionVolume, CrossSectionSurface, CrossSectionPoints, ExtractSubvolume, SubtractHorizontalMean export ParseColumns_CSV_File, AboveSurface, BelowSurface, VoteMap -export InterpolateDataOnSurface, InterpolateDataFields2D, InterpolateDataFields +export InterpolateDataOnSurface, InterpolateDataFields2D, InterpolateDataFields, InterpolateTopographyOnPlane export RotateTranslateScale export DrapeOnTopo, LithostaticPressure! export FlattenCrossSection @@ -1327,7 +1327,17 @@ function InterpolateDataOnSurface(V::GeoData, Surf::GeoData) return Surf_interp end +""" + Surf_interp = InterpolateTopographyOnPlane(V::GeoData, proj::ProjectionPoint, x::AbstractRange, y::AbstractRange) +Interpolates a 3D data set `V` with a projection point `proj` on a plane defined by `x` and `y`, where are uniformly spaced. +Returns the 2D array `Surf_interp`. +""" +function InterpolateTopographyOnPlane(V::GeoData, proj::ProjectionPoint, x::AbstractRange, y::AbstractRange) + cart_grid = CartData(XYZGrid(x, y, 0)) + tproj = ProjectCartData(cart_grid, V, proj) + return tproj.z.val[:, :, 1] +end # Extracts a sub-data set using indices function ExtractDataSets(V::AbstractGeneralGrid, iLon, iLat, iDepth)