spectrochempy.align
- align(dataset, *others, **kwargs)[source][source]
Align individual
NDDataset
along given dimensions using various methods.- Parameters:
dataset (
NDDataset
) – Dataset on which we want to align other objects.*others (
NDDataset
) – Objects to align.dim (str. Optional, default=’x’) – Along which axis to perform the alignment.
dims (list of str, optional, default=None) – Align along all dims defined in dims (if dim is also defined, then dims have higher priority).
method (enum [‘outer’, ‘inner’, ‘first’, ‘last’, ‘interpolate’], optional, default=’outer’) – Which method to use for the alignment.
If align is defined :
‘outer’ means that a union of the different coordinates is achieved (missing values are masked).
‘inner’ means that the intersection of the coordinates is used.
‘first’ means that the first dataset is used as reference.
‘last’ means that the last dataset is used as reference.
‘interpolate’ means that interpolation is performed relative to the first dataset.
interpolate_method (enum [‘linear’,’pchip’]. Optional, default=’linear’) – Method of interpolation to performs for the alignment.
interpolate_sampling (‘auto’, int or float. Optional, default=’auto’) – Values:
‘auto’ : sampling is determined automatically from the existing data.
int : if an integer values is specified, then the sampling interval for the interpolated data will be split in this number of points.
float : If a float value is provided, it determines the interval between the interpolated data.
coord (
Coord
, optional, default=None) – Coordinates to use for alignment. Ignore those corresponding to the dimensions to align.copy (bool, optional, default=True) – If False then the returned objects will share memory with the original objects, whenever it is possible : in principle only if reindexing is not necessary.
- Returns:
tuple of
NDDataset
– Same objects as datasets with dimensions aligned.- Raises:
ValueError – Issued when the dimensions given in
dim
ordims
argument are not compatibles (units, titles, etc.).