JCAMP data import broken for official test files

A user has asked me about issues trying to import JCAMP data generated by some software called 'Spinit', for spectrometers by some company 'RS2D' (I'm not familiar with it).

While I have my doubts that the example file they sent is strictly up to the JCAMP-DX standard, my conversation with them has uncovered that we are also not up to standard. Test files from the IUPAC JCAMP-DX github page, e.g. 'TESTFID.DX' fail, both in specIO.fileTypeCheck and in specIO.loadJCAMP. An incomplete list of things to pay attention to:

  • JCAMP extensions can apparently be capitalised, which we don't look for. The JCAMP-DX format is described in this paper, which the github also links to.

  • JCAMP value fields appear to normally be comma-separated, while we look for space-separation

  • What exactly are XYDATA lines allowed to start with? Integers (positive and negative) with an optional space? The user has floats, weirdly enough, and he says his file is still loaded correctly by a native matlab function 'jcampread'...

Aside from fixing this, the relevant tests will need to be updated, with better files in nmr_datafiles as well.

Edited by Jop Wolffs