import type { DoubleArray } from 'cheminfo-types'; import type { GetData1DOptions } from './GetData1DOptions.ts'; import type { GaussianParameter } from './gaussian/Gaussian.ts'; import type { GeneralizedLorentzianParameter } from './generalizedLorentzian/GeneralizedLorentzian.ts'; import type { LorentzianParameter } from './lorentzian/Lorentzian.ts'; import type { LorentzianDispersiveParameter } from './lorentzianDispersive/LorentzianDispersive.ts'; import type { PseudoVoigtParameter } from './pseudoVoigt/PseudoVoigt.ts'; import type { PseudoVoigtTCHParameter } from './pseudoVoigtTCH/PseudoVoigtTCH.ts'; import type { Shape1D, Shape1DKind } from './shape_1d.ts'; import type { SplitGaussianParameter } from './splitGaussian/SplitGaussian.ts'; /** * Every parameter a 1D shape can expose: the combination of the parameters of * all the shapes. Indexing a tuple of them, rather than writing a union, * because shapes that share a parameter would make duplicate union * constituents. */ export type Shape1DParameter = [ GaussianParameter, GeneralizedLorentzianParameter, LorentzianParameter, LorentzianDispersiveParameter, PseudoVoigtParameter, PseudoVoigtTCHParameter, SplitGaussianParameter ][number]; export interface Shape1DDerivative { /** Value of `fct(x)`. */ fct: number; /** Partial derivative of `fct` with respect to `x`, evaluated at `x`. */ dx: number; /** * Partial derivatives of `fct` with respect to each shape parameter, * in the same order as `getParameters()`. */ parameters: number[]; } export interface Shape1DClass { /** * Kind of shape, so that an instance is also a valid `Shape1D` descriptor. */ readonly kind: Shape1DKind; fwhm: number; /** * Calculate the height depending of fwhm and area. */ calculateHeight(area?: number): number; /** * Return a parameterized function of a gaussian shape (see README for equation). * @returns - the y value of gaussian with the current parameters. */ fct(x: number): number; /** * Compute the value of Full Width at Half Maximum (FWHM) from the width between the inflection points. * for more information check the [mathworld page](https://mathworld.wolfram.com/GaussianFunction.html) * @returns fwhm */ widthToFWHM(width: number): number; /** * Compute the value of width between the inflection points from Full Width at Half Maximum (FWHM). * for more information check the [mathworld page](https://mathworld.wolfram.com/GaussianFunction.html) * @param fwhm - Full Width at Half Maximum. * @returns width */ fwhmToWidth(fwhm?: number): number; /** * Calculate the area of a specific shape. * @returns returns the area of the specific shape and parameters. */ getArea(height?: number): number; /** * Calculate the number of times FWHM allows to reach a specific area coverage. * @param [area=0.9999] - Expected area to be covered. */ getFactor(area?: number): number; /** * Calculate intensity array of a gaussian shape. * @returns Intensity values. */ getData(options?: GetData1DOptions): DoubleArray; /** * Returns an array of the different parameters characterizing the shape */ getParameters(): Shape1DParameter[]; /** * Descriptor of this shape, so `JSON.stringify` round-trips through `getShape1D`. */ toJSON(): Shape1D; /** * Analytical partial derivatives of `fct` at `x`, with respect to `x` and to * each shape parameter (in the same order as `getParameters()`). Every shape * provides a closed-form Jacobian, so consumers (e.g. curve fitting) can use * it directly instead of numerical differentiation. * @param x - position at which to evaluate the derivatives. */ derivative(x: number): Shape1DDerivative; } //# sourceMappingURL=Shape1DClass.d.ts.map