Author: bugman Date: Wed Jul 9 18:41:40 2008 New Revision: 6909 URL: http://svn.gna.org/viewcvs/relax?rev=6909&view=rev Log: Created the tensor_5D automatically generated object to AlignTensorData. Modified: branches/rdc_analysis/data/align_tensor.py Modified: branches/rdc_analysis/data/align_tensor.py URL: http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/data/align_tensor.py?rev=6909&r1=6908&r2=6909&view=diff ============================================================================== --- branches/rdc_analysis/data/align_tensor.py (original) +++ branches/rdc_analysis/data/align_tensor.py Wed Jul 9 18:41:40 2008 @@ -467,6 +467,39 @@ tensor[0, 1] = tensor[1, 0] = Sxy tensor[0, 2] = tensor[2, 0] = Sxz tensor[1, 2] = tensor[2, 1] = Syz + + # Return the tensor. + return tensor + + +def calc_tensor_5D(Sxx, Syy, Szz, Sxy, Sxz, Syz): + """Function for calculating the alignment tensor in the 5D vector notation. + + @param Sxx: The Sxx tensor element. + @type Sxx: float + @param Syy: The Syy tensor element. + @type Syy: float + @param Szz: The Szz tensor element. + @type Szz: float + @param Sxy: The Sxy tensor element. + @type Sxy: float + @param Sxz: The Sxz tensor element. + @type Sxz: float + @param Syz: The Syz tensor element. + @type Syz: float + @return: The alignment 5D tensor (within the structural frame). + @rtype: numpy rank-1 5D tensor + """ + + # Initialise the tensor. + tensor = zeros(5, float64) + + # Populate the tensor. + tensor[0] = Sxx + tensor[1] = Syy + tensor[2] = Sxy + tensor[3] = Sxz + tensor[4] = Syz # Return the tensor. return tensor @@ -530,6 +563,7 @@ yield ('tensor_diag', ['Sxx', 'Syy', 'Sxy', 'Sxz', 'Syz'], ['tensor', 'rotation']) yield ('rotation', ['alpha', 'beta', 'gamma'], ['Sxx_unit', 'Syy_unit', 'Szz_unit']) yield ('tensor', ['Sxx', 'Syy', 'Sxy', 'Sxz', 'Syz'], ['Sxx', 'Syy', 'Szz', 'Sxy', 'Sxz', 'Syz']) + yield ('tensor_5D', ['Sxx', 'Syy', 'Sxy', 'Sxz', 'Syz'], ['Sxx', 'Syy', 'Szz', 'Sxy', 'Sxz', 'Syz'])