def ReplaceColumnsWithConstants( efit, colNameList, colValueList, smarange=None ):
	"""Replace values in an ellipse-fit column with constant.
	
	Given an ellipse-fit dictionary, for each column name in colNameList,
	replace the existing values with the corresponding constant value in colValueList.
	Optionally, the range in semi-major axis for which values are replaced can be 
	specified via smarange (only semi-major axis values >= smarange[0] and 
	<= smarange[1] will be affectd).
	"""
	
	if "sma" in efit.keys():
		# IRAF-style ellipse fit
		a = efit['sma']
	else:
		# probably Bender-format ellipse fit
		if 'a' in efit.keys():
			a = efit['a']
		elif 'r' in efit.keys():
			a = efit['r']
		else:
			print("UNABLE TO FIND SMA COLUMN IN ELLIPSE-FIT DICTIONARY!")
			return None
	nRows = len(a)
	N = len(colNameList)
	
	if smarange is not None:
		amin = smarange[0]
		amax = smarange[1]
		iGood = [ i for i in range(nRows) if a[i] >= amin and a[i] <= amax ]
	else:
		iGood = range(nRows)
		
	for i in iGood:
		for j in range(N):
			efit[colNameList[j]][i] = colValueList[j]