Spectrum
Object Hierarchy:
Description:
[ CCode ( copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "cd_spectrum_get_type ()" ) ]
[ Compact ]
public class Spectrum
Content:
Creation methods:
- public Spectrum ()
Allocates a spectrum.
- public Spectrum.planckian_new (double temperature)
Allocates a Planckian spectrum at a specific temperature.
- public Spectrum.planckian_new_full (double temperature, double start, double end, double resolution)
Allocates a Planckian spectrum at a specific temperature.
- public Spectrum.sized_new (uint reserved_size)
Allocates a spectrum with a preallocated size.
Methods:
- public void add_value (double data)
Adds a value in nm to the spectrum.
- public Spectrum dup ()
- public void free ()
Deallocates a color spectrum.
- public unowned Array<double> get_data ()
Gets the spectral data.
- public double get_end ()
Gets the end value of the spectral data.
- public unowned string get_id ()
Gets the spectral data.
- public double get_norm ()
Gets the normalization value of the spectral data.
- public double get_resolution ()
Gets the divisor of the spectra, for instance a .
- public uint get_size ()
Gets the size of the spectrum data.
- public double get_start ()
Gets the start value of the spectral data.
- public double get_value (uint idx)
Gets the spectrum data at a specified index.
- public double get_value_for_nm (double wavelength)
Gets the value from the spectral data for a given wavelength.
- public double get_value_max ()
Gets the largest normalised value in the spectrum.
- public double get_value_min ()
Gets the smallest normalised value in the spectrum.
- public double get_value_raw (uint idx)
Gets the spectrum data at a specified index, without any normalization
applied.
- public double get_wavelength (uint idx)
Gets the wavelenth that corresponds to the specified index.
- public void get_wavelength_cal (double c1, double c2, double c3)
Gets the calibration coefficients used to map pixel indexes to
wavelengths.
- public void limit_max (double value)
Ensures no values in the spectrum fall above a set limit.
- public void limit_min (double value)
Ensures no values in the spectrum fall below a set limit.
- public Spectrum multiply (Spectrum s2, double resolution)
Multiplies two spectra together.
- public Spectrum multiply_scalar (double value)
Multiplies a spectra with a scalar value.
- public void normalize (double wavelength, double value)
Normalizes a spectrum to a specific value at a specific wavelength.
- public void normalize_max (double value)
Normalizes a spectrum to a specific value at its maximum value.
- public Spectrum resample (double start, double end, double resolution)
Resample a new spectrum with linear index to wavelength coefficients.
- public Spectrum resample_to_size (uint size)
Resample a new spectrum with the desired number of points.
- public void set_data (Array<double> value)
Sets the spectrum data.
- public void set_end (double end)
Set the end value of the spectal data in nm.
- public void set_id (string id)
Sets a spectrum id.
- public void set_norm (double norm)
Set the normalization value of the spectrum.
- public void set_start (double start)
Set the start value of the spectal data in nm.
- public void set_value (uint idx, double data)
Overwrites the spectrum data at a specified index.
- public void set_wavelength_cal (double c1, double c2, double c3)
Sets the calibration coefficients used to map pixel indexes to
wavelengths.
- public Spectrum subtract (Spectrum s2, double resolution)
Subtracts one spectral plot from another.
- public string to_string (uint max_width, uint max_height)
Returns a graphical representation of the spectrum.