Normalization

Hi

How do you normalize a spectre with Igor pro

You might want to look into the Wave Arithmetic package. To learn more about it, look at the example experiment- File->Example Experiments->Analysis->Wave Arithmetic Panel Demo.

Check out the documentation for MatrixOP which includes a number of normalization options.

Depending on what you mean by normalize, this may either do what you need or give you a starting point for a GUI.

While this may seem like a lot of GUI for a trivial operation (wave/=number), I find it very useful when entering data from a lab book to be able to see and check the entries, and to be able to operate on a lot of spectra in one go.

Normalizer.ipf (5.57 KB)

In reply to by modou

"Normalize a spectrum" means different things to different people.

What kind of spectrum, and how do you want to normalize it?

For example, in vibrational spectroscopy absorbance spectra collected in transmission geometry may be normalized to unit path length, or Raman spectra may be normalized to equal area, or other kinds of spectra may be normalized to a reference value at some position, there are many possibilities and we have no way to know what it is that you want to do.

In reply to by modou

I want to normalize with the majeur element in the spectre

I guess you mean that you want to divide the spectrum by the largest value in the spectrum. You can do that with the Wave Arithmetic panel I mentioned earlier.

In reply to by tony

I use the technique LIBS atomic spectroscopy. I would like to normalize to a reference value like this divide Intensity/Intensity(element reference),Intensity(element reference) mean high intensity in the spectre

Graph3.jpg (131.6 KB)

In reply to by modou

using trace menus:

Menu "TracePopup"
    "Normalize By Wave Max", /Q, NormaliseTraceByMax("")
end

Menu "AllTracesPopup"
    "Normalize All By Maxima", /Q, NormaliseAllTracesByMax()
end

function NormaliseAllTracesByMax()
   
    string tracelist=TraceNameList("",";",1+4)
    string s_trace
    variable i=0, numTraces=ItemsInList(tracelist)
    for(i=0;i<numTraces;i+=1)
        s_trace=StringFromList(i,tracelist)
        NormaliseTraceByMax(s_trace)
    endfor
end

function NormaliseTraceByMax(s_trace, [x1, x2])
    string s_trace
    variable x1, x2
   
    if (strlen(s_trace)==0)
        GetLastUserMenuInfo
        string tracesList=S_traceName
    endif
       
    wave w=traceNameToWaveRef("",s_trace)
    if (waveexists(w)==0)
        return 0
    endif
   
    variable maxVal=nan
    if(ParamIsDefault(x1)||ParamIsDefault(x2))
        maxVal=wavemax(w)
    else
        maxVal=wavemax(w, x1, x2)
    endif
    duplicate /o w $nameofwave(w)+"_n" /wave=w_norm
    w_norm=w/maxVal
    printf "duplicate /o %s %s_n\r" nameofwave(w), nameofwave(w)
    printf "%s_n = %s/%g\r" nameofwave(w), nameofwave(w), maxVal
    ReplaceWave trace=$s_trace, $nameofwave(w)+"_n"
end

If you would like to all spectre by the maximum intensity you use these scipt

Menu "AllTracesPopup"
    "Normalize All By Maxima", /Q, NormaliseAllTracesByMax()
end

function NormaliseAllTracesByMax()
    
    string tracelist=TraceNameList("",";",1+4)
    string s_trace
    variable i=0, numTraces=ItemsInList(tracelist)
    for(i=0;i<numTraces;i+=1)
        s_trace=StringFromList(i,tracelist)
        NormaliseTraceByMax(s_trace)
    endfor
end

 

In reply to by modou

modou wrote:

If you would like to all spectre by the maximum intensity you use these scipt

Menu "AllTracesPopup"

Yes, to see the all traces popup menu you must shift-right-click on a trace in the graph window. Alternatively you can execute NormaliseAllTracesByMax() when the waves are plotted in the top graph. Or you could add another menu like this:

Menu "Macros"
    "Normalize all waves in top graph", NormaliseAllTracesByMax()
end

 

In reply to by modou

Now I use this script he works

Macro GetCursor(ctrlName) : ButtonControl
String ctrlName
variable ,i_B
variable/G nn
Make/O/N=(nn) Average_Norm

                 i_A = pcsr(A)
           Average_Norm    = Average/Average[i_A]

End

Tony thank you for your help