# The Ubuntu Forum Community > Other Discussion and Support > Education & Science >  X-ray Photoelectron Spectroscopy: XPSpeak

## Lateralis

Hello all.

This is a bit of a long shot, but what the hell.  

I'm a condensed matter research physicist and use x-ray photoelectron spectroscopy (XPS) a fair amount.  There's a programme for Windows called XPSpeak which allows me to fit semi-Voigt functions (convolved Gaussian-Lorentzian lineshapes) to experimental spectra, as well as doing background subtractions.  I've yet to find anything similar in Linux, and am hoping that someone on here might know of something I could use?  (XPSpeak is the only Windows programme that I *need* to use... getting an open source programme to do these bits would mean I can do everything in Ubuntu... hurray!)

The other problem I have with XPS data is I'm going to be using some theoretical calculations (some of my own, some in collaboration with Cambridge university) of the valence band electron density-of-states to compare with experimental XPS data.  In order to do this I will need to convolve the calculated data with Gaussians and Lorentzians.  Does anyone have any suggestions how to do that?  I was thinking about writing something in Scilab, but if anyone has any programme that can do that for me, I'd be hugely appreciative.   :Smile:

----------


## slaanco

well i dont know that program of urs  :Sad: , but i think its should be feasible to use it with wine.

Installation of wine is straightforward:
sudo apr-get install wine

and then just:

wine *XPSpeak.exe

*to the second problem have u tried program called _fityk_?

----------


## Lateralis

I did try using Wine, without any success.  To be honest though, I'm still quite new when it comes to Linux and Wine does confuse me a little.  I have been able to open up Winamp using Wine, but Winamp does nothing other than sit there looking pretty.  If Winamp is supposed to work in Wine then it surely means I'm doing something wrong and should have a look at it again more closely.  

As for fityk, I'll give it a shot.  If it works, it will surely beat having to write my own Scilab/Matlab code!

----------


## slaanco

well according to wine app db winamp shsould work more or less quite well, so i think there might be something wrong with ur installation or settings of wine.

try to reinstall.

btw does XPSpeak use some special libraries?

----------


## Lateralis

Yeah I think XPSpeak does use some special libraries that are not normally found in Windows.

I just tried Wine through the command line.  I get the following:



```
err:module:import_dll Library MSVBVM60.DLL (which is needed by L"Z:\\XPSPEAK41.exe") not found
err:module:LdrInitializeThunk Main exe initialization for L"Z:\\XPSPEAK41.exe" failed, status c0000135
```


Just uninstalled and reinstalled through the command line but I get the same error. =(

----------


## mips

http://www.uksaf.org/software.html
http://www.nist.gov/srd/nist100.htm
http://www.spectroscopynow.com/coi/c...sort=az&chId=0
http://webscripts.softpedia.com/scri...ral-35595.html
http://www.mf.mpg.de/en/abteilungen/...tware_en.shtml
http://www.boutell.com/lsm/lsmsubject.html
http://ces.iisc.ernet.in/hpg/envis/mapdoc1712.html
http://www.programs4all.net/software/spect.htm

There might be something of use to you in the above links.

----------


## WW

It looks like you can get MSVBVM60.DLL from Microsoft here.

----------


## Lateralis

Thanks for the replies people.  Sorry it's taken a while to get back to you - was in Amsterdam between Sunday and yesterday, then at work again today.  

Some of those links looks promising, and I'll see about getting the DLL, but that in itself seems rather kookie - XPSpeak works fine in Windows without any issues.  Why is Linux having issues finding DLLs?  

Anyway, thanks again for the replies.  Much appreciated as always.  :Smile:

----------


## mips

> Why is Linux having issues finding DLLs?


DLLs are not native to linux at all, it is something native to MS Windows.

And if you ask me it is probaly illegal to copy them anyway for use in Wine unless you don't have them originally lincensed via a purchase.

----------


## PeterP24

If it doesn't work with wine you should try with Vmware server. You can install windows xp in your virtual machine and then use your program. 

Peter

----------


## Tharmas

There is an excellent peak fitting program in the repositories: *fityk*
I used it to deconvolute infrared spectra.

And qtiplot (a plotting program similar to origin) also has a peak fitting facility.

----------


## Lateralis

Thanks for your reply, Tharmas!  

Just had a look at fityk and it does have an option to fit pseudo-Voigt functions to XPS data.  Not yet played around with it as I'm off to teach presently, but this looks very promising indeed.  Not sure if it will give me the freedom to manually fit peaks that XPSpeak gives me.  If it doesn't, I'll try going down the VM route.  

Thanks again.

----------


## LittleAngel

I'm also a user of XPSpeak,
and I have to stick with this program coz my collegues share the fitted data with XPSpeak.

Just found out that XPSpeak is a freeware,
Guys good at programming could request the source code:



> General Information (from R. Kwok)
> This version of the program was written in Visual Basic 6.0 and uses 32 bit processes. This is freeware. You may ask for the source program if you really want to. I hope this program will be useful for people without modern XPS software. I also hope that the new features in this program can be adopted by the XPS manufacturers in the later versions of their software. 
> If you have any questions/suggestions, please send an email to me.
> 	Raymund W.M. Kwok
> 	Department of Chemistry
> 	The Chinese University of Hong Kong
> 	Shatin, Hong Kong
> 	Tel: (852)-2609-6261
> 	Fax852)-2603-5057
> ...


