Table of Contents

Shift

Shifts a spectrum G by a constant, i.e. Gnew($\omega$)=G($\omega$-shift)

Example

Take the spectra defined in definitions.Quanty and shift it by 5.3 eV.

Input

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

Result

The resulting picture is:

Available functions