jjhelmus / nmrglue

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

Processing 1D Bruker Data, example not working. #76

Closed erikkjellgren closed 6 years ago

erikkjellgren commented 6 years ago

Hi,

When I try to run the example from http://nmrglue.readthedocs.io/en/latest/examples/proc_bruker_1d.html, it get the following error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-3cf04936a564> in <module>()
      4 
      5 # read in the bruker formatted data
----> 6 dic, data = ng.bruker.read('expnmr_00001_1')
      7 
      8 # remove the digital filter

~/miniconda3/lib/python3.6/site-packages/nmrglue/fileio/bruker.py in read(dir, bin_file, acqus_files, 
pprog_file, shape, cplex, big, read_pulseprogram, read_acqus)
    325     # read the binary file
    326     f = os.path.join(dir, bin_file)
--> 327     null, data = read_binary(f, shape=shape, cplex=cplex, big=big)
    328     return dic, data
    329 

~/miniconda3/lib/python3.6/site-packages/nmrglue/fileio/bruker.py in read_binary(filename, shape, 
cplex, big)
    994     # reshape if possible
    995     try:
--> 996         return dic, data.reshape(shape)
   997 
   998     except ValueError:

TypeError: 'float' object cannot be interpreted as an integer

I installed nmrglue through conda by: conda install -c bioconda nmrglue and I am using Python3.6.

jjhelmus commented 6 years ago

Can you try updating to the latest release, 0.6? I believe this was address in #52.

erikkjellgren commented 6 years ago

Is there a conda channel available that have v. 0.6?

jjhelmus commented 6 years ago

Not that I know of, pip install nmrglue will get you 0.6 and is the recommended install method.

erikkjellgren commented 6 years ago

Thanks for your quick support