dkriegner / xrayutilities

xrayutilities - a package with useful scripts for X-ray diffraction physicists
http://xrayutilities.sourceforge.io
GNU General Public License v2.0
81 stars 29 forks source link

2d GIXD simulation #128

Closed ChangChunHe closed 2 years ago

ChangChunHe commented 2 years ago

DeepinScreenshot_select-area_20211102154103 I want to simulate this two-dimensional GIXD just from a monolayer structure, maybe below scripts can help, but I can not figure out how to get every peak in this figure. Any reply will be appreciated.

gid = xu.GID(Si.Q(1, -1, 0), Si.Q(0, 0, 1))
# calculate angles and print them to the screen
(alphai, azimuth, tt, beta) = gid.Q2Ang(Si.Q(2, -2, 0))
print("azimuth,tt: %8.3f %8.3f" % (azimuth, tt))
dkriegner commented 2 years ago

The information you specify is insufficient to provide any qualified answer. If you expect some helpful comments please specify the details of your scattering geometry.

The GID class you use is generally not designed for two dimensional powder like measurements as it seems you are interested in. Generally there are no direct functions which could simulate such a measured pattern. With some work you should be able, however, to obtain the peak positions occurring in such measurements.

For this you will have to define your unit cell size and iterate over all possible HK values and always calculate the scattering angle/momentum transfer.

ChangChunHe commented 2 years ago

Thanks for your reply, I have an monolayer structure(cif format), I want to simulate the GIXD above. POSCAR.txt

The information you specify is insufficient to provide any qualified answer. If you expect some helpful comments please specify the details of your scattering geometry.

The GID class you use is generally not designed for two dimensional powder like measurements as it seems you are interested in. Generally there are no direct functions which could simulate such a measured pattern. With some work you should be able, however, to obtain the peak positions occurring in such measurements.

For this you will have to define your unit cell size and iterate over all possible HK values and always calculate the scattering angle/momentum transfer.

dkriegner commented 2 years ago

I hope you realize that your second comment almost did not add any details about what you really wanna do.

As I wrote above with some work (writing some loops over HK) you should be able to obtain the peak positions. A real simulation of the peaks including their heights will be more challenging since you will have to consider the intensity (structure factor and multiplicity) and many geoemetrical parameters. For 2D powders (and I assume this is your case) this is not implemented in xrayutilities. If you are able and willing to contribute some functionality I am open to review patches

ChangChunHe commented 2 years ago

Emmm, I want to simulate the grazing incidence x-ray diffraction(GIXD) of a surface structure, where the structure is loaded above in cif format. I wander that it is difficult or impossible to simulate the GIXD of a monolayer theoretically, or any other beyng XRD simulation is needed?

dkriegner commented 2 years ago

I am not sure if we understand each other. I keep answering the same thing and you keep asking the same thing.

To be clear in xrayutilities you currently do not find a function which will simulate your pattern. It can be done if you invest some work.