Differences

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

Link to this comparison view

documentation:language_reference:objects:spectra:functions:broaden [2016/09/27 16:36] – created Maurits W. Haverkortdocumentation:language_reference:objects:spectra:functions:broaden [2016/10/10 09:41] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Broaden ======
  
 +###
 +Broadens a spectrum by a Gaussian and Lorenzian. Energy dependent broadening is allowed. The method //[[documentation:language_reference:objects:spectra:methods:broaden|Broaden]]// allows one to broaden a spectrum object without making a copy of the object.
 +###
 +
 +===== Example =====
 +
 +###
 +description text
 +###
 +
 +==== Input ====
 +<code Quanty Example.Quanty>
 +dofile("definitions.Quanty")
 +
 +-- Broaden with a Gaussian of FWHM 0.2 and a Lorenzian with variable
 +-- width, the interval 0 to 5.25 has FWHM=0.2. The interval 5.75,20 has
 +-- FWHM=0.75. The interval 5.25 to 5.75 linearly increases from 0.2 to 0.75
 + 
 +GBroaden = Spectra.Broaden(G, 0.2, {{0.0,0.2}, {5.25,0.2}, {5.75,0.75}, {20.0,0.75}})
 +G.Print({{"file","Spectra.dat"}})
 +GBroaden.Print({{"file","Spectra.Broaden.dat"}})
 +gnuplotScript = gnuplotHead .. [[
 +set output "Spectra.Broaden.ps"
 +plot "Spectra.dat"  using 1:(-$3  ) title 'T1' with lines ls  1,\
 +     "Spectra.Broaden.dat"  using 1:(-$3*2) title 'T1 Broaden' with lines ls 2
 +]]
 +file = io.open("Spectra.Broaden.gnuplot", "w")
 +file:write(gnuplotScript)
 +file:close()
 +os.execute("gnuplot Spectra.Broaden.gnuplot")
 +os.execute("convert -density 1024 Spectra.Broaden.ps -resize 1024 Spectra.Broaden.png")
 +</code>
 +
 +==== Result ====
 +###
 +The resulting picture is:
 +###
 +{{:documentation:language_reference:objects:spectra:functions:spectra.broaden.png?nolink |}}
 +
 +===== Available functions =====
 +{{indexmenu>.#1}}
Print/export