spectrum_broadening_output_file_writer

A module containing the writer for broadened spectra.

Summary

Classes:

SpectrumDataWriter

Class for writing a broadened spectrum to a file.

Reference

class SpectrumDataWriter(
filename: str | None = None,
mode: str | FileWritingMode = 'w',
)[source]

Bases: BaseWriter

Class for writing a broadened spectrum to a file.

Each row contains one grid point and the broadened intensity at that grid point in the legacy '%8.4f    %16.12e' format of build_spectrum.sh.

Parameters:
  • filename (str | None, optional) – The filename to write to. If None, the output is printed to stdout, by default None.

  • mode (str | FileWritingMode, optional) – The writing mode, by default “w”.

write(
data: tuple[Np1DNumberArray, Np1DNumberArray],
) None[source]

Writes the broadened spectrum to the file.

Parameters:

data (Tuple[Np1DNumberArray, Np1DNumberArray]) – The wavenumber grid and the broadened intensities as returned by broaden().