#pragma rtGlobals=1 // Use modern global access method.
// simple macros for unit conversion 1st Aug 2011 by T.Hayashi
// A Macro for Data analysis implemented on 1st Aug 2011 by T. Hayashi
Menu "Raman"
Submenu "Calc"
"WL2WN"
"WN2WL"
end
Submenu "Analysis"
"Draw"
"Add"
"Dif"
"BGsub"
end
End
function WL2WN()
variable laser=488,wl=500
Prompt laser, "Laser(nm)"
Prompt wl, "wavelength(nm)"
DoPrompt "Wave length to Wave number",laser ,wl
Print wl, "nm corresponds to Raman shift of",(1e7/laser)-(1e7/wl)," cm-1","(LASER:", laser,"nm)"
End
function WN2WL()
variable laser=488,wn=1400
Prompt laser, "Laser(nm)"
Prompt wn, "wavenumber(cm-1)"
DoPrompt "Wave length to Wave number",laser ,wn
Print " Raman shift of",wn,"cm-1 appears at",1/((1e7/laser)-wn)*1e7," nm","(LASER:", laser,"nm)"
End
Function Draw()
LoadWave/g/n/a=data
spec1()
// Use "spec1" as a test script
end
Function Add()
LoadWave/g/n/a=data
spec2()
// Use "spec2" as a test script to append new data to the existing grapha
end
Function Dif()
LoadWave/g/n/a=data, "signal + BG"
LoadWave/g/n/a=bg, "BG"
spec3()
End
Function BGsub()
LoadWave/g/n/a=data, "signal + BG"
LoadWave/g/n/a=bg, "BG"
spec4()
End
//
// spec1 draws an initial graph
Function spec1()
string name
variable laser=488
Prompt name, "Data name"
Prompt laser, "Excitation Laser"
DoPrompt "Enter the data name",name,laser
//
string int="_int",cm="_cm"
Duplicate data0,wn_temp; duplicate data1,int_temp
wn_temp=(1e7/laser)-(1e7/wn_temp)
Duplicate wn_temp,$(name+cm); duplicate int_temp,$(name+int)
killwaves data0,data1,wn_temp,int_temp
AppendToTable $(name+int),$(name+cm)
//Draw Graph
display $(name+int) vs $(name+cm)
Label bottom "Wavenumber (cm-1)"
Label left "Intensity (total counts)"
Legend/C/N=text0/F=0/A=MC
ModifyGraph width=400,height=300
End
Function spec2()
//
string name
variable laser=488
Prompt name, "Data name"
Prompt laser, "Excitation Laser"
DoPrompt "Enter the data name",name,laser
//
string int="_int",cm="_cm"
Duplicate data0,wn_temp; duplicate data1,int_temp
wn_temp=(1e7/laser)-(1e7/wn_temp)
Duplicate wn_temp,$(name+cm); duplicate int_temp,$(name+int)
killwaves data0,data1,wn_temp,int_temp
AppendToTable $(name+int),$(name+cm)
AppendToGraph $(name+int) vs $(name+cm)
Legend/C/N=text0/F=0/A=MC
End
Function spec3()
//
string name
variable laser=488
Prompt name, "Data name"
Prompt laser, "Excitation Laser"
DoPrompt "Enter the data name",name,laser
//
string int="_int",cm="_cm"
Duplicate data0,wn_temp; duplicate data1,int_temp
Duplicate bg0,wnbg_temp; duplicate bg1,intbg_temp
wn_temp=(1e7/laser)-(1e7/wn_temp)
wnbg_temp=(1e7/laser)-(1e7/wnbg_temp)
int_temp=int_temp-intbg_temp
Duplicate wn_temp,$(name+cm); duplicate int_temp,$(name+int)
killwaves data0,data1,bg0,bg1,wn_temp,int_temp,wnbg_temp,intbg_temp
//
display $(name+int) vs $(name+cm)
Label bottom "Wavenumber (cm-1)"
Label left "difference in spectra (counts)]"
Legend/C/N=text0/F=0/A=MC
ModifyGraph width=400,height=300
End
Function spec4()
//
string name
variable laser=488
Prompt name, "Data name"
Prompt laser, "Excitation Laser"
DoPrompt "Enter the data name",name,laser
//
string int="_int",cm="_cm"
Duplicate data0,wn_temp; duplicate data1,int_temp
Duplicate bg0,wnbg_temp; duplicate bg1,intbg_temp
wn_temp=(1e7/laser)-(1e7/wn_temp)
wnbg_temp=(1e7/laser)-(1e7/wnbg_temp)
int_temp=int_temp-intbg_temp
Duplicate wn_temp,$(name+cm); duplicate int_temp,$(name+int)
killwaves data0,data1,bg0,bg1,wn_temp,int_temp,wnbg_temp,intbg_temp
//
display $(name+int) vs $(name+cm)
Label bottom "Wavenumber (cm-1)"
Label left "Intensity (BG subtracted ) counts"
Legend/C/N=text0/F=0/A=MC
ModifyGraph width=400,height=300
End