Binning

Scalar Binning

Scalar or azimuthal binning produces a one dimensional intensity profile \(I(Q)\) from \(I(x,y,\lambda)\).

{
  "1DQbinType": "scalar",
  "QbinType": "linear",
  "numQBins": 200,
  "Qmin": 0.003,
  "Qmax": 0.005,
}

Wedge Binning

In Small-Angle Neutron Scattering (SANS), wedge binning is a data analysis technique used to enhance the signal-to-noise ratio by collecting data over specific angular sectors, or “wedges,” of the detector. This method is particularly useful when the scattering pattern exhibits anisotropy due to preferred directions in the sample structure.

After obtaining intensity \(I(q_x, q_y)\) in the detector plane, we can rebin the intensity in “polar” coordinates \(I(q, \psi)\), where \(q = \sqrt{q_x^2 + q_y^2}\) is the magnitude of the scattering vector and \(\psi = \arctan(q_y/q_x)\) is the azimuthal angle. The intensity is then binned into \(q\)-bins of constant width.

polar-coordinate binning

Most typical is to integrate \(I(q, \psi)\) over the azimuthal angle \(\psi\) between limits \(\psi_m\) and \(\psi_M\) defining a wedge, yielding the \(I(q)\) representative of the feature captured in the wedge region.

intensity profile in the wedge

The feature is achiral so the intensity profile is symmetric in the \(X\)-axis, \(I(-q_x, q_y) = I(q_x, q_y)\) or \(I(q, \pi - \psi) = I(q, \psi)\). The intensity profile is then binned within the region defined by the two symmetric wedges:

intensity profile for symmetric wedges

drtsans provides a function to perform wedge binning on the detector plane. User can specify the the azimuthal limits for one or more wedges. For instance, the two wedges \((-30, 30)\) and \((75, 105)\) can be specified as:

{
  "WedgeMinAngles": [-30, 75],
  "WedgeMaxAngles": [ 30, 105]
}

drtsans assumes achiral features so the wedges symmetric to these two wedges are included in the binning.

User defined wedges

Wedge JSON Settings

Wedge reduction is enabled by selecting wedge binning for the 1D output:

{
  "1DQbinType": "wedge"
}

The wedge angles can be provided manually with WedgeMinAngles and WedgeMaxAngles, or they can be found automatically from an azimuthal intensity profile, \(I(\phi)\). Manual wedge definitions take precedence when WedgeMinAngles and WedgeMaxAngles are non-empty. Automatic wedge finding is used when 1DQbinType is "wedge" and the manual wedge angle lists are not supplied by the reduction input. Use null for unset manual wedge angles with BIOSANS and GPSANS. Use empty lists, [], with EQSANS.

Setting

Used for

Meaning

1DQbinType

Manual and automatic

Selects the 1D binning mode. Use "wedge" to output one \(I(q)\) profile per wedge group.

QbinType

Manual and automatic

Selects linear or logarithmic \(q\) bins for the wedge \(I(q)\) output.

numQBins or instrument-specific num*QBins

Manual and automatic

Number of \(q\) bins when QbinType is "linear". For BIOSANS, use the detector-specific settings such as numMainQBins and numWingQBins.

LogQBinsPerDecade or instrument-specific LogQBinsPerDecade*

Manual and automatic

Number of \(q\) bins per decade when QbinType is "log".

Qmin / Qmax or detector-specific Qmin* / Qmax*

Manual and automatic

Optional \(q\) range for the final wedge \(I(q)\) output. BIOSANS uses detector-specific ranges such as QminMain and QmaxWing.

WedgeMinAngles

Manual

List of lower azimuthal-angle bounds in degrees. Values are in the range [-90, 270).

WedgeMaxAngles

Manual

List of upper azimuthal-angle bounds in degrees. This list must have the same length as WedgeMinAngles.

autoWedgeQmin

Automatic

Minimum \(q\) value used to build the \(I(\phi)\) profiles for wedge finding.

autoWedgeQmax

Automatic

Maximum \(q\) value used to build the \(I(\phi)\) profiles for wedge finding.

autoWedgeQdelta

Automatic

