edu.stanford.rsl.konrad.physics
Class XRaySpectrum

java.lang.Object
  extended by edu.stanford.rsl.konrad.physics.XRaySpectrum

public class XRaySpectrum
extends java.lang.Object


Constructor Summary
XRaySpectrum()
           
 
Method Summary
static double[] B(double[] E, java.lang.String target, double[] T, double To)
          Ref 1 Eq 18 Proportional to x-ray photons/electron (unitless).
static double[] bremsstrahlung(double[] E, java.lang.String target, double To, double theta)
          Generates bremsstrahlung x-ray photon spectrum (photons/electron/bin) using energies in vector E
static double c(double To)
          Returns the Thomson-Whiddington constant using a rational approximation (keV2 cm2 / g).
static double[] characteristic(double[] E, java.lang.String tubeTarget, double To, double theta)
          Generates characteristic lines and adds them to the fluence spectrum.
static double[] characteristicLine(double[] E, java.lang.String tubeTarget, double To, double Ek, double char_line_f, double char_line_E, double theta)
          Return the vector spectrum phi that contains only the specified characteristic line with the appropriate split between the nearest two bins.
static double[] F(double[] E, java.lang.String target, double[] T, double To, double theta)
          Ref 1 Eq 11 Returns fraction of x-ray photons of energy E escaping target material.
static double[] generateXRaySpectrum(double[] E, double kVp, java.lang.String target, double mAs)
           
static double[] generateXRaySpectrum(double[] E, double kVp, java.lang.String target, double mAs, double mdis, double degrees, double mmpyrex, double mmoil, double mmlexan, double mmAl)
           
static double[] Integ(double[] Ei, java.lang.String target, double[] T, double To, double theta)
           
static void main(java.lang.String[] argv)
           
static double[] MSP(java.lang.String material, double[] T)
          Ref 1 Eq 16 Returns mass stopping power term for specified material and electron energy T
static double[] mu(double[] E, java.lang.String material)
          Returns the mass attenuation coef for the selected material at energy E.
static double N(java.lang.String tubeTarget, double To, double Ek, double fi, double Ei, double theta)
          Ref 1 Eq 22 Returns number of characteristic x rays per electron from target.
static double xrqpRe(double airAbsorption)
          Returns the number of quanta per R of exposure at the energies specified by vector E (keV).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XRaySpectrum

public XRaySpectrum()
Method Detail

generateXRaySpectrum

public static double[] generateXRaySpectrum(double[] E,
                                            double kVp,
                                            java.lang.String target,
                                            double mAs)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

generateXRaySpectrum

public static double[] generateXRaySpectrum(double[] E,
                                            double kVp,
                                            java.lang.String target,
                                            double mAs,
                                            double mdis,
                                            double degrees,
                                            double mmpyrex,
                                            double mmoil,
                                            double mmlexan,
                                            double mmAl)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

mu

public static double[] mu(double[] E,
                          java.lang.String material)
                   throws java.lang.Exception
Returns the mass attenuation coef for the selected material at energy E. The coefs are fit to Howerton data by N. Cardinal, and are thought to be significantly better than the coefs used by Tucker. Except for Re, which gives nonsense results, so use Tucker for Re

Parameters:
E - the array of energies
material - the material ("W", "Re", "Mo", "Al", "oil", "lexan", "pyrex", or "air")
Returns:
the array of absorption coefficients.
Throws:
java.lang.Exception - may occur

characteristic

public static double[] characteristic(double[] E,
                                      java.lang.String tubeTarget,
                                      double To,
                                      double theta)
                               throws java.lang.Exception
Generates characteristic lines and adds them to the fluence spectrum. The characteristic peaks are added to the nearest two bins, weighted by the position of the peak between the bins

Parameters:
E - the array of energies
tubeTarget - the target material
To - Peak kilo volage
theta - angle
Returns:
the array of characteristics.
Throws:
java.lang.Exception - may occur

characteristicLine

public static double[] characteristicLine(double[] E,
                                          java.lang.String tubeTarget,
                                          double To,
                                          double Ek,
                                          double char_line_f,
                                          double char_line_E,
                                          double theta)
                                   throws java.lang.Exception
Return the vector spectrum phi that contains only the specified characteristic line with the appropriate split between the nearest two bins.

Parameters:
E - the energies
tubeTarget - the material
To - Peak kilo volage
Ek - K-edge
char_line_f - the flurescent yield
char_line_E - the energy of the line
theta - the angle
Returns:
the array which contains the characteristic line.
Throws:
java.lang.Exception - may happen

N

public static double N(java.lang.String tubeTarget,
                       double To,
                       double Ek,
                       double fi,
                       double Ei,
                       double theta)
                throws java.lang.Exception
Ref 1 Eq 22 Returns number of characteristic x rays per electron from target. The coefficients Ak and nk are empirical values to fit the spectra exposures to experimental values (see Tucker et al). Micheal Moreau showed that there is an analytic solution to the integral in this equation. His solution is used

Parameters:
tubeTarget - 'W' or 'Mo'
To -
Ek - K absorption energy (keV)
fi - fractional emission of char line
Ei - energy of char line
theta -
Returns:
number of x-rays
Throws:
java.lang.Exception

c

public static double c(double To)
Returns the Thomson-Whiddington constant using a rational approximation (keV2 cm2 / g). This routine fits the tabulated values in Birch and Marshall's paper to within +/- 0.0025 x 1E6 and minimizes the rms error subject to this restriction. Maximum error less than +/- 0.4%

Parameters:
To - incident electron energy (kVp)
Returns:
Thomson-Whiddington constant

bremsstrahlung

public static double[] bremsstrahlung(double[] E,
                                      java.lang.String target,
                                      double To,
                                      double theta)
                               throws java.lang.Exception
Generates bremsstrahlung x-ray photon spectrum (photons/electron/bin) using energies in vector E

Parameters:
E - the energy
target - the target
To - incident electron energy (kVp)
theta - the angle
Returns:
bremsstrahlung
Throws:
java.lang.Exception

Integ

public static double[] Integ(double[] Ei,
                             java.lang.String target,
                             double[] T,
                             double To,
                             double theta)
                      throws java.lang.Exception
Throws:
java.lang.Exception

B

public static double[] B(double[] E,
                         java.lang.String target,
                         double[] T,
                         double To)
                  throws java.lang.Exception
Ref 1 Eq 18 Proportional to x-ray photons/electron (unitless). The coefficients A0 and A1 are empirical values to fit the spectra exposures to experimental values (see Tucker et al). The values of B_W and B_Mo are spectral shape parameters, and are not changed from Tucker's empirically derived values

Parameters:
E -
target -
T -
To -
Returns:
B
Throws:
java.lang.Exception

MSP

public static double[] MSP(java.lang.String material,
                           double[] T)
                    throws java.lang.Exception
Ref 1 Eq 16 Returns mass stopping power term for specified material and electron energy T

Parameters:
material -
T -
Returns:
MSP
Throws:
java.lang.Exception

F

public static double[] F(double[] E,
                         java.lang.String target,
                         double[] T,
                         double To,
                         double theta)
                  throws java.lang.Exception
Ref 1 Eq 11 Returns fraction of x-ray photons of energy E escaping target material. Note: mu() returns mass attenuation data, so we can drop the density term in Tucker's paper

Parameters:
E -
target -
T -
To -
theta -
Returns:
F
Throws:
java.lang.Exception

xrqpRe

public static double xrqpRe(double airAbsorption)
                     throws java.lang.Exception
Returns the number of quanta per R of exposure at the energies specified by vector E (keV).

Parameters:
airAbsorption -
Returns:
number of quanta
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] argv)