toolsを整理した。cn2Iqとcn2Iq.pyを追加した。

This commit is contained in:
2023-04-24 09:01:22 +09:00
parent f35b5aa93e
commit bc3625d06f
6 changed files with 1405 additions and 69 deletions
+23 -3
View File
@@ -146,9 +146,10 @@ example/glass.sq was generated.
-o --output=%s Output basename [basename]
#+end_example
* misc
* tools
** coeffploter.py
元素を指定して、原子散乱因子と中性子散乱長をプロットする。
元素を指定して、原子散乱因子と中性子散乱長をプロットする。引数に元
素名を複数していできる。
** gr2sq.py
Qの刻みを変えて再計算するために、dump2sqで生成したgrファイルから
@@ -158,4 +159,23 @@ example/glass.sq was generated.
$$
Q = \frac{4\pi}{\lambda}\sin(\theta)
$$
計算した$S(Q)$はpngとxlsxを生成する
** cn2Iq.c
dump2sqで生成された*.cnと*.coeffから$I(q)$を計算するCプログラム。
openmpでスレッド並列する。f*fは足していない。sincのwindow関数をかけ
る。コンパイルは、
#+begin_example
gcc -fopenmp -O3 -Wall cn2Iq.c -o cn2Iq
#+end_example
実行は、*.cnと*.coeffを渡す。I(q)は標準出力に出力されうr.
#+begin_example
./cn2Iq fort.cn fort.cn.coeff
#+end_example
複数のcnファイルやxslxに保存したい場合は、cn2Iq.pyを使う。
** cn2Iq.py
subprocessでCのcn2Iqを呼び出して、I(Q)のpngとxlsxを生成する。Qの範囲
またはthetaの範囲を指定できる。