Width of each \(q\) ring used during automatic wedge finding.

autoWedgeAzimuthalDelta

Automatic

Azimuthal bin width, in degrees, used to build each \(I(\phi)\) profile.

autoWedgePeakWidth

Automatic

Fraction of the peak full-width-half-maximum (FWHM) used to define the signal wedge.

autoWedgeBackgroundWidth

Automatic

Fraction of the peak FWHM used to define the background wedge.

autoWedgeSignalToNoiseMin

Automatic

Minimum signal-to-noise ratio required for the azimuthal profile to be considered fittable.

autoWedgePhiMin / autoWedgePhiMax

Automatic

Optional azimuthal search range, in degrees. This is useful when part of the detector should be excluded from the search.

autoSymmetricWedges

Automatic

If true, find the wedge only inside the requested azimuthal search range, then add its symmetric counterpart.

autoWedgePeakSearchWindowSizeFactor

Automatic

Optional peak-search window scale used by GPSANS automatic wedge finding.

wedge1Qmin* / wedge1Qmax* and wedge2Qmin* / wedge2Qmax*

BIOSANS

Detector-specific \(q\) ranges for BIOSANS wedge 1 and wedge 2 outputs. Suffixes include Main, Wing, and Midrange.

wedge1overlapStitchQmin / wedge1overlapStitchQmax and wedge2overlapStitchQmin / wedge2overlapStitchQmax

BIOSANS

Wedge-specific overlap ranges used when stitching BIOSANS detector panels.

Wedge Reduction Examples

A manual wedge reduction specifies the wedge angles directly. The following example produces two wedge \(I(q)\) profiles, one for \((-30, 30)\) degrees and one for \((75, 105)\) degrees. Because drtsans assumes achiral features for manual wedges, the corresponding symmetric wedges are included in each profile.

{
  "configuration": {
    "1DQbinType": "wedge",
    "QbinType": "log",
    "LogQBinsPerDecade": 25,
    "WedgeMinAngles": [-30, 75],
    "WedgeMaxAngles": [30, 105]
  }
}

An automatic wedge reduction leaves the manual wedge angle lists unset and provides the \(q\) range and binning used to build the azimuthal profiles. The reduction finds the wedge angles from the peaks in \(I(\phi)\) and stores the resulting wedge selections in the reduction output. For BIOSANS and GPSANS, use null for the unset manual wedge angles:

{
  "configuration": {
    "1DQbinType": "wedge",
    "QbinType": "log",
    "LogQBinsPerDecade": 25,
    "WedgeMinAngles": null,
    "WedgeMaxAngles": null,
    "autoWedgeQmin": 0.003,
    "autoWedgeQmax": 0.04,
    "autoWedgeQdelta": 0.01,
    "autoWedgeAzimuthalDelta": 1.0,
    "autoWedgePeakWidth": 0.25,
    "autoWedgeBackgroundWidth": 1.5,
    "autoWedgeSignalToNoiseMin": 2.0
  }
}

For EQSANS, use empty manual wedge angle lists instead:

{
  "configuration": {
    "1DQbinType": "wedge",
    "QbinType": "log",
    "LogQBinsPerDecade": 25,
    "WedgeMinAngles": [],
    "WedgeMaxAngles": [],
    "autoWedgeQmin": 0.003,
    "autoWedgeQmax": 0.04,
    "autoWedgeQdelta": 0.01,
    "autoWedgeAzimuthalDelta": 1.0,
    "autoWedgePeakWidth": 0.25,
    "autoWedgeBackgroundWidth": 1.5,
    "autoWedgeSignalToNoiseMin": 2.0
  }
}

For BIOSANS, wedge reduction commonly also sets detector-specific \(q\) ranges and overlap stitching ranges for each wedge:

