example_02

Download a Jupyter notebook with this example: example_02.ipynb.

Please follow the source comments for description and instruction.

Source Code

 1# -*- coding: utf-8 -*-
 2"""
 3..  Authors:
 4    Novimir Antoniuk Pablant <npablant@pppl.gov>
 5
 6An example showing how to define a complex aperture.
 7"""
 8
 9import numpy as np
10import xicsrt
11xicsrt.warn_version('0.8')
12
13config = {}
14
15config['general'] = {}
16config['general']['number_of_iter'] = 5
17config['general']['save_images'] = False
18config['general']['random_seed'] = 0
19
20config['sources'] = {}
21config['sources']['source'] = {}
22config['sources']['source']['class_name'] = 'XicsrtSourceDirected'
23config['sources']['source']['intensity'] = 1e3
24config['sources']['source']['wavelength'] = 3.9492
25config['sources']['source']['angular_dist'] = 'isotropic_xy'
26config['sources']['source']['spread'] = np.radians(6.0)
27
28config['optics'] = {}
29config['optics']['aperture'] = {}
30config['optics']['aperture']['class_name'] = 'XicsrtOpticAperture'
31config['optics']['aperture']['origin'] = [0.0, 0.0, 0.8]
32config['optics']['aperture']['zaxis'] = [0.0, 0.0, -1]
33config['optics']['aperture']['aperture']=[
34    {'shape':'circle', 'size':[0.075], 'logic':'and'},
35    {'shape':'circle', 'size':[0.065], 'origin':[-0.010, -0.01],  'logic':'not'},
36    {'shape':'circle', 'size':[0.048], 'origin':[-0.027, -0.01],  'logic':'or'},
37    {'shape':'circle', 'size':[0.044], 'origin':[-0.032, -0.015], 'logic':'not'},
38    {'shape':'circle', 'size':[0.034], 'origin':[-0.041, -0.013], 'logic':'or'},
39    {'shape':'circle', 'size':[0.032], 'origin':[-0.045, -0.018], 'logic':'not'},
40    {'shape':'circle', 'size':[0.025], 'origin':[-0.038, -0.020], 'logic':'or'},
41    ]
42
43config['optics']['detector'] = {}
44config['optics']['detector']['class_name'] = 'XicsrtOpticDetector'
45config['optics']['detector']['origin'] = [0.0, 0.0, 1.0]
46config['optics']['detector']['zaxis'] = [0.0, 0.0, -1]
47config['optics']['detector']['xsize'] = 0.2
48config['optics']['detector']['ysize'] = 0.2
49
50
51results = xicsrt.raytrace(config)