mctools / cdft_ncrystal

Source code to reproduce figures in the paper "Convolutional discrete Fourier transform method for calculating thermal neutron cross section in liquids" (arXiv:2112.06647)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cdft_ncrystal

Source code to reproduce figures in the paper "Convolutional discrete Fourier transform method for calculating thermal neutron cross section in liquids" (arXiv:2112.06647)

To execute the code, python3.8+ environment is needed, alone with h5py, numpy matplotlib and optionally NCrystal to plot the final total cross section.

The calSqw.py file implements Eq. 23 and 24 in the paper. It can be used to reproduce the CDFT results in Fig. 3 and 4 of the paper. After entering the source code directory, the data for Figure 3 can be calculated on-the-flight by running “python3 calSqw.py 1.0”, where the last number is Q value between 1 and 80. The GAMMA(t) function of Eq. 21 is pre-calculated as the /data/last_H.gamma, using the Filon method in the Appendix A.

Merging the data generated by calSqw.py at different Q values, we can have a sqw file, such as those /data/*.sqwhdrft files. These files corresponding to the final results of Eq. 21. By running “python3 sqw2ncmat.py”, the input data last.ncmat for NCrystal can be generated.

With NCrystal, by running “ncrystal_inspect last.ncmat”, the double differential cross section will be integrated, and the total cross section will be shown.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

About

Source code to reproduce figures in the paper "Convolutional discrete Fourier transform method for calculating thermal neutron cross section in liquids" (arXiv:2112.06647)

License:Apache License 2.0


Languages

Language:Python 100.0%