potential term for solution-phase scattering experiments, including SAXS and SANS One normally creates SolnScatPot objects using .create_XRayScatPot or .create_SANSPot. constructor: SolnScatPot(instanceName, sel , qValues , groupMap , formFactors , iFormFactors, globDefs , experiment , simulation ) where: instanceName user-specified identifier. sel .AtomSel which specifies atoms to use in the scattering calculation (frequently all heavy atoms). qValues a sequence of values of scattering vector at which to perform refinement. q=4 PI sin(theta) / lambda, where 2 theta is the scattering angle, and lambda is the wavelength of the incident beam. These should usually be specified at uniform values of q. groupMap a sequence of group names to use in the scattering calc. formFactors a sequence of maps of group name to effective form factor, one for each value of scattering vector- in the same order iFormFactors a sequence of maps of atom index to effective form factor, one for each value of scattering vector- in the same order. Generally, individual atoms need not be specified- but are rather specified by group name. This is for exceptions, and will override any group entry. globDefs a sequence of glob definitions. Each definition is a sequence of tuples (w,index), where w is a weight and index is an atom index. experiment solvent-corrected experimental scattering intensity values- one for each value of q. simulation optional .Simulation object. members: The following parameters can be set [defaults in square brackets] scale - scale factor (force constant) [1] weights - sequence of weight factors for rms, energy calculation. See below. Default is a value of 1 for all. calcType - specifies how I(q) is to be calculated. Valid values are "n2" - use the exact, but slow Debye formula. "n" - numerically integrate over surface of constant q, using theta, phi values determined by angleType "uniform" - a faster version of the n algorithm which can be used if q values are equally spaced, starting at 0. "multipole" - Use the spherical harmonic expansion of Svergun, Barberato and Koch, J. Appl. Cryt. 28, 768 (1995) Note: at this time it is not possible to refine using the calcType, as the derivatives are not yet coded. numAngles - for calcTypes n and uniform, the number of (theta,phi) pairs to use in the evaluation of I(q). angleType - specifies how (theta,phi) angle pairs are chosen over the surface of a sphere. Choices are: "random" - choose randomly- not recommended. "fibonacci" - method based on Fibonacci numbers. D. Svergun, Acta Cryst. A50, 391 (1994). "spiral" - spiral algorithm from E.B. Saff and A.B.J. Kuijlaars, Distributing Many Points on a Sphere, The Mathematical Intelligencer, 19(1), Winter (1997). This is the preferred algorithm. lMax - for calcType multipole, the maximum value of l to use in the spherical harmonic expansion. cmpType - should be "plain" or "log." This controls whether the logarithm is taken before the energy is evaluated. See below. [Default: plain] globs - sequence of glob definitions - see description above. normalizeIndex - if greater than or equal to zero, specifies which value of q at which to consider Icalc and Iobs to be equal. If the value is -2, the normalization is taken as the average of the Icalc or Iobs values weighted by weights. If the value of normalizeIndex lies outside the above values, no normalization is performed. [default: -2] useGlobs - whether or not to use globs in the scattering calculation. verbose - if true, produce more detailed output [False] the above quantities may be retrieved using the member function form quantity(), while they are set using the form setQuantity(value). QValues - a plain member containing values of (x,y,z) on a r=1 sphere used for numerical integration of I(q). methods: calcEnergy() - calc energy, returns the energy value. calcEnergyAndDerivs(derivs) - calc energy, derivs, returns the energy value. calcGlobCorrect(calcType) - calculate the globic correction factor. calcType specifies the calculation used to calculate the correction. It defaults to the current calcType. globCorrect() - return the current globic correction factor. rms() - return the rms of calcedShift - effShift info() - string with current info about the state of this instance simulation() - return the associated .Simulation. qValues() - return the values of q (as set in the constructor). expt() - return the observed values of I(q) (as set in the constructor). calcd() - return the calculated values of I(q). formFactors() - return the formFactor map set in the constructor. iFormFactors() - return the atom-indec formFactor map. exptScale() Iobs(qn), for n=normalizeIndex, if normalizeIndex>-1, 1 otherwise. calcScale() Icalc(qn), for n=normalizeIndex, if normalizeIndex>-1, 1 otherwise. I_contrib(memberIndex) - the scatter intensity from the specified ensemble member structure, or the local member if the index is omitted. selection() - return the atom selection specified in the constructor. Energy is calculated as scale * rms^2 where rms^2 = sum_i w_i (Icalc_i - Iobs_i)^2 / (Nq), in which Nq is the total number of values of q at which Iobs is specified. Given a set of atomic coordinates the scattering intensity is calculated from the following expression: I(q) = <| A(Q) |^2>_q where <>_q denotes average over solid angle at constant amplitude of the scattering vector. The scattering amplitude A(Q) consists of a sum of contributions from each atom (usually only heavy atoms are included) A(Q) = sum_j f_j(q) exp(i dot(Q,r_j)) where f_j(q) is the total effective scattering amplitude of atom j (including excluded solvent effects), and r_j is atom j's position. The integral over solid angle can be carried out analytically, resulting in the Debye formula calcType=n2: I(q) = sum_j1 sum_j2 f_j1(q) f_j2(q) sinc(q |r_j1-r_j2|) where sinc(x) = sin(x) / x. This expression is quite expensive for biological systems due to the double sum. One alternative is to express A(Q) as an expansion in terms of spherical harmonic functions (calcType=multipole), and approximate I(q) by truncating the expansion. This is works well (is efficient) for small scattering angles - like those used in most SAXS experiments. For larger angles, the expansion fails spectacularly. One can also evaluate the integral over solid angle by simple grid integration (calcTypes=n, uniform). This works well for all moderate values of q. When calculated in the context of an .EnsembleSimulation the scattering intensity becomes: I(q) = sum_n W_n I_n(q) where the sum is over all members of an ensemble, w_n is the weight for ensemble member n, and I_n(q) is the scattering intensity from ensemble member n, calculated as above. One should note that the approximate methods of calculating I(q) introduce a rotational dependence: the grid on which the scattering amplitude is calculated is fixed in space. This rotational dependence implies that the potential energy term is not constant upon overall rotation. The amount of the rotational dependence decreases with increased numAngles. A future enhancement may have the grid rotate along with the rest of the system.