.. algorithm:: .. summary:: .. relatedalgorithms:: .. properties:: Description ----------- Calculates the minimum and maximum momentum transfer (Q) for a SANS workspace. The input workspace must have instrument defined and data in units of wavelength [Angstroms], or the wavelength must be present in the sample logs. Elastic scattering is assumed. Masked detectors and monitors do not enter the calculation. The calculated values (in inverse Angstroms) will be set in sample logs as **qmin** and **qmax** respectively. Optionally, list of detector components can be given, in which case minimum and maximum momentum transfers will be calculated also for each component. They will be set in sample logs with the same names as the components preceded by prefixes **qmin_** and **qmax_** respectively. Usage ----- **Example - CalculateDynamicRange** .. testcode:: CalculateDynamicRangeExample ws = CreateSampleWorkspace(XUnit='Wavelength', NumBanks=1, PixelSpacing=0.1, XMin=1, XMax=5, BinWidth=0.4) MoveInstrumentComponent(Workspace=ws, RelativePosition=True, ComponentName="bank1", Y=-0.5, X=-0.5) shapeXML = \ """ """ MaskDetectorsInShape(ws, ShapeXML=shapeXML) CalculateDynamicRange(Workspace=ws) print("QMin = %.5f" % ws.getRun().getLogData("qmin").value) print("QMax = %.5f" % ws.getRun().getLogData("qmax").value) Output: .. testoutput:: CalculateDynamicRangeExample QMin = 0.03701 QMax = 0.73500 .. categories:: .. sourcelink::