Differences
This shows you the differences between two versions of the page.
| documentation:language_reference:objects:spectra:functions:sum [2016/09/25 23:59] – created Maurits W. Haverkort | documentation:language_reference:objects:spectra:functions:sum [2025/11/20 04:20] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Sum ====== | ||
| + | ### | ||
| + | Sums the different elements of a spectrum object multiplied by the numbers given as a list in the input. Several lists are possible. Can be used to calculate the temperature dependence of a set of spectra. | ||
| + | ### | ||
| + | |||
| + | ===== Example ===== | ||
| + | |||
| + | ### | ||
| + | Create the sum of the spectra created with operator //T2// and //T3// and calculate a weighted sum over the spectra created with operator //T1//, //T2// and //T3//. | ||
| + | ### | ||
| + | |||
| + | ==== Input ==== | ||
| + | <code Quanty Example.Quanty> | ||
| + | dofile(" | ||
| + | |||
| + | G2plus3 = Spectra.Sum(G, | ||
| + | |||
| + | |||
| + | G.Print({{" | ||
| + | G2plus3.Print({{" | ||
| + | |||
| + | gnuplotScript = gnuplotHead .. [[ | ||
| + | set output " | ||
| + | plot " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ]] | ||
| + | file = io.open(" | ||
| + | file: | ||
| + | file: | ||
| + | |||
| + | os.execute(" | ||
| + | os.execute(" | ||
| + | </ | ||
| + | |||
| + | ==== Result ==== | ||
| + | ### | ||
| + | The resulting picture is: | ||
| + | ### | ||
| + | {{: | ||
| + | |||
| + | ===== Available functions ===== | ||
| + | {{indexmenu> | ||