hvl_est vers1.0
03-13-06 MJF

	Computes the weighted average attenuation
	coefficient of a material using the air energy absorption
	coefficient as the weighting factor.
	Then returns the result as an estimated half value layer
	and the actual ratio of exposure with and without a filter
	equal in thickness to the estimated HVL.
	Optionally computes the exposure ratio for a specified HVL
	thickness so that the estimate can be fine tuned for spectral
	hardening.

example:

	hvl_est << EOF
	mat_file 
	HVL
	labelflag
	EOF

standard output:

	The following is typical of the output returned:

	# Half Value Layer (HVL) estimage, cm 
	#    Material: al_1100                                 
	#    Spect_gen: 74  12.000  1  150.00
	#    Attenuation History:
	#        5
	#       oil                    3.0000E-01
	#       glass_pyrex            1.4800E-01
	#       al_1100                2.5000E-01
	#       copper                 5.0000E-02
	#       al_1100                2.0000E-01
	# HVL estimate:
	#   value 1 = HVL in cm
	#   value 2 = Transmission thru HVL
	#   value 3 = Exposure input to filter in mR
	1.030436      0.5196546       6.814401

	Within the comment lines the material key parameters
	defining the spectrum including the attenuation history.

directories/links:
        _materials: path to directory of material files
        _database:  path to database directory

arguments:

	mat_file:  file name for a specific material descriptor
	HVL:       Thickness of an HVL filter,
	             if 0.0 this procedure estimates the thickness,
	             if not the exposure ratio is computed.
	labelflag:      0 to suppress comment lines, 1 otherwise

	Note, this procedure does not modifiy spectra.tmp.
	The exposure input to the HVL filter is also provided
	for reference.

associated files:

	read:  spectra.tmp (see spect.tmp.doc for format)

	Note: the user must be sure to set up the desired spectra
 	      in spectra.tmp before calling hvl_est. In general this
	      will involve application of appropriate filtration for
	      the conditions under which hvl_eff is relevant.

method:	
	The effective attenuation coefficient is defined as that
	coefficient which correctly predicts the reduction of
	the response of an ionization chamber when recording the x-ray
	beam transmitted through an additional "thin" amount of material.
	The exposure is computed using integrals the same as are  used
	in the mR procedure.;

		E_o  = K * INTEGRAL{PHI(E) * MUair(E) *dE}                    (1)

		E_dx = K * INTEGRAL{PHI(E) * MUair(E) * EXP(-dx*mu(E)) * dE}  (2)

	where PHI(E) is the x-ray beam flux, MUair(E) is the air energy
	absorption coeffiecient (cm2/gm), mu(E) is the linear attenuation
	coefficient of the HVL material and E is the x-ray energy.

	When HVL is entered as a non-zero value, the ratio of E_dx/E_o
	is computed with dx = HVL.

	For small values of dx*mu(E), the value of E_dx
	can be approximated as;

		E_dx ~= INTEGRAL{PHI(E) * MUair(E) * (1-dx*mu(E)) * dE}   (3)

 		     ~= E_o - dx*INTEGRAL{PHI(E) * MUair(E) * mu(E) * dE} (4)

	The effective attenuation coefficient is obtained by defining
	the relative reduction in signal as an exponential function
	in the form of Beer's law;

		E_dx/E_o = exp(-mu_eff * dx)                               (5)

		     ~= 1 - dx*mu_eff                                      (6)

	If we devide equation 4 by E_o and compare it to equation 6,
	it is clear that mu_eff is defined as the average of the
	material attenuation coefficient, mu(E), weighted by 
	the x-ray spectrum, and the air energy absorption coefficient;

			  INTEGRAL{PHI(E) * MUair(E) * mu(E) * dE}
		mu_eff =  -----------------------------------------         (7)
			       INTEGRAL{PHI(E) * MUair(E) *dE}

	For this program, this integration is evaluated for the current
	content of spectra.tmp. The values for mu(E) are obtained 
	as is described for the attenuation routines, atten and atten_coeff.  
	The air energy absorption values used are the same as those described 
	in the mR routine.

	When HVL is entered as 0.0, mu_eff is compute and an estimate of the
	HVL is made and returned,
                                 HVL = .693/mu_eff
	Because of spectral hardening this estimate is often slightly less
	than the true value as would be measured experimentally.
	By interating with an an adjusted HVL value and observing the returned
	transmission ratio, a more accurate estimate of the HVL can be made.
