save_array

Contents

save_array#

ptyrad.save.save_array(data, file_dir='', file_name='ptyrad_init_meas', file_format='hdf5', output_shape=None, append_shape=True, **kwargs)[source]#

Save an ND array to the specified file format.

Parameters:
  • data (numpy.ndarray) – ND array to save.

  • file_dir (str) – Directory to save the file.

  • file_name (str) – Base name of the file (without extension).

  • file_format (str) – File format to save as (“tif”, “npy”, “hdf5”, “mat”).

  • output_shape (tuple, optional) – Desired shape for the output array.

  • append_shape (bool) – Whether to append the array shape to the filename.

  • **kwargs – Additional arguments for specific file formats.