How to open a Galactic SPC file (.spc) online, without GRAMS

SPC is the binary spectrum format of Galactic's GRAMS software, now part of Thermo Fisher. Many IR, Raman, NIR and UV-Vis instruments and converters still write it, but without GRAMS or a converter it is hard to open.

What is inside an SPC file

In the current format, an SPC file starts with a 512-byte header (the axis types, the number of points, the date, a comment), followed by one or more subfiles, each holding one spectrum. Some files end with a text log of instrument settings.

Not every .spc file is Galactic SPC: Shimadzu UVProbe also saves .spc, in a different, unrelated format.

In your browser

  1. Open Nagura Lab and drop one or more .spc files on the page, or use Open data and pick Files.
  2. The spectrum is plotted on the axis it was recorded on: IR with high wavenumbers on the left, Raman shift, wavelength in nm, or m/z. Mass spectra stored as peak lists are drawn as sticks.
  3. A file with many spectra lists each one separately, named after its position, for example #2 · Time 30 s. The first is plotted; tick others to overlay up to eight.
  4. Download CSV gives the plotted spectra in columns, with a header such as Wavelength (nm); Download PNG gives the figure.

Chromatograms saved as SPC (often with the .cgm extension) open as chromatograms, with time in minutes. Both the new and the old format are read, with every x and y storage form described above. The file is decoded on your computer and never uploaded.

Not supported: Shimadzu UVProbe .spc files (they are recognized and refused with a message) and the rare big-endian variant of SPC.

In Python

The open-source spc-io package (MIT) reads SPC files:

import csv
from spc_io import SPC

with open("spectrum.spc", "rb") as f:
    spc = SPC.from_bytes_io(f)
print(len(spc))                          # number of spectra in the file
sub = spc[0]
with open("spectrum.csv", "w", newline="") as f:
    csv.writer(f).writerows(zip(sub.xarray, sub.yarray))

For files with many spectra, loop over spc to get each one.