EleFits  4.0.1
A modern C++ API on top of CFitsIO

◆ section() [4/4]

template<typename T , long n = 2>
PtrRaster<T, n == -1 ? -1 : n - 1> Euclid::Fits::Raster< T, n >::section ( long  index)

Create a section at given index.

Parameters
frontThe section front index along the last axis
backThe section back index along the last axis
indexThe section index along the last axis

A section is a maximal slice of dimension n or n-1. For example, a 3D section of a 3D raster of shape (x, y, z) is a 3D raster of shape (x, y, t) where t < z, while a 2D section of it is a 2D raster of shape (x, y).

If needed, section() can be applied recursively, e.g. to get the x-line at z = 4 and y = 2:

auto line = raster.section(4).section(2);
See also
slice()