Blame view

specimage.py 1.37 KB
967e46a1   dmayerich   added spectral sc...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  #!/usr/bin/python3

  import subprocess

  

  command = "bimsim"

  

  #images

  intImage = "out_i.bmp"

  absImage = "out_a"

  #detector specs

  dsize = 208

  dsample = 6.5

  res = int(dsize / dsample)

  sampling = 4

  #incident field

  #nu = 800

  source = "central.bmp"

  order = 100

  #sphere

  x = 0

  y = 0

  z = 0

  a = 5

  #spectral samples

  nuStart = 800

  nuStop = 4000

  nuStep = 10

  iters = int((nuStop - nuStart) / nuStep)

  

  

  #set the position of the image plane

  command += " -u " + str(-dsize/2)

  command += " -v " + str(-dsize/2)

  command += " -w " + str(a)

  command += " -U " + str(dsize/2)

  command += " -V " + str(dsize/2)

  command += " -W " + str(a)

  command += " --plane-norm-x " + str(0)

  command += " --plane-norm-y " + str(0)

  command += " --plane-norm-z " + str(1)

  command += " -R " + str(res)

  command += " --supersample " + str(sampling)

  command += " -X " + source

  command += " --field-order " + str(order)

  command += " -I " + intImage

  command += " -A " + absImage

  command += " --append"

  command += " -x " + str(x)

  command += " -y " + str(y)

  command += " -z " + str(z)

  command += " -r " + str(a)

  

  for inu in range(0, iters):

      print("Iteration # " + str(inu + 1) + "/" + str(iters))

      nu = nuStart + inu * nuStep

      lam = 10000.0/nu

      

      runcommand = command + " -l " + str(lam)

      print(runcommand)

      subprocess.call(runcommand, shell=True)

  

  #print("Hello world!")