Skip to content

Commit

Permalink
add InterpolateTopographyOnPlane
Browse files Browse the repository at this point in the history
  • Loading branch information
albert-de-montserrat committed Feb 29, 2024
1 parent b4dfa58 commit ee9ba8c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]

Check warning on line 1339 in src/utils.jl

View check run for this annotation

Codecov / codecov/patch

src/utils.jl#L1336-L1339

Added lines #L1336 - L1339 were not covered by tests
end

# Extracts a sub-data set using indices
function ExtractDataSets(V::AbstractGeneralGrid, iLon, iLat, iDepth)
Expand Down

0 comments on commit ee9ba8c

Please sign in to comment.