Data.stitch

Data.stitch(other, xcol=None, ycol=None, overlap=None, min_overlap=0.0, mode='All', func=None, p0=None)

Apply a scaling to this data set to make it stich to another dataset.

Parameters:
  • other (DataFile) – Another data set that is used as the base to stitch this one on to

  • xcol,ycol (index or None) – The x and y data columns. If left as None then the current setas attribute is used.

Keyword Arguments:
  • overlap (tuple of (lower,higher) or None) – The band of x values that are used in both data sets to match, if left as None, thenthe common overlap of the x data is used.

  • min_overlap (float) – If you know that overlap must be bigger than a certain amount, the bounds between the two data sets needs to be adjusted. In this case min_overlap shifts the boundary of the overlap on this DataFile.

  • mode (str) – Unless func is specified, controls which parameters are actually variable, defaults to all of them.

  • func (callable) – a stitching function that transforms \((x,y)\rightarrow(x',y')\). Default is to use functions defined by mode

  • p0 (iterable) – if func is not None then p0 should be the starting values for the stitching function parameters

Returns:

(Stoner.Data) – A copy of the current AnalysisMixin with the x and y data columns adjusted to stitch

To stitch the data together, the x and y data in the current data file is transforms so that \(x'=x+A\) and \(y'=By+C\) where \(A,B,C\) are constants and \((x',y')\) are close matches to the \((x,y)\) data in other. The algorithm assumes that the overlap region contains equal numbers of \((x,y)\) points mode controls whether A,B, and C are fixed or adjustable

  • “All” - all three parameters adjustable

  • “Scale y, shift x” - C is fixed at 0.0

  • “Scale and shift y” A is fixed at 0.0

  • “Scale y” - only B is adjustable

  • “Shift y” - Only c is adjsutable

  • “Shift x” - Only A is adjustable

  • “Shift both” - B is fixed at 1.0

See also

User Guide section Stitching Datasets together

Example