XicsrtSourceGeneric

xicsrt.sources._XicsrtSourceGeneric.XicsrtSourceGeneric

New Members

class XicsrtSourceGeneric(*args, **kwargs)[source]

Bases: GeometryObject

Configuration Options:

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_diststring (‘uniform’)
The type of angular distribution to use for the emitted rays.
Available distributions (default is ‘uniform’):

uniform
Uniform spatial distribution of rays within a rectangular cuboid
defined by xsize, ysize and zsize. The sizes are interpreted as
full widths.

gaussian
Gaussian spatial distribution of rays with a fwhm in each
dimension defined by xsize, ysize and zsize. The sizes are
interpreted as full-width-at-half-max (fwhm).
angular_diststring (‘isotropic’)
The type of angular distribution to use for the emitted rays.
Available distributions (default is ‘isotropic’):

isotropic
Isotropic emission (uniform spherical) emitted in a cone (circular
cross-section) with a half-angle of ‘spread’. The axis of the
emission cone is aligned along the z-axis. ‘spread’ must be a
single value (scalar or 1-element array).
isotropic_xy
Isotropic 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]
flat
Flat emission (uniform planar) emitted in a cone (circular cross-
section) with a half-angle of ‘spread’.
flat_xy
Flat 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.
gaussian
Emission with angles away from the z-axis having a Gaussian
distribution (circular cross-section). The ‘spread’ defines the
Half-Width-at-Half-Max (HWHM) of the distribution. ‘spread’ must
be a single value (scalar or 1-element array).
gaussian_flat
!! Not implemented !!
Cross-section of emission (intersection with constant-z plane) will
have a Gaussian distribution.
spreadfloat 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.

intensityint 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_poissonbool (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_diststr (‘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.

wavelengthfloat (1.0) [angstroms]

Only used if wavelength_dist = “monochrome” or “voigt” Central wavelength of the distribution, in Angstroms.

wavelength_rangetuple [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).

linewidthfloat (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_numberfloat (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.

temperaturefloat (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!

__init__(*args, **kwargs)[source]
default_config()[source]
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_diststring (‘uniform’)
The type of angular distribution to use for the emitted rays.
Available distributions (default is ‘uniform’):

uniform
Uniform spatial distribution of rays within a rectangular cuboid
defined by xsize, ysize and zsize. The sizes are interpreted as
full widths.

gaussian
Gaussian spatial distribution of rays with a fwhm in each
dimension defined by xsize, ysize and zsize. The sizes are
interpreted as full-width-at-half-max (fwhm).
angular_diststring (‘isotropic’)
The type of angular distribution to use for the emitted rays.
Available distributions (default is ‘isotropic’):

isotropic
Isotropic emission (uniform spherical) emitted in a cone (circular
cross-section) with a half-angle of ‘spread’. The axis of the
emission cone is aligned along the z-axis. ‘spread’ must be a
single value (scalar or 1-element array).
isotropic_xy
Isotropic 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]
flat
Flat emission (uniform planar) emitted in a cone (circular cross-
section) with a half-angle of ‘spread’.
flat_xy
Flat 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.
gaussian
Emission with angles away from the z-axis having a Gaussian
distribution (circular cross-section). The ‘spread’ defines the
Half-Width-at-Half-Max (HWHM) of the distribution. ‘spread’ must
be a single value (scalar or 1-element array).
gaussian_flat
!! Not implemented !!
Cross-section of emission (intersection with constant-z plane) will
have a Gaussian distribution.
spreadfloat 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.

intensityint 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_poissonbool (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_diststr (‘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.

wavelengthfloat (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).

linewidthfloat (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_numberfloat (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.

temperaturefloat (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!

initialize()[source]

Initialize the object.

generate_rays()[source]
generate_origin()[source]
generate_direction(origin)[source]
make_normal()[source]
random_direction(normal)[source]
generate_wavelength(direction)[source]
random_wavelength_voigt(size=None)[source]
random_wavelength_normal(size=None)[source]
random_wavelength_cauchy(size=None)[source]
generate_weight()[source]
generate_mask()[source]
ray_filter(rays)[source]

New Private Members

class XicsrtSourceGeneric[source]
__init__(*args, **kwargs)[source]

Inherited Members

class XicsrtSourceGeneric[source]
__init__(*args, **kwargs)[source]
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]
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_diststring (‘uniform’)
The type of angular distribution to use for the emitted rays.
Available distributions (default is ‘uniform’):

uniform
Uniform spatial distribution of rays within a rectangular cuboid
defined by xsize, ysize and zsize. The sizes are interpreted as
full widths.

gaussian
Gaussian spatial distribution of rays with a fwhm in each
dimension defined by xsize, ysize and zsize. The sizes are
interpreted as full-width-at-half-max (fwhm).
angular_diststring (‘isotropic’)
The type of angular distribution to use for the emitted rays.
Available distributions (default is ‘isotropic’):

isotropic
Isotropic emission (uniform spherical) emitted in a cone (circular
cross-section) with a half-angle of ‘spread’. The axis of the
emission cone is aligned along the z-axis. ‘spread’ must be a
single value (scalar or 1-element array).
isotropic_xy
Isotropic 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]
flat
Flat emission (uniform planar) emitted in a cone (circular cross-
section) with a half-angle of ‘spread’.
flat_xy
Flat 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.
gaussian
Emission with angles away from the z-axis having a Gaussian
distribution (circular cross-section). The ‘spread’ defines the
Half-Width-at-Half-Max (HWHM) of the distribution. ‘spread’ must
be a single value (scalar or 1-element array).
gaussian_flat
!! Not implemented !!
Cross-section of emission (intersection with constant-z plane) will
have a Gaussian distribution.
spreadfloat 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.

intensityint 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_poissonbool (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_diststr (‘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.

wavelengthfloat (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).

linewidthfloat (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_numberfloat (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.

temperaturefloat (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!

generate_direction(origin)[source]
generate_mask()[source]
generate_origin()[source]
generate_rays()[source]
generate_wavelength(direction)[source]
generate_weight()[source]
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)[source]
random_wavelength_cauchy(size=None)[source]
random_wavelength_normal(size=None)[source]
random_wavelength_voigt(size=None)[source]
ray_filter(rays)[source]
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)