snapshot_to_array#

pytwin.snapshot_to_array(snapshot_file, geometry_file)#

Create an array containing the x, y, z coordinates and data from geometry and field snapshot files.

Parameters:
snapshot_filestr

Path of the binary field data file to be read.

geometry_filestr

Path of the binary points data file to be read.

Returns:
np.ndarray

Return a 2D Numpy array of x,y,z coordinates and snapshot data read. Array has shape (m,n), where m is the number of points in the geometry file and n is the dimension of the snapshot field + 3.

Raises:
ValueError

if snapshot lengths are incompatible.

Examples

>>> from pytwin import snapshot_to_array
>>> snapshot_data = snapshot_to_array('snapshot.bin', 'points.bin')