subtraction background

Dear,
I would like subtraction background of my spectre. I have seen this script but I don't understand
Function cherche_lignebase()
wave intensity
variable/G npt
variable i
variable indic_ligne_base=0
variable ligne_base= intensity[500]
//variable ligne_base=0
for(i=50;i // print i,intensity[i]
if (intensity[i] < ligne_base)
indic_ligne_base=i
ligne_base=min(ligne_base,intensity[i])
endif
endfor
print "Indice et ligne de base :", indic_ligne_base,ligne_base
intensity = intensity-ligne_base
for(i=0;i if (intensity[i] < 0)
intensity[i]=0
endif
endfor
end
what's the different indic_base_line and ligne_base
Can I explain me this program
Start by doing the Igor guided tour. Choose Help->Getting Started to do the tour.

Among other things, the tour shows you how to use the online help.
When you show Igor code on this site you must put the tag  at the start and at the end. Otherwise the HTML parser will attempt to interpret "<" and ">" as parts of HTML tags.
modou wrote:
Dear,
I would like subtraction background of my spectre. I have seen this script but I don't understand
Function cherche_lignebase()
wave intensity
variable/G npt
variable i
variable indic_ligne_base=0
variable ligne_base= intensity[500]
//variable ligne_base=0
for(i=50;i<npt-100;i+=1)
// print i,intensity[i]
if (intensity[i] < ligne_base)
indic_ligne_base=i
ligne_base=min(ligne_base,intensity[i])
endif
endfor
print "Indice et ligne de base :", indic_ligne_base,ligne_base
intensity = intensity-ligne_base
for(i=0;i<npt;i+=1)
if (intensity[i] < 0)
intensity[i]=0
endif
endfor
end

what's the different indic_base_line and ligne_base
Can I explain me this program


ligne_base is set to some value in the intensity array; initially it is set to the value at index 500, presumably the last value in the spectrum.
indic_ligne_base is an index pointing to some value in the intensity array; initially set to 0, the first value in the spectrum.

The first for/endfor loop finds the minimum value in the intensity array and sets ligne_base to that value and sets indic_ligne_base to the index of the minimum.

Then ligne_base is subtracted from every value in the intensity array.

The last for/endfor ensures that there are no negative values in the array.

As Howard suggested, you will benefit greatly from going through the Igor guided tour. Also, your question should have been posted to the "General" Forum. This forum is for posting questions concerning the Igor Exchange site itself.
jtigor wrote:
Also, your question should have been posted to the "General" Forum. This forum is for posting questions concerning the Igor Exchange site itself.

Thanks for pointing this out. I've moved the question to the appropriate forum.