XicsrtSourceDirected¶
xicsrt.sources._XicsrtSourceDirected.XicsrtSourceDirected
New Members¶
-
class
XicsrtSourceDirected
(*args, **kwargs)[source]¶ Bases:
xicsrt.sources._XicsrtSourceGeneric.XicsrtSourceGeneric
An extended rectangular ray source with rays emitted in a preferred direction.
This is similar to the SourceGeneric except that an explicit direction can be provided instead of always emitting rays along the z-axis.
This is different from a SourceFocused in that the emission cone is always aimed in a fixed direction for every location in the source. The SourceFocused instead aims the emission cone at a specific target so that the aiming direction changes for different locations within the source.
Configuration Options:
- direction
- The direction in which to emit rays. This direction will define the center of the emission code with angular spread spread.
- xsize
- The size of this element along the xaxis direction.
- ysize
- The size of this element along the yaxis direction.
- zsize
- The size of this element along the zaxis direction.
- spatial_dist : string (‘uniform’)
- The type of angular distribution to use for the emitted rays.Available distributions (default is ‘uniform’):uniformUniform spatial distribution of rays within a rectangular cuboiddefined by xsize, ysize and zsize. The sizes are interpreted asfull widths.gaussianGaussian spatial distribution of rays with a fwhm in eachdimension defined by xsize, ysize and zsize. The sizes areinterpreted as full-width-at-half-max (fwhm).
- angular_dist : string (‘isotropic’)
- The type of angular distribution to use for the emitted rays.Available distributions (default is ‘isotropic’):isotropicIsotropic emission (uniform spherical) emitted in a cone (circularcross-section) with a half-angle of ‘spread’. The axis of theemission cone is aligned along the z-axis. ‘spread’ must be asingle value (scalar or 1-element array).isotropic_xyIsotropic emission (uniform spherical) emitted in a truncated-cone(rectangular cross-section) with different x and y half-angles.‘spread’ can contain either 1, 2 or 4 values:s or [s]A single value that will be used for both the x and y directions.[x, y]Two values values that will be used for the x and y directions.[xmin, xmax, ymin, ymax]For values that define the asymmetric exent in x and y directions.Example: [-0.1, 0.1, -0.5, 0.5]flatFlat emission (uniform planar) emitted in a cone (circular cross-section) with a half-angle of ‘spread’.flat_xyFlat emission (uniform planar) emitted in a truncated-cone(rectangular cross-section) with different x and y half-angles.‘spread’ can contain either 1, 2 or 4 values, see above.gaussianEmission with angles away from the z-axis having a Gaussiandistribution (circular cross-section). The ‘spread’ defines theHalf-Width-at-Half-Max (HWHM) of the distribution. ‘spread’ mustbe a single value (scalar or 1-element array).gaussian_flat!! Not implemented !!Cross-section of emission (intersection with constant-z plane) willhave a Gaussian distribution.
- spread : float or array (np.pi) [radians]
- The angular spread for the emission cone. The spread defines the half-angle of the emission cone. See ‘angular_dist’ for detailed documentation.
- intensity : int or float
- The number of rays for this source to emit. This should be an integer value unless use_poisson = True. Note: If filters are attached, this will be the number of rays emitted before filtering.
- use_poisson : bool (False)
- If True the intenisty will be treated as the expected value for a Poisson distribution and the number of rays will be randomly picked from a Poisson distribution. This is setting is typically only used internally for Plasma sources.
- wavelength_dist : str (‘voigt’)
- The type of wavelength distribution for this source. Possible values are: ‘voigt’, ‘uniform’, ‘monochrome’. Note: A monochrome distribution can also be achieved by using a ‘voigt’ distribution with zero linewidth and temperature.
- wavelength : float (1.0) [angstroms]
- Only used if wavelength_dist = “monochrome” or “voigt” Central wavelength of the distribution, in Angstroms.
- wavelength_range : tuple [angstroms]
- Only used if wavelength_dist = “uniform” The wavelength range of the distribution, in Angstroms. Must be a 2 element tuple, list or array: (min, max).
- linewidth : float (0.0) [1/s]
- Only used if wavelength_dist = “voigt” The natural width of the emission line. This will control the Lorentzian contribution to the the overall Voigt profile. If linewidth == 0, the resulting wavelength distribution will be gaussian. To convert from a fwhm in [eV]: linewidth = 2*pi*e/(h*fwhm_ev) To translate from linewidth to gamma in the Voigt equation: gamma = linewidth * wavelength**2 / (4*pi*c*1e10)
- mass_number : float (1.0) [au]
- Only used if wavelength_dist = “voigt” The mass of the emitting atom in atomic units (au). This mass in used to convert temperature into line width. See temperature option.
- temperature : float (0.0) [eV]
- Only used if wavelength_dist = “voigt” The temperature of the emission line. This will control the Gaussian contribution to the overall Voigt profile. If temperature == 0, the resulting wavelength distribution will be Lorentzian. To translate from temperature to sigma in the Voigt equation: sigma = np.sqrt(temperature/mass_number/amu_kg/c**2*ev_J)*wavelength
- velocity
- No documentation yet. Please help improve XICSRT!
- filters
- No documentation yet. Please help improve XICSRT!
- origin
- The x,y,x origin of this element in global coordinates.
- zaxis
- A unit-vector defining the z-axis of the element in global coordinates. For most optics: z-axis defines the surface normal direction.
- xaxis : (optional)
- A unit-vector defining the x-axis of the element in global coordinates. For most optics: x-axis defines the ‘width’ direction. If xaxis is not provided it will be automatically generated by: cross(zaxis, [0,1,0]). The yaxis is always automatically generated and defined by: cross(zaxis, xaxis)
- class_name
- Automatically generated.
- yo_mama
- Is a wonderful person!
Inherited Members¶
-
class
XicsrtSourceDirected
[source] -
__init__
(*args, **kwargs) Initialize self. See help(type(self)) for accurate signature.
-
aim_to_point
(aim_point, xaxis=None) Set the Z-Axis to aim at a particular point.
-
check_config
() Check the config before copying to the internal param. This is called during object instantiation (__init__) and therefore before setup is called.
-
check_param
() Check the internal parameters prior to initialization. This will be called after setup and before initialize.
-
default_config
()[source] - direction
- The direction in which to emit rays. This direction will define the center of the emission code with angular spread spread.
-
generate_direction
(origin)
-
generate_mask
()
-
generate_origin
()
-
generate_rays
()
-
generate_wavelength
(direction)
-
generate_weight
()
-
get_config
()
-
get_default_xaxis
(zaxis) Get the X-axis using a default definition.
In order to fully define the orientation of a component both, a z-axis and an x-axis are expected. For certain types of components the x-axis definition is unimportant and can be defined using a default definition.
-
initialize
()[source] Initialize the object.
-
make_normal
()[source]
-
point_to_external
(point_local)
-
point_to_local
(point_external)
-
random_direction
(normal)
-
random_wavelength_cauchy
(size=None)
-
random_wavelength_normal
(size=None)
-
random_wavelength_voigt
(size=None)
-
ray_filter
(rays)
-
ray_to_external
(ray_local, copy=False)
-
ray_to_local
(ray_external, copy=False)
-
set_orientation
(zaxis, xaxis=None)
-
setup
() Perform any setup actions that are needed prior to initialization.
-
to_ndarray
(vector_in)
-
to_vector_array
(vector_in) Convert a vector to a numpy vector array (if needed).
-
update_config
(config_new, **kwargs) Overwrite any config values in this object with the ones given. This will be done recursively for all nested dictionaries.
-
vector_to_external
(vector)
-
vector_to_local
(vector)
-