slicecube

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

Take a slice of a multi-layer 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.

Examples

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

I = slicecube(I, 4)

See Also

cubeplot, xyzw2cube

Source Code

This function has multiple methods: