Gjsify LogoGjsify Logo

Hierarchy

  • Spectrum

Index

Constructors

Properties

name: string

Methods

  • addValue(data: number): void
  • Adds a value in nm to the spectrum.

    Parameters

    • data: number

    Returns void

  • free(): void
  • getData(): number[]
  • Gets the spectral data. NOTE: This is not normalized

    Returns number[]

  • getEnd(): number
  • getId(): string
  • getNorm(): number
  • Gets the normalization value of the spectral data. NOTE: This affects every value in the spectrum.

    Returns number

  • getResolution(): number
  • getSize(): number
  • getStart(): number
  • getValue(idx: number): number
  • Gets the spectrum data at a specified index.

    Parameters

    • idx: number

      an index into the data

    Returns number

  • getValueForNm(wavelength: number): number
  • Gets the value from the spectral data for a given wavelength.

    Parameters

    • wavelength: number

      the wavelength in nm

    Returns number

  • getValueMax(): number
  • getValueMin(): number
  • getValueRaw(idx: number): number
  • Gets the spectrum data at a specified index, without any normalization applied. Most people should use cd_spectrum_get_value() instead.

    Parameters

    • idx: number

      an index into the data

    Returns number

  • getWavelength(idx: number): number
  • Gets the wavelenth that corresponds to the specified index.

    Parameters

    • idx: number

      an index into the data

    Returns number

  • getWavelengthCal(c1: number, c2: number, c3: number): void
  • Gets the calibration coefficients used to map pixel indexes to wavelengths.

    Parameters

    • c1: number

      the 1st coefficient

    • c2: number

      the 2nd coefficient

    • c3: number

      the 3rd coefficient

    Returns void

  • limitMax(value: number): void
  • Ensures no values in the spectrum fall above a set limit. If they are found, set them to value.

    Parameters

    • value: number

      the threshold value to limit the spectrum

    Returns void

  • limitMin(value: number): void
  • Ensures no values in the spectrum fall below a set limit. If they are found, set them to value.

    Parameters

    • value: number

      the threshold value to limit the spectrum

    Returns void

  • Multiplies two spectra together.

    Parameters

    • s2: Spectrum

      a #CdSpectrum instance, possibly an absorption spectrum.

    • resolution: number

      the step size in nm

    Returns Spectrum

  • normalize(wavelength: number, value: number): void
  • Normalizes a spectrum to a specific value at a specific wavelength.

    Parameters

    • wavelength: number

      the wavelength in nm

    • value: number

      the value to normalize to

    Returns void

  • normalizeMax(value: number): void
  • Normalizes a spectrum to a specific value at its maximum value.

    Parameters

    • value: number

      the value to normalize to

    Returns void

  • resample(start: number, end: number, resolution: number): Spectrum
  • Resample a new spectrum with linear index to wavelength coefficients.

    Parameters

    • start: number

      the new spectrum start

    • end: number

      the new spectrum end

    • resolution: number

      the resolution to use when resampling

    Returns Spectrum

  • Resample a new spectrum with the desired number of points.

    Parameters

    • size: number

      the output spectrum size

    Returns Spectrum

  • setData(value: number[]): void
  • Sets the spectrum data.

    Parameters

    • value: number[]

      component value

    Returns void

  • setEnd(end: number): void
  • Set the end value of the spectal data in nm.

    If there is already spectral data, the wavelength calibration will also be set automatically.

    Parameters

    • end: number

      the end value of the spectral data

    Returns void

  • setId(id: string): void
  • setNorm(norm: number): void
  • Set the normalization value of the spectrum. NOTE: This affects every value in the spectrum.

    Parameters

    • norm: number

      the end value of the spectral data

    Returns void

  • setStart(start: number): void
  • Set the start value of the spectal data in nm.

    Parameters

    • start: number

      the start value of the spectral data

    Returns void

  • setValue(idx: number, data: number): void
  • Overwrites the spectrum data at a specified index.

    Parameters

    • idx: number

      an index into the data

    • data: number

      a data value

    Returns void

  • setWavelengthCal(c1: number, c2: number, c3: number): void
  • Sets the calibration coefficients used to map pixel indexes to wavelengths.

    This function will set the 'end' wavelength automatically, potentially overwriting the value set by cd_spectrum_set_end().

    Parameters

    • c1: number

      the 1st coefficient

    • c2: number

      the 2nd coefficient

    • c3: number

      the 3rd coefficient

    Returns void

  • Subtracts one spectral plot from another. If the spectra have the same start, end and the same number of data points they are not resampled.

    Parameters

    • s2: Spectrum

      a #CdSpectrum instance, e.g. a dark calibration

    • resolution: number

      the resolution to use when resampling

    Returns Spectrum

  • toString(maxWidth: number, maxHeight: number): string
  • Returns a graphical representation of the spectrum.

    Parameters

    • maxWidth: number

      the terminal width

    • maxHeight: number

      the terminal height

    Returns string

  • planckianNew(temperature: number): Spectrum
  • Allocates a Planckian spectrum at a specific temperature.

    Parameters

    • temperature: number

      the temperature in Kelvin

    Returns Spectrum

  • planckianNewFull(temperature: number, start: number, end: number, resolution: number): Spectrum
  • Allocates a Planckian spectrum at a specific temperature.

    Parameters

    • temperature: number

      the temperature in Kelvin

    • start: number

      the new spectrum start

    • end: number

      the new spectrum end

    • resolution: number

      the resolution to use when resampling

    Returns Spectrum

  • sizedNew(reservedSize: number): Spectrum
  • Allocates a spectrum with a preallocated size.

    Parameters

    • reservedSize: number

      the future size of the spectrum

    Returns Spectrum

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method