File: make_sxrd_data.py

package info (click to toggle)
genx 3.8.8%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 40,328 kB
  • sloc: python: 79,567; makefile: 153; sh: 111; xml: 19
file content (24 lines) | stat: -rw-r--r-- 457 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'''Making sxrd data for simulations
P4mm symmetry k<h
'''
from numpy import c_, r_, array, arange, ones, savetxt

outfile = 'rods.dat'

h_min = 0
h_max = 3
k_min = 0
k_max = 3
l_min = 0.1
l_max = 3.5
l_step = 0.05

l = arange(l_min, l_max + l_step, l_step)

rods = array([[0,0,0,0,0]])[0:0]

for h in range(h_min, h_max + 1):
    for k in range(k_min, h+1):
        rods = r_[rods, c_[h*ones(l.shape), k*ones(l.shape), l, l*0, l*0]]

savetxt(outfile, rods)