cubeslice

slicecube(I::GMTimage, layer::Union{Int, AbstractVector{<:Int}})

Take a slice of a multylayer GMTimage. Return the result still as a GMTimage. layer is the z slice number.

slicecube(G::GMTgrid, slice::Union{Int, AbstractVector{<:Int}}; axis="z")

Extract a slice from a GMTgrid cube.

slicecube(GI::GItype; slice::Int=0, angle=0.0, axis="x", cmap=GMTcpt())

Take a slice of a GMTgrid or GMTimage in an oblique direction. Take the cube’s layer slice and rotate it by angle degrees about the axis. This one can only be axis=:x or axis=:y. Depending on the data type of input a different output is produces. If GI is a GMTgrid, the output is 2 GMTgrids: one with z levels and the other with cube’s z levels along that plane. On the other hand, if GI isa GMTimage the first output is similar to previus case but the second will be a GMTimage. In this case the cmap option may be used to assign a colortable to the image type.

The value at the slice point, P(x[i,j], y[i,j], z[i, j)), is the interpolated value of the two nearest voxels on the same vertical.

Example

Get the fourth layer of the multi-layered ‘I’ GMTimage object

I = slicecube(I, 4)

Methods

# 4 methods for generic function "slicecube" from GMT:
 [1] slicecube(GI::GItype; slice, α, angle, axis, cmap)
 [2] slicecube(G::GMTgrid{T, 3}, slice::AbstractFloat; axis, x, y) where T
 [3] slicecube(G::GMTgrid{T, 3}, slice::Union{Int64, AbstractVector{<:Int64}}; axis, x, y) where T
 [4] slicecube(I::GMTimage{T, 3}, layer::Union{Int64, AbstractVector{<:Int64}}) where T

See Also