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

Class Spectra

source code

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

__init__()
(Constructor)

source code 

Creates a new Spectra object containing zero spectra.

Since: 2.7

Returns:
A newly created spectra.

new_alike()

source code 

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.

Since: 2.7

Returns:
A newly created Spectra object.

data_changed()

source code 

Emits signal "data_changed" on a spectra object.

Since: 2.7

get_si_unit_xy()

source code 

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

Since: 2.7

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

set_si_unit_xy(si_unit)

source code 

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)

UNIMPLEMENTED_itoxy(i, x, y)

source code 

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)

source code 

Finds the index of the spectrum closest to the location specified by the coordinates x and y.

Since: 2.7

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.

setpos(i, x, y)

source code 

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)

get_n_spectra()

source code 

Gets the number of spectra in a spectra object.

Since: 2.7

Returns:
The number of spectra.

get_spectrum(i)

source code 

Gets a dataline that contains the spectrum at index i.

Since: 2.7

Parameters:
  • i - Index of a spectrum (int)
Returns:
A DataLine containing the spectrum, owned by spectra.

set_spectrum(i, new_spectrum)

source code 

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)

source code 

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)

get_spectrum_selected(i)

source code 

Gets the selected state of a spectrum in a spectra object.

Since: 2.7

Parameters:
  • i - Index of a spectrum. (int)
Returns:
True if spectrum is selected.

UNIMPLEMENTED_find_nearest(x, y, n, ilist)

source code 

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*)

add_spectrum(new_spectrum, x, y)

source code 

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)

get_title()

source code 

Gets the title of spectra.

Since: 2.7

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

set_title(title)

source code 

Sets the title of the spectra collection.

Since: 2.7

Parameters:
  • title - The new title string. (string)

clear()

source code 

Removes all spectra from the collection.

Since: 2.7