From ee9ba8c254b8e3f5147d3847be0b79399c548507 Mon Sep 17 00:00:00 2001 From: Albert de Montserrat Date: Thu, 29 Feb 2024 10:28:33 +0100 Subject: [PATCH 1/2] add InterpolateTopographyOnPlane --- src/utils.jl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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) From dcff56b990769e1dbd52c087d2e5676e743eb172 Mon Sep 17 00:00:00 2001 From: Albert de Montserrat Date: Thu, 29 Feb 2024 10:44:51 +0100 Subject: [PATCH 2/2] add InterpolateTopographyOnPlane to docs --- docs/src/man/tools.md | 1 + 1 file changed, 1 insertion(+) 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