Author: bugman Date: Tue Jan 12 09:41:21 2016 New Revision: 28165 URL: http://svn.gna.org/viewcvs/relax?rev=28165&view=rev Log: Added support for concatenating atomic positions in the structure.load_spins user function.
Together with the spin_num flag set to False, this allows for atomic positions to be read from multiple homologous structures with different PDB atomic numbering. The spin containers will be created from the first structure, in which the spin is defined, and the atomic position from subsequent structures will be appended to the list of current atomic positions. Modified: trunk/pipe_control/structure/main.py Modified: trunk/pipe_control/structure/main.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/structure/main.py?rev=28165&r1=28164&r2=28165&view=diff ============================================================================== --- trunk/pipe_control/structure/main.py (original) +++ trunk/pipe_control/structure/main.py Tue Jan 12 09:41:21 2016 @@ -21,7 +21,7 @@ # Python module imports. from minfx.generic import generic_minimise -from numpy import array, average, dot, float64, mean, ones, std, zeros +from numpy import array, average, concatenate, dot, float64, mean, ones, std, zeros from numpy.linalg import norm from os import F_OK, access, getcwd from re import search @@ -893,7 +893,11 @@ spin_names.append(atom_name) # Position vector. - spin_cont.pos = pos + if hasattr(spin_cont, 'pos') and spin_cont.pos != None and (spin_cont.pos.shape != pos.shape or (spin_cont.pos != pos).any()): + warn(RelaxWarning("Positional information already exists for the spin %s, appending the new positions." % id)) + spin_cont.pos = concatenate((spin_cont.pos, pos)) + else: + spin_cont.pos = pos # Add the element. spin_cont.element = element _______________________________________________ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits