'projects the normalized values onto the components
enthresh, nPCs, and cumen determine how many PCs to use
if vals is None, the normalized data vectors are the values to project.
Otherwise, it should be convertable to a p x N array
returns n,p(>threshold) dimension array'

def project(self, vals=None, enthresh=None, nPCs=None, cumen=None):

    nonnones = sum([(e != None) for e in (enthresh, nPCs, cumen)])
    if (nonnones == 0):
        m = slice(None)
    elif (nonnones > 1):
        raise ValueError("can't    specify    more    than    one    threshold")
    elif (enthresh is not None):
        m = (self.energies() > enthresh)
    elif (nPCs is not None):
        m = slice(None, nPCs)
    elif (cumen is not None):
        m = (np.cumsum(self.energies()) < cumen)
    else:
        raise RuntimeError('Should    be    unreachable')
    if (vals is None):
        vals = self.N.T
    else:
        vals = np.array(vals, copy=False)
        if (self.N.T.shape[0] != vals.shape[0]):
            raise ValueError("shape    for    vals    doesn't    match")
    proj = (np.matrix(self.getEigenvectors()).T * vals)
    return proj[m].T
