Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Spectrum class structure #6

Open
eibar-flores opened this issue Nov 20, 2024 · 0 comments
Open

Refactor Spectrum class structure #6

eibar-flores opened this issue Nov 20, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@eibar-flores
Copy link
Collaborator

Currently PRISMA has multiple spectrum classes to deal with raw and processed spectra, see here.

Having such hierarchy of classes introduces unnecessary complexity to develop and maintain the code. I suggest sticking to a single spectrum class with three main attributes:

  • index: numpy.ndarray of shape (n), holding the index of the spectrum (wavenumbers, eV, wavelenght, etc)
  • counts: numpy.ndarray of shape (n), holding the counts of the spectrum (counts, counts/s etc.)
  • metadata: dict with key value pairs with additional information about the spectrum. This should hold key:value pairs passed as keyword arguments when instantiating a spectrum.

Next, we should ensure all processing functions work for spectrum objects. Spectrum raw, spectrum processed and individual peak fits should all be instances of the same Spectrum Class.

Baselines can be inferred by subtracting raw minus processed spectra. Total fits can the inferred by summing all peak fits.

@eibar-flores eibar-flores added the enhancement New feature or request label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants