minor: logging changes
This commit is contained in:
@@ -5,7 +5,7 @@ import numpy as np
|
||||
import itertools
|
||||
|
||||
import logging
|
||||
log = logging.getLogger("interp")
|
||||
log = logging.getLogger('interp')
|
||||
|
||||
def get_phis(X, R):
|
||||
"""
|
||||
@@ -75,6 +75,8 @@ def get_phis(X, R):
|
||||
# raise Exception(msg)
|
||||
phi = np.dot(np.linalg.pinv(A), b)
|
||||
|
||||
log.debug("phi: %s", phi)
|
||||
|
||||
return phi
|
||||
|
||||
def qlinear(X, R):
|
||||
@@ -89,15 +91,19 @@ def qlinear(X, R):
|
||||
|
||||
phis = get_phis(X, R.verts)
|
||||
qlin = np.sum([q_i * phi_i for q_i, phi_i in zip(R.q, phis)])
|
||||
|
||||
log.debug("phis: %s", phis)
|
||||
log.debug("qlin: %s", qlin)
|
||||
|
||||
return phis, qlin
|
||||
|
||||
def get_error(phi, R, S, order = 2):
|
||||
log.debug("len(phi): %d"% len(phi))
|
||||
print "asdf"
|
||||
B = [] # baker eq 9
|
||||
w = [] # baker eq 11
|
||||
|
||||
p = pattern(order, len(phi), offset = -1)
|
||||
log.debug("pattern: %s" % p)
|
||||
log.info("pattern: %s" % p)
|
||||
|
||||
for (s,q) in zip(S.verts, S.q):
|
||||
cur_phi, cur_qlin = qlinear(s, R)
|
||||
@@ -111,8 +117,8 @@ def get_error(phi, R, S, order = 2):
|
||||
B.append(l)
|
||||
w.append(q - cur_qlin)
|
||||
|
||||
log.debug("B: %s" % B)
|
||||
log.debug("w: %s" % w)
|
||||
log.info("B: %s" % B)
|
||||
log.info("w: %s" % w)
|
||||
|
||||
|
||||
B = np.array(B)
|
||||
@@ -128,8 +134,6 @@ def get_error(phi, R, S, order = 2):
|
||||
log.error("linear calculation went bad, resorting to np.linalg.pinv: %s" % e)
|
||||
abc = np.dot(np.linalg.pinv(A), b)
|
||||
|
||||
log.debug(len(abc) == len(p))
|
||||
|
||||
error_term = 0.0
|
||||
for (a, i) in zip(abc, p):
|
||||
cur_sum = a
|
||||
|
||||
Reference in New Issue
Block a user