jjhelmus / nmrglue

A module for working with NMR data in Python
BSD 3-Clause "New" or "Revised" License
209 stars 86 forks source link

Fix for JCAMP-DX spectra in ppm units #89

Closed JLVarjo closed 5 years ago

JLVarjo commented 5 years ago

Despite the JCAMP-DX NMR format states that data units should be in Hz, at least one manufacturer writes JCAMP-DX files in PPM units. This PR fixes the udic sweep calculation in those cases, recognized by the XUNITS record (or corresponding UNITS line in NTUPLES format) being "PPM". Unfortunately, I do not have a freely licensed test case to provide.

In addition, code was cleaned up by removing one unnecessary if-block.

jjhelmus commented 5 years ago

Thanks for putting this together. Sorry for taking so long to review.