Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error parsing wxd file #4

Open
somerandomsequence opened this issue Feb 2, 2018 · 1 comment
Open

Error parsing wxd file #4

somerandomsequence opened this issue Feb 2, 2018 · 1 comment

Comments

@somerandomsequence
Copy link

Hello again. Thanks for your help with those other issues. I'm getting much further, but still cannot seem to read a WXD file. I have installed metakit (.so and .py placed in scripts directory).

$ python scripts/convert_spectra.py -f rruff ~/somefile.wxd 
Traceback (most recent call last):
  File "scripts/convert_spectra.py", line 34, in <module>
    main()
  File "scripts/convert_spectra.py", line 26, in main
    for infile, traj in map(_parse, args.files):
  File "scripts/convert_spectra.py", line 8, in _parse
    return infile, parse_spectrum(infile)
  File "/home/cphillip/.local/lib/python2.7/site-packages/superman/file_io/__init__.py", line 176, in parse_spectrum
    return parse_loose(fileobj)
  File "/home/cphillip/.local/lib/python2.7/site-packages/superman/file_io/__init__.py", line 39, in parse_loose
    data = np.loadtxt(fh, dtype=np.float32, delimiter=',', usecols=(0,1))
  File "/home/cphillip/.local/lib/python2.7/site-packages/numpy/lib/npyio.py", line 1092, in loadtxt
    for x in read_data(_loadtxt_chunksize):
  File "/home/cphillip/.local/lib/python2.7/site-packages/numpy/lib/npyio.py", line 1012, in read_data
    vals = [vals[j] for j in usecols]
IndexError: list index out of range

Is this the correct usage for reading a Renishaw WXD and writing to some other format? I'm working with data from a Renishaw inVia Raman Microscope. I'll see if there's a file I can share to reproduce this issue.

@perimosocordiae
Copy link
Member

Sorry for the belated reply. Your usage looks fine, so it's likely a shortfall in the WXD parser. If you dig up a shareable example I'll take a look.

In the mean time, you can try plot_spectra.py --type wxd ~/somefile.wxd and paste the error message it prints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants