Differences

This shows you the differences between two versions of the page.

Link to this comparison view

documentation:language_reference:objects:spectra:functions:element [2016/09/25 23:34] – created Maurits W. Haverkortdocumentation:language_reference:objects:spectra:functions:element [2016/10/10 09:41] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Element ======
  
 +###
 +Takes an element, or a list of elements form the spectrum object and returns a new spectrum object only containing these.
 +###
 +
 +===== Example =====
 +
 +###
 +The spectra object created in the [[documentation:language_reference:objects:spectra:start|definitions file]] contains 3 elements (The spectra created with operator //T1//, //T2//, or //T3//). This example extracts the second spectrum and stores it in variable //G1// and extracts the first and third element and stores it in variable //G2//.
 +###
 +
 +==== Input ====
 +<code Quanty Example.Quanty>
 +dofile("definitions.Quanty")
 +
 +G1 = Spectra.Element(G,2)
 +G2 = Spectra.Element(G,{1,3})
 +
 +print("The orginal output contains ",G.N,"spectra")
 +
 +print("G1 contains ",G1.N,"spectra")
 +print("G2 contains ",G2.N,"spectra")
 +</code>
 +
 +==== Result ====
 +<file Quanty_Output>
 +The orginal output contains 3 spectra
 +G1 contains 1 spectra
 +G2 contains 2 spectra
 +</file>
 +
 +===== Available functions =====
 +{{indexmenu>.#1}}
Print/export