massdash.structs.Spectrum

class massdash.structs.Spectrum(mz, intensity, label)

Bases: Data1D

A single spectrum object storing mz and intensity data.

adjust_length(length: int) Spectrum

Adjust the length of the spectrum to a given length, this involved either padding or truncating the spectrum

Parameters:

length (int) – The desired output length.

Returns:

A new Spectrum object with padded/truncated length of mz and intensity.

Return type:

Spectrum