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 thefilename
will be appended.
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()