Warning

You are reading the documentation related to the development version. Go here if you are looking for the documentation of the stable release.

spectrochempy.NDDataset.save_as

NDDataset.save_as(filename='', **kwargs)[source]

Save the current NDDataset in SpectroChemPy format (*.scp).

Parameters
  • filename (str) – The filename of the file where to save the current dataset.

  • **kwargs – Optional keyword parameters (see Other Parameters).

Other Parameters

directory (str, optional) – If specified, the given directory and the filename will be appended.

See also

save

Save current dataset.

write

Export current dataset to different format.

Notes

Adapted from numpy.savez .

Examples

Read some data from an OMNIC file

>>> nd = scp.read_omnic('wodger.spg')
>>> assert nd.name == 'wodger'

Write it in SpectroChemPy format (.scp) (return a pathlib object)

>>> filename = nd.save_as('new_wodger')

Check the existence of the scp file

>>> assert filename.is_file()
>>> assert filename.name == 'new_wodger.scp'

Remove this file

>>> filename.unlink()