def ndvi( redchan, nirchan ):
	"""
	Normalized Difference Vegetation Index
	ndvi( redchan, nirchan )
	"""
	redchan = 1.0*redchan
	nirchan = 1.0*nirchan
	if( ( nirchan + redchan ) ==  0.0 ):
		result = -1.0
	else:
		result = ( nirchan - redchan ) / ( nirchan + redchan )
	return result