Skip to content

Feature request: analysis.plot_experiments() #21

@aowen-uwmad

Description

@aowen-uwmad

As far as I know, there isn't yet a builtin way of visually comparing spectra.* I think this would be particularly useful for comparing the spectrum of an unknown mixture to the spectrum of a known compound, and seeing if important spectral features are present. As suggested by @laserkelvin, such a function likely best belongs in the analysis module.
Here is what I envisage for this function:

analysis.plot_experiments(experiments,inttype=None,overlay=True,xsync=True)

Parameters:

  • experiments (tuple-like) - AssignmentSession objects to be compared.
  • inttype (str, optional) - In accordance with Enhancing AssignmentSession.plot_spectrum() #19, choose whether to plot "Intensity" or "SNR". Default None is to plot "SNR" if available, else "Intensity". See Enhancing AssignmentSession.plot_spectrum() #19 discussion.
  • overlay (bool, optional) - If True, spectral traces of each experiment are added to the same plot. If False, a subplot of each experiment is created in vertical stacking.
  • xsync (bool, optional) - When True, synchronizes the x-axes of all subplots so that when one is changed, all are changed. Otherwise each x-axis is independent of the others. This option is not applied when overlay = True, as there is only one x-axis in that case.

*There is a correlate_experiments() function and corresponding plot wrapper functions in the analysis module, but as I understand it, this doesn't have the desired functionality since it only returns coincident frequencies. Also, encountered error in trying to use this function, see #20.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestNew features/functionality to PySpecToolsmedium-effortRequires more than a few lines of code to fix

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions