temperature.py module documentation

Utilities for effective temperature-related calculations with energy distributions.

temperature.eff_temperature(xx, yy, x_range=None, method='fit')

Find an effective temperature of data points, possibly in a given range.

Parameters:
  • xx – x-coordinates of the points.
  • yy – y-coordinates of the points.
  • x_range – A 2-tuple defining an interval in x to filter the points.
  • method

    The method used to calculate the temperature. Available methods include:

    • ”fit”: Best linear fit.
Returns:

The value of the effective temperature.

Return type:

float

temperature.eff_temperature_list(xx, yy, x_window, method='fit')

Find points describing the effective temperature function using a certain window.

Parameters:
  • xx – x-coordinates of the points.
  • yy – y-coordinates of the points.
  • x_window (float or Callable) – Half-size of the window used in each fit. It can be a Callable taking the window mean point and returning the half-size.
  • method

    The method used to calculate the temperature. Available methods include:

    • ”fit”: Best linear fit.

Returns:

temperature.f_mb_findlay(theta, e, alpha=1.5, b=1.0)

MB-electron produced bremsstrahlung distribution, according to a linear model of the scaled bremsstrahlung scaled cross-section (Findlay’s).

Parameters:
  • theta (float) – Temperature of the MB.
  • e (float) – Energy where the effective temperature is measured.
  • alpha (float) – Shape parameter of the distribution (half of the degrees of freedom).
  • b (float) – Parameter of the cross-section model. Should be in [0, 1].
Returns:

The value of the probability density function in e.

Return type:

float

temperature.f_mb_kramers(theta, e, alpha=1.5)

MB-electron produced bremsstrahlung distribution, according to to the Kramers’ thick target model.

Parameters:
  • theta (float) – Temperature of the MB.
  • e (float) – Energy where the effective temperature is measured.
  • alpha (float) – Shape parameter of the distribution (half of the degrees of freedom).
Returns:

The value of the probability density function in e.

Return type:

float

temperature.f_mb_nist(theta, e, alpha=1.5, Z=74, epsrel=0.001)

MB-electron produced bremsstrahlung distribution, according to the NIST tabulated cross-section.

Parameters:
  • theta (float) – Temperature of the MB.
  • e (float) – Energy where the effective temperature is measured.
  • alpha (float) – Shape parameter of the distribution (half of the degrees of freedom).
  • Z (int) – Atomic number of the medium.
  • epsrel (float) – Relative tolerance of the integral.
Returns:

The value of the probability density function in e.

Return type:

float

temperature.filter_points(xx, yy, x_min, x_max)

Select points where x_min <= x <= x_max.

Parameters:
  • xx (list of float) – X-coordinates.
  • yy (list of float) – Y coordinates.
  • x_min (float) – Minimum x-coordinate.
  • x_max (float) – Maximum x-coordinate accepted.
Returns:

The lists of coordinates of the points selected.

Return type:

(list of float, list of float)

temperature.fmesh_mb_xpecgen(theta, alpha=1.5, Z=74)

MB-electron produced bremsstrahlung distribution, according to the xpecgen model.

Parameters:
  • theta (float) – Temperature of the MB.
  • alpha (float) – Shape parameter of the distribution (half of the degrees of freedom).
  • Z (int) – Atomic number of the medium.
Returns:

x coordinates and y coordinates of points defining the density function.

Return type:

(list of float, list of float)

temperature.get_cs

Returns a function representing the bremsstrahlung cross_section.

Returns:A function representing cross_section(e_g,e_e) in mb/keV, with e_g and e_e in keV.
temperature.theta_bimb_findlay(theta1, theta2, a1, e, alpha=1.5, b=1.0)

Bi-MB-electron produced bremsstrahlung effective temperature, according to a linear model of the scaled bremsstrahlung scaled cross-section (Findlay’s).

Parameters:
  • theta1 (float) – Temperature of the first component of the MB.
  • theta2 (float) – Temperature of the second component of the MB.
  • a1 (float) – Weight of the first component in the convex combination.
  • e (float) – Energy where the effective temperature is measured.
  • alpha (float) – Shape parameter of the distributions (half of the degrees of freedom).
  • b (float) – Parameter of the cross-section model. Should be in [0, 1].
Returns:

The effective temperature in e.

Return type:

float

temperature.theta_mb(theta, e, alpha=1.5)

Effective temperature in a Maxwell-Boltzmann (Gamma) distribution

Parameters:
  • theta (float) – Temperature of the MB.
  • e (float) – Energy where the effective temperature is measured.
  • alpha – Shape parameter of the distribution (half of the degrees of freedom).
Returns:

The effective temperature.

Return type:

float

temperature.theta_mb_findlay(theta, e, alpha=1.5, b=1.0)

MB-electron produced bremsstrahlung effective temperature, according to a linear model of the scaled bremsstrahlung scaled cross-section (Findlay’s).

Parameters:
  • theta (float) – Temperature of the MB.
  • e (float) – Energy where the effective temperature is measured.
  • alpha (float) – Shape parameter of the distribution (half of the degrees of freedom).
  • b (float) – Parameter of the cross-section model. Should be in [0, 1].
Returns:

The effective temperature.

Return type:

float

temperature.theta_mb_findlay_asympt(theta, e, alpha=1.5, b=1.0)

MB-electron produced bremsstrahlung effective temperature , according to a linear model of the scaled bremsstrahlung scaled cross-section (Findlay’s) in the the asymptotic approximation (1st order).

Parameters:
  • theta (float) – Temperature of the MB.
  • e (float) – Energy where the effective temperature is measured.
  • alpha (float) – Shape parameter of the distribution (half of the degrees of freedom).
  • b (float) – Parameter of the cross-section model. Should be in [0, 1].
Returns:

The effective temperature.

Return type:

float

Note

The asymptotic expansion is only useful in the asymptotic limit. That is far beyond ten times kT.

temperature.theta_mb_kramers(theta, e, alpha=1.5)

MB-electron produced bremsstrahlung effective temperature, according to to the Kramers’ thick target model.

Parameters:
  • theta (float) – Temperature of the MB.
  • e (float) – Energy where the effective temperature is measured.
  • alpha (float) – Shape parameter of the distribution (half of the degrees of freedom).
Returns:

The value of the effective temperature in e.

Return type:

float

Indices and tables