Differences

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

Link to this comparison view

documentation:language_reference:objects:spectra:functions:shift [2016/09/25 23:50] – created Maurits W. Haverkortdocumentation:language_reference:objects:spectra:functions:shift [2016/10/10 09:41] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Shift ======
  
 +###
 +Shifts a spectrum //G// by a constant, i.e. //G<sub>new</sub>($\omega$)=G($\omega$-shift)//
 +###
 +
 +===== Example =====
 +
 +###
 +Take the spectra defined in [[documentation:language_reference:objects:spectra:start|definitions.Quanty]] and shift it by 5.3 eV.
 +###
 +
 +==== Input ====
 +<code Quanty Example.Quanty>
 +dofile("definitions.Quanty")
 +
 +GShift = Spectra.Shift(G, 5.3)
 +G.Print({{"file","Spectra.dat"}})
 +GShift.Print({{"file","Spectra.Shift.dat"}})
 +
 +gnuplotScript = gnuplotHead .. [[
 +set output "Spectra.Shift.ps"
 +plot "Spectra.dat"  using 1:(-$3  ) title 'T1' with lines ls  1,\
 +     "Spectra.Shift.dat"  using 1:(-$3) title 'T1 shifted' with lines ls 2
 +]]
 +
 +file = io.open("Spectra.Shift.gnuplot", "{{ :documentation:language_reference:objects:spectra:functions:spectra.shift.png?nolink |}}w")
 +file:write(gnuplotScript)
 +file:close()
 +
 +os.execute("gnuplot Spectra.Shift.gnuplot")
 +os.execute("convert -density 1024 Spectra.Shift.ps -resize 1024 Spectra.Shift.png")
 +</code>
 +
 +==== Result ====
 +###
 +The resulting picture is:
 +###
 +{{:documentation:language_reference:objects:spectra:functions:spectra.shift.png?nolink |}}
 +
 +===== Available functions =====
 +{{indexmenu>.#1}}
Print/export