; $Id: getpname.pro,v 1.2 2002/01/14 20:59:26 amunter Exp $
FUNCTION getpname, i, ngau, nlor, pnames
;Gets a unique appropriate name for fit parameter a(i)
;THIS IS A TASCOM INTERNAL FUNCTION. DON'T WORRY ABOUT IT.
IF (i LT 3) THEN RETURN, pnames(i)
;Now the gaussians
IF (ngau NE 0) AND (i LT 3*(ngau+1)) THEN BEGIN
	t=(i-3) MOD 3
	gaunum = FIX(ngau*FLOAT(i-3)/(3*ngau))
	return, pnames(3+t)+STRCOMPRESS(STRING(gaunum,FORMAT='(I)'),/REMOVE_ALL)
END
;Otherwise it's a lorentzian
t=(i-3-3*ngau) MOD 3
lornum = FIX(nlor*FLOAT(i-3*(1+ngau))/(3*nlor))
return, pnames(6+t)+STRCOMPRESS(STRING(lornum,FORMAT='(I)'),/REMOVE_ALL)
END	
