Open CandleHouse opened 11 months ago
Get decomposition coefficient with physical experiment without spectrum! Please integrate this!
def deDecompGetCoeff(lowProj: TwoOrThreeD, highProj: TwoOrThreeD, len1: TwoOrThreeD, len2: TwoOrThreeD) -> Tuple[NDArray, NDArray]: ''' Calculate the decomposing coefficient (Order 2 with bias term) of dual-energy onto two material length. ''' def deCalcBetaGamma(A1, A2, LComb): A1Square = A1.T**2 A2Square = A2.T**2 A1A2 = (A1 * A2).T A1 = A1.T A2 = A2.T Ones = np.ones((A1.T.shape[0])) A = np.array([A1Square, A2Square, A1A2, A1, A2, Ones]).T return np.linalg.pinv(A) @ LComb beta, gamma = deCalcBetaGamma(lowProj.flatten(), highProj.flatten(), np.array([len1.flatten(), len2.flatten()]).T).T return beta, gamma
6
Get decomposition coefficient with physical experiment without spectrum! Please integrate this!