discSpec.py
def nnLLS(t, tau, Gexp, isPlateau):
	"""
	#
	# Helper subfunction which does the actual LLS problem
	# helps MaxwellModes; relies on nnls
	#
	"""
	n       = len(Gexp)
	S, T    = np.meshgrid(tau, t)
	K		= np.exp(-T/S)		# n * nmodes
	
	# K is n*ns [or ns+1]
	if isPlateau:
		K = np.hstack(( K, np.ones((len(Gexp), 1)) ))
		
	#
	# gets (Gt/GtE - 1)^2, instead of  (Gt -  GtE)^2
	#
	Kp      = np.dot(np.diag((1./Gexp)), K)
	condKp  = np.linalg.cond(Kp)
	g       = nnls(Kp, np.ones(len(Gexp)))[0]	

	GtM   	= np.dot(K, g)
	error 	= np.sum((GtM/Gexp - 1.)**2)

	return g, error, condKp

	#
	# Helper subfunction which does the actual LLS problem
	# helps MaxwellModes; relies on nnls
	#
	
Helper subfunction which does the actual LLS problem
helps MaxwellModes; relies on nnls
Helper subfunction which does the actual LLS problem helps MaxwellModes ; relies on nnls
def nnLLS(t, tau, Gexp, isPlateau):
	n       = len(Gexp)
	S, T    = np.meshgrid(tau, t)
	K		= np.exp(-T/S)		
	if isPlateau:
		K = np.hstack(( K, np.ones((len(Gexp), 1)) ))
	 gets (Gt/GtE - 1)^2, instead of  (Gt -  GtE)^2
	Kp      = np.dot(np.diag((1./Gexp)), K)
	condKp  = np.linalg.cond(Kp)
	g       = nnls(Kp, np.ones(len(Gexp)))[0]	
	GtM   	= np.dot(K, g)
	error 	= np.sum((GtM/Gexp - 1.)**2)
	return g, error, condKp
def nnLLS ( t , tau , Gexp , isPlateau ) : n = len ( Gexp ) S , T = np . meshgrid ( tau , t ) K = np . exp ( - T / S ) if isPlateau : K = np . hstack ( ( K , np . ones ( ( len ( Gexp ) , 1 ) ) ) ) Kp = np . dot ( np . diag ( ( 1. / Gexp ) ) , K ) condKp = np . linalg . cond ( Kp ) g = nnls ( Kp , np . ones ( len ( Gexp ) ) ) [ 0 ] GtM = np . dot ( K , g ) error = np . sum ( ( GtM / Gexp - 1. ) ** 2 ) return g , error , condKp
Helper subfunction which does the actual LLS problem
 helps MaxwellModes; relies on nnls
Helper subfunction which does the actual LLS problem helps MaxwellModes ; relies on nnls
"""
	#
	# Helper subfunction which does the actual LLS problem
	# helps MaxwellModes; relies on nnls
	#
	""" # n * nmodes # K is n*ns [or ns+1] # # gets (Gt/GtE - 1)^2, instead of  (Gt -  GtE)^2 #
t
tau
Gexp
isPlateau