scipp.vectors#

scipp.vectors(*, dims, values, unit=<automatically deduced unit>)#

Constructs a Variable with given dimensions holding an array of length-3 vectors.

Parameters

See also

scipp.vector

Examples

>>> sc.vectors(dims=['x'], values=[[1, 2, 3]])
<scipp.Variable> (x: 1)    vector3  [dimensionless]  [(1, 2, 3)]
>>> var = sc.vectors(dims=['x'], values=[[1, 2, 3], [4, 5, 6]])
>>> var
<scipp.Variable> (x: 2)    vector3  [dimensionless]  [(1, 2, 3), (4, 5, 6)]
>>> var.values
array([[1., 2., 3.],
       [4., 5., 6.]])
>>> sc.vectors(dims=['x'], values=[[1, 2, 3], [4, 5, 6]], unit='mm')
<scipp.Variable> (x: 2)    vector3             [mm]  [(1, 2, 3), (4, 5, 6)]
Return type

Variable