% function scaled_data = Rel_Scat(data, Ne, C, l, T, flux, time, ADUperXray, Spec_to_Phos) % % Converts theoretical I=data(:,2) versus Q=data(:,1) plot into % experimental units of I (ADU's per pixel) versus q. % % Returns scaled_data(:,1) = q % scaled_data(:,2) = ADU counts per pixel at that q-range. % % Inputs % data(:,j) ==> Scattering Data. % data(:,1) = q (reciprocal Angstroms) % data(:,2) = I (Intensity in normalized. units). % I(1,2) = I(q=0)=1; % Ne --> Number of Excess Electrons per scatterer. % C --> Concentration of scatters per unit volume (Molarity). % l --> Path length of X-rays through sample (m). % T --> Transmission Coefficient of X-rays through sample (0<= T <=1). % flux --> X-rays per second incident on sample % time --> Length of exposure in seconds. % ADUperXray --> ADU counts per Xray at the detector % Spec_to_Phos --> Distance from detector to sample in pixels % X_Lambda --> Wavelength of X-rays in Angstrom % % See p56, LB10 GEST for details of calculation. function scaled_data = Rel_Scat(data, Ne, C, l, T, flux, time, ADUperXray, Spec_to_Phos) rc = 2.817e-15 ; % Classical electron radius in metres NtoP = 6.022e26; % Molecules per cubic metre for 1M solution. scaled_data(:,1) = data(:,1); sfactor = Ne^2 * rc^2 * C * NtoP * l * T * flux * time * ADUperXray/ Spec_to_Phos^2; scaled_data(:,2) = sfactor * data(:,2);