{
  "configuration": {
    "1DQbinType": "wedge",
    "QbinType": "log",
    "numMainQBins": 33,
    "numWingQBins": 33,
    "numMidrangeQBins": 33,
    "LogQBinsPerDecadeMain": null,
    "LogQBinsPerDecadeWing": null,
    "LogQBinsPerDecadeMidrange": null,
    "WedgeMinAngles": [-30, 60],
    "WedgeMaxAngles": [30, 120],
    "wedge1QminMain": 0.02,
    "wedge1QmaxMain": 0.09,
    "wedge1QminWing": 0.08,
    "wedge1QmaxWing": 0.09,
    "wedge1QminMidrange": 0.04,
    "wedge1QmaxMidrange": 0.05,
    "wedge1overlapStitchQmin": 0.0825,
    "wedge1overlapStitchQmax": 0.0875,
    "wedge2QminMain": 0.02,
    "wedge2QmaxMain": 0.125,
    "wedge2QminWing": 0.06,
    "wedge2QmaxWing": 1.0,
    "wedge2QminMidrange": 0.05,
    "wedge2QmaxMidrange": 0.7,
    "wedge2overlapStitchQmin": 0.075,
    "wedge2overlapStitchQmax": 0.095
  }
}

Automatic Finding of the Wedge

If User wants drtsans to automatically find the azimuthal limits for wedge binning, there are options to specify. For instance, we want the resulting \(I(q)\) from \(q_{min}=0.03 A^{-1}\) to \(q_{max}=0.12 A^{-1}\) in bins of width \(\delta q=0.01 A^{-1}\). The automatic finding is restricted to one wedge along the \(X\)-axis, along with its symmetric counterpart. drtsans will find the azimuthal limits for the wedge.

{
  "autoWedgeQmin": 0.03,
  "autoWedgeQmax": 0.12,
  "autoWedgeQdelta": 0.01,
}
automatic finding the wedge

User may define a single azimuthal range for the automatic finding of the wedge. User can provide negative values for the azimuthal range, for instance, \((-90, -30)\), with the understanding that the range is interpreted as \((270, 330)\). Once the autoWedgePhiMin and autoWedgePhiMax range is provided, the search for the wedge begins at the midpoint of the range, and is initially constrained to half the range around this midpoint.

For instance, in the BIOSANS instrument the area in the main detector defined by the azimuthal range \((-90, 90)\) is partially occluded by the Wing detector, because the Wing detector is positioned closer to the sample than the main detector. User can request finding the wedge in the azimuthal range \((90, 270)\) free from occlusion, and then automatically include the symmetric wedge in the binning. The range \((-90, 90)\) is effectively masked during the wedge search.

{
  "autoWedgeQmin": 0.03,
  "autoWedgeQmax": 0.12,
  "autoWedgeQdelta": 0.01,
  "autoWedgePhiMin": 90,
  "autoWedgePhiMax": 270,
  "autoSymmetricWedges": true
}
automatic finding the wedge

Other additional options for the automatic wedge finding:

  • autoWedgeAzimuthalDelta: binning in azimuthal angle when generating the \(I(\phi)\) profile.

  • autoWedgePeakWidth: percent of the full-width-half-max (FWHM) of the peak in the \(I(\phi)\) profile representing a wedge, used to define the confidence limits of the wedge.

  • autoWedgeBackgroundWidth: percent of the full-width-half-max (FWHM) of the peak in the \(I(\phi)\) profile representing a wedge, used to define the confidence limits of the background signal for the wedge.

For instance, for real data collected at the BIOSANS instrument,

{
  "autoWedgeQmin": 0.0,
  "autoWedgeQmax": 0.02,
  "autoWedgeQdelta": 0.001,
  "autoWedgeAzimuthalDelta": 1.0,
  "autoWedgePeakWidth": 0.25,
  "autoWedgeBackgroundWidth": 1.5
}

We obtain two wedges (\(w_1\), \(w_2\)) as well as two azimuthal ranges (\(b_1\), \(b_2\)) interpreted as background signal for the wedges.

wedges for a real BIOSANS example

Annular Binning

Annular binning produces a one dimensional intensity profile, \(I(\phi)\), which gives intensity as a function of the angle around the beam center, \(\phi\), over a limited range of scalar \(Q\). Annular binning uses linear spacing in \(\phi\) with a default bin size of 1 degree.

{
  "1DQbinType": "annular",
  "AnnularAngleBin": 1.0,
  "Qmin": 0.003,
  "Qmax": 0.005,
}