Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v0.2.8' into v0.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
dgeorgiev21 committed Mar 15, 2024
2 parents 7170267 + 8d52889 commit c6d8357
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ramanspy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ def band(self, spectral_band: Number) -> np.ndarray:
# Return the slice across that band
return self.spectral_data[..., closest_band_index]

def tolist(self) -> list[Spectrum]:
"""
Returns the spectral object as a list of Spectrum objects.
"""
unfolded_spectral_data = self.spectral_data.reshape(-1, self.spectral_length)

return [Spectrum(spectral_data, self.spectral_axis) for spectral_data in unfolded_spectral_data]


class Spectrum(SpectralContainer):
"""
Expand Down

0 comments on commit c6d8357

Please sign in to comment.