coords.Coords.copy_axes#
- Coords.copy_axes(i, j, other=None)#
Copy the coordinates along the axes j to the axes i.
Parameters#
- i: int (0,1 2) or tuple of ints (0,1,2)
One or more coordinate axes that should have replaced their coordinates by those along the axes j.
- j: int (0,1 2) or tuple of ints (0,1,2)
One or more axes whose coordinates should be copied along the axes i. j should have the same type and length as i.
- other: Coords object, optional
If provided, this is the source Coords for the coordinates. It should have the same shape as self. The default is to take the coords from self.
Returns#
- Coords object
A Coords where the coordinates along axes i have been replaced by those along axes j.
Examples#
>>> X = Coords([[1],[2]]).translate([0.0, 0.0, 5.0]) >>> X Coords([[1., 0., 5.], [2., 0., 5.]]) >>> X.copy_axes(1,0) Coords([[1., 1., 5.], [2., 2., 5.]]) >>> X.copy_axes((0,1),(1,0)) Coords([[0., 1., 5.], [0., 2., 5.]]) >>> X.copy_axes((0,1,2),(1,2,0)) Coords([[0., 5., 1.], [0., 5., 2.]])