Standards /

WCPS-Tutorial / Slicing: how to reduce dimensions

Slicing a coverage extracts a slice (mathematicians would call this a hyperplane) from a given coverage along one of its axes, thereby reducing dimension by one. As with trimming, the slicing point must lie within the original coverage's domain. For orientation we provide the mowglie overview image once more:

Now we slice the mowglie cube along each of its axes in turn:

for m in ( mowglie )
return
        encode( slice( m, time(100) ), "jpeg" )
for m in ( mowglie )
return
        encode( slice( m, x(100) ), "jpeg" )
for m in ( mowglie )
return
        encode( slice( m, y(100) ), "jpeg" )

Below the respective results can be seen:

Background information:

  • There are shorthands available for combining trimming and slicing within one expression, see the resp. manual section.
  • Interval limits can be expressed in a coverage's image CRS or any CRS which the coverage supports.
  • Another domain function, extending, allows to specify new limits which may lie outside the original coverage's domain. Exterior values will be set to null then.

See manual: sliceExpr