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:
experiments (tuple-like) - AssignmentSession objects to be compared.
inttype (str, optional) - In accordance with #19, choose whether to plot "Intensity" or "SNR". Default None is to plot "SNR" if available, else "Intensity". See #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.
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:
AssignmentSession
objects to be compared.inttype (str, optional) - In accordance with #19, choose whether to plot "Intensity" or "SNR". DefaultSee #19 discussion.None
is to plot "SNR" if available, else "Intensity".True
, spectral traces of each experiment are added to the same plot. IfFalse
, a subplot of each experiment is created in vertical stacking.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 whenoverlay = True
, as there is only one x-axis in that case.*There is a
correlate_experiments()
function and corresponding plot wrapper functions in theanalysis
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.