Gjsify LogoGjsify Logo

Hierarchy

  • Spectrum

Index

Constructors

Properties

name: string

Methods

  • add_value(data: number): void
  • free(): void
  • get_data(): number[]
  • get_end(): number
  • get_id(): string
  • get_norm(): number
  • Gets the normalization value of the spectral data. NOTE: This affects every value in the spectrum.

    Returns number

  • get_resolution(): number
  • get_size(): number
  • get_start(): number
  • get_value(idx: number): number
  • get_value_for_nm(wavelength: number): number
  • Gets the value from the spectral data for a given wavelength.

    Parameters

    • wavelength: number

      the wavelength in nm

    Returns number

  • get_value_max(): number
  • get_value_min(): number
  • get_value_raw(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

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

    Parameters

    • idx: number

      an index into the data

    Returns number

  • get_wavelength_cal(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

  • limit_max(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

  • limit_min(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

  • multiply_scalar(value: number): 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

  • normalize_max(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_to_size(size: number): Spectrum
  • set_data(value: number[]): void
  • set_end(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

  • set_id(id: string): void
  • set_norm(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

  • set_start(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

  • set_value(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

  • set_wavelength_cal(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

  • to_string(max_width: number, max_height: number): string
  • Returns a graphical representation of the spectrum.

    Parameters

    • max_width: number

      the terminal width

    • max_height: number

      the terminal height

    Returns string

  • planckian_new(temperature: number): Spectrum
  • planckian_new_full(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

  • sized_new(reserved_size: number): 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