Closed ostannick closed 4 years ago
There is an extended ASCII character in your file somewhere (apparently È). As a quick fix try to replace that. In code this can be fixed by augmenting all non-binary file opens and relevant decode calls with
encoding="utf-8", errors="replace"
Funny coincidence, I just encountered the same issue and fixed these for all fileio code, so there will be pull request soon :)
Edit: now I noticed that in Bruker procs file reading this issue has been fixed in a bit different way (#101), using
encoding=locale.getpreferredencoding()
@jjhelmus, would this be the suggested way to fix this instead?
@ostannick, seems like you are trying to read a sparky file in nmrglue, but using the pipe.read
function, which will work only for nmrpipe files. You should instead use:
>>> dic, data = ng.sparky.read("data/HNCO.ucsf")
Thank you both, apologies for my idiocy!
Trying to open up a 3D spectrum (UCSF)
Any ideas how to fix this?