X-rays Module

Methods for X-rays

@author: Antony Vamvakeros

nDTomo.methods.xrays.AngtoKeV(wavel)[source]

Convert wavelength in Angstroms to photon energy in keV.

Parameters:

wavel (float or ndarray) – Wavelength in Angstroms.

Returns:

Photon energy in keV.

Return type:

float or ndarray

nDTomo.methods.xrays.KeVtoAng(E)[source]

Convert photon energy in keV to wavelength in Angstroms.

Parameters:

E (float or ndarray) – Photon energy in keV.

Returns:

Wavelength in Angstroms.

Return type:

float or ndarray

nDTomo.methods.xrays.q2tth(q, E)[source]

Convert momentum transfer q (in Å⁻¹) to 2θ (in degrees).

Parameters:
  • q (float or ndarray) – Momentum transfer in Å⁻¹.

  • E (float) – Photon energy in keV.

Returns:

Two-theta angle in degrees.

Return type:

float or ndarray

nDTomo.methods.xrays.simulate_synchrotron_intensity(num_points, drop_ratio=0.75, num_topups=1)[source]

Simulate synchrotron beam intensity with linear decay and periodic top-ups.

Parameters:
  • num_points (int) – Total number of points in the output array.

  • drop_ratio (float) – Intensity level just before each top-up (e.g., 0.75).

  • num_topups (int) – Number of top-up events (i.e., decay cycles) in the vector.

Returns:

intensity – Simulated beam intensity values over time.

Return type:

np.ndarray

nDTomo.methods.xrays.tth2q(tth, E)[source]

Convert 2θ (in degrees) to momentum transfer q (in Å⁻¹).

Parameters:
  • tth (float or ndarray) – Two-theta angle in degrees.

  • E (float) – Photon energy in keV.

Returns:

q in Å⁻¹.

Return type:

float or ndarray