XicsrtSourceFocused¶
xicsrt.sources._XicsrtSourceFocused.XicsrtSourceFocused
New Members¶

class
XicsrtSourceFocused
(*args, **kwargs)[source]¶ Bases:
xicsrt.sources._XicsrtSourceGeneric.XicsrtSourceGeneric
An extended rectangular ray source that allows focusing towards a target.
This is different to a SourceDirected in that the emission cone is aimed at the target for every location in the source. The SourceDirected instead uses a fixed direction for emission.
Configuration Options:
 target
 The target at which to aim the emission cone at each point in the source volume. The emission cone aimed at the target will have an angular spread defined by 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 fullwidthathalfmax (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 (circularcrosssection) with a halfangle of ‘spread’. The axis of theemission cone is aligned along the zaxis. ‘spread’ must be asingle value (scalar or 1element array).isotropic_xyIsotropic emission (uniform spherical) emitted in a truncatedcone(rectangular crosssection) with different x and y halfangles.‘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 crosssection) with a halfangle of ‘spread’.flat_xyFlat emission (uniform planar) emitted in a truncatedcone(rectangular crosssection) with different x and y halfangles.‘spread’ can contain either 1, 2 or 4 values, see above.gaussianEmission with angles away from the zaxis having a Gaussiandistribution (circular crosssection). The ‘spread’ defines theHalfWidthatHalfMax (HWHM) of the distribution. ‘spread’ mustbe a single value (scalar or 1element array).gaussian_flat!! Not implemented !!Crosssection of emission (intersection with constantz plane) willhave a Gaussian distribution.
 spread : float or array (np.pi) [radians]
 The angular spread for the emission cone. The spread defines the halfangle 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 unitvector defining the zaxis of the element in global coordinates. For most optics: zaxis defines the surface normal direction.
 xaxis : (optional)
 A unitvector defining the xaxis of the element in global coordinates. For most optics: xaxis 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
XicsrtSourceFocused
[source] 
__init__
(*args, **kwargs) Initialize self. See help(type(self)) for accurate signature.

aim_to_point
(aim_point, xaxis=None) Set the ZAxis 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]  target
 The target at which to aim the emission cone at each point in the source volume. The emission cone aimed at the target will have an angular spread defined by spread.

generate_direction
(origin)[source]

generate_mask
()

generate_origin
()

generate_rays
()

generate_wavelength
(direction)

generate_weight
()

get_config
()

get_default_xaxis
(zaxis) Get the Xaxis using a default definition.
In order to fully define the orientation of a component both, a zaxis and an xaxis are expected. For certain types of components the xaxis definition is unimportant and can be defined using a default definition.

initialize
() Initialize the object.

make_normal
()

make_normal_focused
(origin)[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)
