====== Shift ======
###
If //G// is a spectra object then //G.Shift($\omega_0$)// shifts the energy of the spectrum i.e. //Gnew($\omega$) = G($\omega$-$\omega_0$)//. //G.Shift// is similar to the function [[documentation:language_reference:objects:spectra:functions:shift|Spectra.Shift]] with the difference that it does not make a copy of the spectra object.
###
===== Example =====
###
Take the spectrum defined in the file [[documentation:language_reference:objects:spectra:start|definitions.Quanty]] and shift it by 5.3 eV.
###
==== Input ====
dofile("definitions.Quanty")
G.Print({{"file","Spectra.dat"}})
G.Shift(5.3)
G.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", "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:
{{:documentation:language_reference:objects:spectra:methods:spectra.shift.png?nolink |}}
===== Available functions =====
{{indexmenu>../functions/#1}}
===== Available methods =====
{{indexmenu>.#1}}