However it's written in VB...so may be difficult to port to Linux?

----------


## juggies

I know the Collaborative Computational Project CCP had one on xps peak fitting and one of them was for linux... here is the link

http://www.ccp5.ac.uk/

You might want to check with all the CCP projects there are like 12 or 13 of them  :Smile: 





> Hello all.
> 
> This is a bit of a long shot, but what the hell.  
> 
> I'm a condensed matter research physicist and use x-ray photoelectron spectroscopy (XPS) a fair amount.  There's a programme for Windows called XPSpeak which allows me to fit semi-Voigt functions (convolved Gaussian-Lorentzian lineshapes) to experimental spectra, as well as doing background subtractions.  I've yet to find anything similar in Linux, and am hoping that someone on here might know of something I could use?  (XPSpeak is the only Windows programme that I *need* to use... getting an open source programme to do these bits would mean I can do everything in Ubuntu... hurray!)
> 
> The other problem I have with XPS data is I'm going to be using some theoretical calculations (some of my own, some in collaboration with Cambridge university) of the valence band electron density-of-states to compare with experimental XPS data.  In order to do this I will need to convolve the calculated data with Gaussians and Lorentzians.  Does anyone have any suggestions how to do that?  I was thinking about writing something in Scilab, but if anyone has any programme that can do that for me, I'd be hugely appreciative.

----------


## juggies

As far as using pseudo-Voigt function for your fitting thats a bit odd unless ofcourse you are using non-monochromatic x-ray.. anyway I had used a program called x-fit which is meant to fitting standard X-ray diffraction peak where usually the K-beta part gives rise to kind of doublet peak. X-fit does bothpseudo-Voigt and also Pearson 7 function. Unfortunately I did not try the shirley baseline corrections.. you might want to give it a try. X-fit was developed by the CCP project

 :Smile: 





> Thanks for your reply, Tharmas!  
> 
> Just had a look at fityk and it does have an option to fit pseudo-Voigt functions to XPS data.  Not yet played around with it as I'm off to teach presently, but this looks very promising indeed.  Not sure if it will give me the freedom to manually fit peaks that XPSpeak gives me.  If it doesn't, I'll try going down the VM route.  
> 
> Thanks again.

----------


## kaspar_silas

Such a deja vu moment as I had whilst reading this. A few years ago I was after exactly the same tools you mentioned. (I was doing X-ray spectroscopy at the time.)

I decided to write some programs for fitting and background removal. I don't actually have them at present but I can contact my old work to try and get them. 

But first, do you know c++? This is what I wrote the program in and the codes have no interface so you have to alter the code itself. On the plus side this was my first c++ project so it's not exactly high level code thou it does use some numerical recipe code for the fitting. 

As to the convolving of theoretical results. What are you planning to view the spectra with? Even in excel you can do convolution on the fly. Or am I missing something here?

----------


## Lateralis

Thank you to all who have replied since my last message.  I have been keeping an eye on the thread, but I've not a lot to report at the moment.  

fityk looks pretty usual with some very nice tools, but is unsuited to the stuff that I'm doing.  It can fit pseudo-Voigt functions, but it is quite cack-handed to use.  I also did try to get hold of Kowk at Hong Kong University, but his e-mail address wasn't working.  

I've not done C++ programing before, but I can program in Fortran.  What I could do with though is a graphical interface when fitting the data - there are many subtle effects that influence the shape of XPS features which are impossible to code into an automatic fitting program and necessitates a trial and error approach by hand.  The background in XPS data isn't as simple as a linear background either, but is a slightly more complicated "Shirley" background, although if Kwok can implement that then it shouldn't be too much of an issue. 

As for the psudo-Voigt fitting itself, the biggest source of a Gaussian lineshape in XPS comes from the x-ray source.  The Daresbury Laboratory XPS machine uses a high intensity, highly monochromated Al K-alpha x-ray source, but other instrumental factors also contribute a Gaussian lineshape to the data.  As such, you invariably have to accept that no matter how good the source, the data will always have Lorentzian (from the lifetimes of excited states) and Gaussian components.  

