A simple, web-based interactive viewer for SPyCCI-computed infrared spectra and molecular normal modes.
InfraRedPeppers is a lightweight Python application for interactively exploring computed infrared (IR) spectra. It combines broadened spectra, individual vibrational transitions, and animated molecular normal modes in a single web-based interface.
- Interactive IR spectrum: Explore broadened vibrational spectra using Gaussian or Lorentzian line shapes, with live controls for the line shape and full width at half maximum (FWHM).
- Absorbance and transmittance representations:
- Absorbance (default): Displays calculated intensities in arbitrary units.
- Transmittance: Converts the rescaled absorbance into transmittance according to (T(%) = 100 \times 10^{-A}). The strongest peak is scaled to a user-defined peak absorbance (default: 1.0, corresponding to a minimum transmittance of 10%). The wavenumber axis is reversed, following the conventional IR spectrum representation.
- Individual vibrational transitions: Display fundamental IR transitions as a stem plot alongside the broadened spectrum.
- Interactive mode selection: Hover anywhere in the plot to preview the transition closest in wavenumber to the cursor. The snapping distance adapts to the current zoom level.
- Persistent mode selection: Hovering provides a temporary preview, while clicking selects a mode persistently.
- Visual highlighting: The selected or previewed mode is highlighted in both the broadened spectrum and the stem plot.
- Normal-mode animations: View animated GIFs of molecular normal modes generated with VMD. Existing animations are reused and served directly from disk.
- Publication-ready figures: Export spectrum plots as high-resolution PNG images directly from the plot toolbar, using 3× scaling.
Note: The transmittance representation is qualitative. Calculated intensities are treated as absorbance and rescaled for visualization; the resulting transmittance should not be interpreted as an experimentally calibrated spectrum.
Install the Python dependencies with:
pip install "dash>=2.9" plotly numpy spycciNormal-mode animations are generated using VMD. Make sure VMD is installed and properly configured if you need to generate new animations. Existing GIF files can be reused without regenerating them.
Run the viewer by providing a JSON file containing vibrational data computed with SPyCCI:
python InfraRedPepper.py molecule.jsonBy default, normal-mode animations are stored in the modes/ directory.
usage: InfraRedPepper.py [-h] [-o DIR] [-f] JSON
positional arguments:
JSON Path to the input JSON file generated by SPyCCI.
options:
-h, --help Show this help message and exit.
-o DIR, --output DIR Destination directory for normal-mode animation files
(default: modes).
-f, --force Force the generation of new animations even if the
destination folder already exists.
Use the default output directory:
python InfraRedPepper.py molecule.jsonSpecify