@@ -9,19 +9,19 @@ import { xyCheck } from './xyCheck.ts';
99
1010export interface XYEquallySpacedOptions {
1111 /**
12- * from
12+ * Start of the output x range.
1313 * @default x[0]
1414 */
1515 from ?: number ;
1616
1717 /**
18- * to
18+ * End of the output x range.
1919 * @default x[x.length-1]
2020 */
2121 to ?: number ;
2222
2323 /**
24- * variant
24+ * `slot` averages y values within each bin; `smooth` uses the trapezoidal integral divided by the step size.
2525 * @default 'smooth'
2626 */
2727 variant ?: 'slot' | 'smooth' ;
@@ -46,25 +46,11 @@ export interface XYEquallySpacedOptions {
4646}
4747
4848/**
49- * Function that returns a Number array of equally spaced numberOfPoints
50- * containing a representation of intensities of the spectra arguments x
51- * and y.
52- *
53- * The options parameter contains an object in the following form:
54- * from: starting point
55- * to: last point
56- * numberOfPoints: number of points between from and to
57- * variant: "slot" or "smooth" - smooth is the default option
58- *
59- * The slot variant consist that each point in an array is calculated
60- * averaging the existing points between the slot that belongs to the current
61- * value. The smooth variant is the same but takes the integral of the range
62- * of the slot and divide by the step size between two points in an array.
63- *
64- * If exclusions zone are present, zones are ignored !
65- * @param data - object containing 2 properties x and y
49+ * Resample a spectrum to equally spaced x points.
50+ * When `exclusions` are provided they take precedence and `zones` is ignored.
51+ * @param data - object containing x and y arrays
6652 * @param options - options
67- * @returns new object with x / y array with the equally spaced data.
53+ * @returns resampled spectrum with equally spaced x values
6854 */
6955
7056export function xyEquallySpaced (
0 commit comments