As for the convolution of theoretical spectra, I've never done anything like that in Excel before, but I wouldn't trust Excel to do it properly either.  Moreover, I'm looking for a program that is open source and can run on Linux!   :Capital Razz:   I think the easiest thing to do is probably to use Scilab/Matlab, but if anyone knows of any program that has a handy "Convolve this data with a Gaussian/Lorentzian!" button, then let me know!

With regards to CCP5, I was rather excited!  However, I didn't see any downloadable program and it would appear as though I need to be a member of the group (which costs).  Is that the case, Juggies?

----------


## kaspar_silas

Sorry, I should have been clearer, I didn't mean to automate the whole procedure. I meant to alter the code to give you an interface. But it seems you have other options now anyway.

O Incidentally the background fit I did was far from a simple linear fit. It fitted any function. You simply coded the equation you wanted to fit, the range to fit over, some parameter estimates and it did non linear fitting. It sounds impressive but like I said I used numerical recipe code for all the hard stuff. 

I am a bit confused by the line "there are subtle effects that influence the shape of XPS features which are impossible to code into an automatic fitting program". Are you fitting by hand? Otherwise surely you take away a background, form an equation you think is applicable for your data then do whatever fitting you want. I can't think of any subtle effects that are outside this method but let me know if I am wrong. 

Lastly I didn't mean you to use excel, I hate excel. For one it added about a month to my PhD. I was just pointing out that absolutely anything, that can multiply and add, can do convolution. I would totally trust excel to do convolution. In fact much more than any button because it would be me entering the equations. Admittedly I could look up the button's action if it was an open source program in a language I knew (but I probably wouldn't).

----------


## robertp999

On my setup, it looks like Xpspeak installs and runs fine (Ubuntu 8.04 / Inspiron 8600). I downloaded Xpspeak 4.1 from http://www.phy.cuhk.edu.hk/~surface/XPSPEAK/.

After unzipping the archive in its own folder, I ran "wine setup.exe", and it installed normally.

The wine version I'm using is wine-1.0, with default settings of "Windows XP" in winecfg.

Hope this helps.

----------


## juggies

I know that all the CCP work were free but I think many of their work are vanishing... Xfit is for analyzing X-ray diffraction but I made it work for XPS too. It was a little frustrating using it in the beginning but once you get used to it... it was fun. On a different note I came across this site which might be of help

http://escalab.snu.ac.kr/~berd/Fitt/fitt.html

Let me know how it is  :Smile: 






> Thank you to all who have replied since my last message.  I have been keeping an eye on the thread, but I've not a lot to report at the moment.  
> 
> fityk looks pretty usual with some very nice tools, but is unsuited to the stuff that I'm doing.  It can fit pseudo-Voigt functions, but it is quite cack-handed to use.  I also did try to get hold of Kowk at Hong Kong University, but his e-mail address wasn't working.  
> 
> I've not done C++ programing before, but I can program in Fortran.  What I could do with though is a graphical interface when fitting the data - there are many subtle effects that influence the shape of XPS features which are impossible to code into an automatic fitting program and necessitates a trial and error approach by hand.  The background in XPS data isn't as simple as a linear background either, but is a slightly more complicated "Shirley" background, although if Kwok can implement that then it shouldn't be too much of an issue. 
> 
> As for the psudo-Voigt fitting itself, the biggest source of a Gaussian lineshape in XPS comes from the x-ray source.  The Daresbury Laboratory XPS machine uses a high intensity, highly monochromated Al K-alpha x-ray source, but other instrumental factors also contribute a Gaussian lineshape to the data.  As such, you invariably have to accept that no matter how good the source, the data will always have Lorentzian (from the lifetimes of excited states) and Gaussian components.  
> 
> As for the convolution of theoretical spectra, I've never done anything like that in Excel before, but I wouldn't trust Excel to do it properly either.  Moreover, I'm looking for a program that is open source and can run on Linux!    I think the easiest thing to do is probably to use Scilab/Matlab, but if anyone knows of any program that has a handy "Convolve this data with a Gaussian/Lorentzian!" button, then let me know!
> ...

----------


## juggies

One more thing I forgot... here is the link to xfit

http://www.ccp14.ac.uk/tutorial/xfit-95/xfit.htm

again this is a windows s/w but gives you a good handle interms of fitting with psuedo vogit or pearson VII function. The background it tricky since you are making a s/w meant to XRD do a shirley correction but play around the function a bit.

----------


## Lateralis

Thanks again to everyone that has replied in this thread with various suggestions, links and tips.  You may all be pleased to know that I have actually got to know Crossover and have used that to install working copies of both Origin and XPSpeak.  My world is now complete!  

By the way Juggies... I just had a quick look at the Fitt programme you linked to in a previous post... I've not installed or used it, but it does look rather dandy and about what I was after.  If I find that XPSpeak isn't working properly with Crossover, then I will give that a shot.  

Thanks again to everyone.  Your posts were very much appreciated.   :Smile:

----------

