tschoonj / xraylib

A library for X-ray matter interaction cross sections for X-ray fluorescence applications
https://github.com/tschoonj/xraylib/wiki
Other
120 stars 54 forks source link

Difference in #shells between xraylib and xmimsimdata.h5 #214

Closed bbazi closed 1 year ago

bbazi commented 1 year ago

Hi Tom,

I was going through the 'advanced Compton energy' calculation in xmi_main.F90 of xmimsim and saw that a function 'ElectronConfig_Biggs' (see picture) is used to find the number of electrons inside a given shell of a certain element Z.

ElectronConfig_Biggs in advanced compton energy in xmi_main f90 of xmimsim

I went through all the xmimsim source files and xraylib functions and could not find this ElectronConfig_Biggs function, could you show where I can find/call this function? I'm trying to implement the advanced Compton energy calculation in my own scripts.

I do see that one could use the ElectronConfig function from xraylib but here I see some differences with the number of shells which are reported in the xmimsimdata.h5 file. See pictures for difference in carbon Z=6, 4 shells in xraylib and 3 shells in xmimsimdata).

C shell indices xraylib

C shell indices xmimsimdata

Here, I have added a table which shows all the differenced in #shells between xraylib and xmimsimdata.h5 for Z between 1 and 92. Please let me know if there is an error or if I'm totally misinterpreting what's going on here ;-) (maybe this Biggs function corrects for this?...)

Shells xraylib vs xmimsimdata

PS: The xmimsimdata file that I use for calculations I got from installing XMI-MSIM 8.1.

Cheers, Benjamin

tschoonj commented 1 year ago

You did not look very hard then :smiley:

https://github.com/tschoonj/xraylib/search?q=ElectronConfig_Biggs shows you where this function is defined and how it is made available through the different languages.

The reason this function exists is that the Compton profiles from Biggs come with their own set of values for electron orbital occupancy, which happens to be different from the Kissel ones, which I consider to be 'canonical'. This is also why I never advertised this method, as I don't think that people should be really using it.

However, in XMI-MSIM I needed it because the Compton profiles are inextricably linked to these values...

bbazi commented 1 year ago

Oh I see, thanks for the feedback and history behind this. I found the Biggs electron configuration stored as: xraylib/data/comptonprofiles/biggs_electron_configuration.dat

These do indeed match with the number of shells as given in the xmimsimdata.h5 file after 'scrapping' the shells with 0 electrons 😄

Again, thanks for the quick reply! Cheers, Benjamin

tschoonj commented 1 year ago

You're welcome

Best,

Tom