Importing Raman spectroscopy data from Renishaw Wire

429 views
Skip to first unread message

Emil Bjerglund Pedersen

unread,
Nov 15, 2016, 10:59:18 AM11/15/16
to hyperspy-users
Hi all,

I have Raman spectra maps obtained using Renishaws Wire software, and I would like to do PCA on those maps. I don't think it is easy to deal with Renishaws own .wdf format, but the maps can be exported to .txt in the software and are then organised in a tab-separated format by X, and Y-coordinates and then Wavenumber and Intensity as a long list. I have attached a small sample here of a 4x2 pixel map with spectra obtained between approx. 3500 /cm to 900 /cm.

I am not super experienced in Python, but I understand that it should be possible to read this data into a numpy array using something along the lines of:

path = 'small.txt'
d = np.loadtxt(path, delimiter='\t')

and then load it into HyperSpy with:

s = hs.signals.Signal1D(d)
s

However, to correctly do that and be able to work with the spectra in HyperSpy it will be necessary to restructure the array in some way. Any recommendations on how to do that?

Best regards,
Emil Bjerglund Pedersen
small.txt

Francisco

unread,
Nov 15, 2016, 11:18:29 AM11/15/16
to hyperspy-users
The following line should do the trick:


s = hs.signals.Signal1D(d[:,-1].reshape((4, 2, 1015)))

You'll need to calibrate the axes manually though which, in this case is not possible because the Wave axis is non-linear. Non-linear axes are not yet supported unfortunately.

Best wishes,

Francisco

Emil Bjerglund Pedersen

unread,
Nov 15, 2016, 12:31:05 PM11/15/16
to hyperspy-users
Thank you, that seems to do the trick :-)

- Emil
Reply all
Reply to author
Forward
0 new messages