reverse#
- Mesh.reverse()[source]#
Return a new
Meshwith the axis order reversed (MSB to LSB).Useful for converting between C-order and F-order axis conventions, where the first physical axis becomes the last numpy axis or vice versa.
- Returns:
Examples
>>> from psi_io.mesh import Mesh >>> m = Mesh.parse(0b100, ndim=3) # HALF, MAIN, MAIN >>> str(m.reverse()) 'MAIN, MAIN, HALF' >>> str(Mesh.parse(0b110, ndim=3).reverse()) 'MAIN, HALF, HALF'