openpiv.tools.save

openpiv.tools.save(filename: Union[pathlib.Path, str], x: numpy.ndarray, y: numpy.ndarray, u: numpy.ndarray, v: numpy.ndarray, flags: Optional[numpy.ndarray] = None, mask: Optional[numpy.ndarray] = None, fmt: str = '%.4e', delimiter: str = '\t') → None[source]

Save flow field to an ascii file.

Parameters:
  • filename (string) – the path of the file where to save the flow field
  • x (2d np.ndarray) – a two dimensional array containing the x coordinates of the interrogation window centers, in pixels.
  • y (2d np.ndarray) – a two dimensional array containing the y coordinates of the interrogation window centers, in pixels.
  • u (2d np.ndarray) – a two dimensional array containing the u velocity components, in pixels/seconds.
  • v (2d np.ndarray) – a two dimensional array containing the v velocity components, in pixels/seconds.
  • flags (2d np.ndarray) – a two dimensional integers array where elements corresponding to vectors: 0 - valid, 1 - invalid (, 2 - interpolated) default: None, will create all valid 0
  • mask (2d np.ndarray boolean, marks the image masked regions (dynamic and/or static)) – default: None - will be all False
fmt : string
a format string. See documentation of numpy.savetxt for more details.
delimiter : string
character separating columns

Examples

openpiv.tools.save(‘field_001.txt’, x, y, u, v, flags, mask, fmt=’%6.3f’,
delimiter=’ ‘)