Module gwy :: Class Spectra
[show private | hide private]
[frames | no frames]

Class Spectra


Spectra The Spectra struct contains private data only and should be accessed using the functions below.

Since: 2.7
Method Summary
  __init__()
Creates a new Spectra object containing zero spectra.
  add_spectrum(new_spectrum, x, y)
Appends a new_spectrum to the spectra collection with a position of x, y.
  clear()
Removes all spectra from the collection.
  data_changed()
Emits signal "data_changed" on a spectra object.
  get_n_spectra()
Gets the number of spectra in a spectra object.
  get_si_unit_xy()
Gets SI unit used for the location co-ordinates of spectra.
  get_spectrum(i)
Gets a dataline that contains the spectrum at index i.
  get_spectrum_selected(i)
Gets the selected state of a spectrum in a spectra object.
  get_title()
Gets the title of spectra.
  new_alike()
Creates a new Spectra object similar to an existing one, but containing zero spectra.
  remove_spectrum(i)
  set_si_unit_xy(si_unit)
Sets the SI unit corresponding to the location co-ordinates of the spectra object.
  set_spectrum(i, new_spectrum)
Replaces the ith spectrum in the spectra object with a the supplied spectrum, new_spectrum.
  set_spectrum_selected(i, selected)
Sets selected state of a spectrum in a spectra object.
  set_title(title)
Sets the title of the spectra collection.
  setpos(i, x, y)
Sets the location coordinates of a spectrum.
  UNIMPLEMENTED_find_nearest(x, y, n, ilist)
Gets the list of the indices to spectra ordered by their distance from a given point.
  UNIMPLEMENTED_itoxy(i, x, y)
Gets the coordinates of one spectrum.
  xytoi(x, y)
Finds the index of the spectrum closest to the location specified by the coordinates x and y.

Method Details

__init__()
(Constructor)

Creates a new Spectra object containing zero spectra.
Returns:

A newly created spectra.

Since: 2.7

add_spectrum(new_spectrum, x, y)

Appends a new_spectrum to the spectra collection with a position of x, y. Spectra.add takes a refference to the supplied spectrum.

Since: 2.7
Parameters:
new_spectrum - A DataLine containing the spectrum to append. (DataLine)
x - The physical x coordinate of the location of the spectrum. (float)
y - The physical y coordinate of the location of the spectrum. (float)

clear()

Removes all spectra from the collection.

Since: 2.7

data_changed()

Emits signal "data_changed" on a spectra object.

Since: 2.7

get_n_spectra()

Gets the number of spectra in a spectra object.
Returns:

The number of spectra.

Since: 2.7

get_si_unit_xy()

Gets SI unit used for the location co-ordinates of spectra.
Returns:

SI unit corresponding to the the location co-ordinates of spectra object. Its reference count is not incremented.

Since: 2.7

get_spectrum(i)

Gets a dataline that contains the spectrum at index i.
Parameters:
i - Index of a spectrum (int)
Returns:

A DataLine containing the spectrum, owned by spectra.

Since: 2.7

get_spectrum_selected(i)

Gets the selected state of a spectrum in a spectra object.
Parameters:
i - Index of a spectrum. (int)
Returns:

True if spectrum is selected.

Since: 2.7

get_title()

Gets the title of spectra.
Returns:

A pointer to the title string (owned by the spectra object).

Since: 2.7

new_alike()

Creates a new Spectra object similar to an existing one, but containing zero spectra.

Use Spectra.duplicate() if you want to copy a spectra object including the spectra in it.
Returns:

A newly created Spectra object.

Since: 2.7

set_si_unit_xy(si_unit)

Sets the SI unit corresponding to the location co-ordinates of the spectra object.

It does not assume a reference on si_unit, instead it adds its own reference.

Since: 2.7
Parameters:
si_unit - SI unit to be set. (SIUnit)

set_spectrum(i, new_spectrum)

Replaces the ith spectrum in the spectra object with a the supplied spectrum, new_spectrum. It takes its own reference to the New_Spectrum dataline.

Since: 2.7
Parameters:
i - Index of a spectrum to replace (int)
new_spectrum - A DataLine Object containing the new spectrum. (DataLine)

set_spectrum_selected(i, selected)

Sets selected state of a spectrum in a spectra object.

Since: 2.7
Parameters:
i - Index of a spectrum. (int)
selected - True to make the spectrum selected, False to deselect it. (bool)

set_title(title)

Sets the title of the spectra collection.

Since: 2.7
Parameters:
title - The new title string. (string)

setpos(i, x, y)

Sets the location coordinates of a spectrum.

Since: 2.7
Parameters:
i - The index of a spectrum. (int)
x - The new x coordinate of the location of the spectrum. (float)
y - The new y coordinate of the location of the spectrum. (float)

UNIMPLEMENTED_find_nearest(x, y, n, ilist)

Gets the list of the indices to spectra ordered by their distance from a given point.

List positions

Since: 2.7
Parameters:
x - Point x-coordinate. (float)
y - Point y-coordinate. (float)
n - Number of indices to find. Array ilist must have at least this number of items. (int)
ilist - Array to place the spectra indices to. They will be sorted by the distance from (x, y). Positions after the number of spectra in spectra will be left untouched. (guint*)

UNIMPLEMENTED_itoxy(i, x, y)

Gets the coordinates of one spectrum.

Since: 2.7
Parameters:
i - Index of a spectrum. (int)
x - Location to store the physical x coordinate of the spectrum. (gdouble*)
y - Location to store the physical x coordinate of the spectrum. (gdouble*)

xytoi(x, y)

Finds the index of the spectrum closest to the location specified by the coordinates x and y.
Parameters:
x - The x coordinate of the location of the spectrum. (float)
y - The y coordinate of the location of the spectrum. (float)
Returns:

The index of the nearest spectrum. If there are no curves in the spectra, -1 is returned.

Since: 2.7

Generated by Epydoc 2.1 on Tue Dec 30 04:01:42 2008 http://epydoc.sf.net