Author: bugman Date: Wed Oct 22 14:22:11 2014 New Revision: 26344 URL: http://svn.gna.org/viewcvs/relax?rev=26344&view=rev Log: Added printouts to pipe_control.pcs.return_pcs_data() and pipe_control.rdc.return_rdc_data(). These functions now accept the verbosity argument which if greater than 0 will activate printouts of how many RDCs or PCSs have been assembled for each alignment. This will be useful for user feedback as the spin verses interatomic data container selections can be difficult to understand. Modified: trunk/pipe_control/pcs.py trunk/pipe_control/rdc.py Modified: trunk/pipe_control/pcs.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/pcs.py?rev=26344&r1=26343&r2=26344&view=diff ============================================================================== --- trunk/pipe_control/pcs.py (original) +++ trunk/pipe_control/pcs.py Wed Oct 22 14:22:11 2014 @@ -752,11 +752,13 @@ cdp.pcs_ids.append(align_id) -def return_pcs_data(sim_index=None): +def return_pcs_data(sim_index=None, verbosity=0): """Set up the data structures for optimisation using PCSs as base data sets. @keyword sim_index: The index of the simulation to optimise. This should be None if normal optimisation is desired. @type sim_index: None or int + @keyword verbosity: A flag specifying the amount of information to print. The higher the value, the greater the verbosity. + @type verbosity: int @return: The assembled data structures for using PCSs as the base data for optimisation. These include: - the PCS values. - the unit vectors connecting the paramagnetic centre (the electron spin) to the spin. @@ -767,6 +769,10 @@ @rtype: tuple of (numpy rank-2 float64 array, numpy rank-2 float64 array, numpy rank-2 float64 array, list of float, list of float, numpy rank-1 int32 array) """ + # Initial printout. + if verbosity: + print("\nPCS data counts:") + # Data setup tests. if not hasattr(cdp, 'paramagnetic_centre') and (hasattr(cdp, 'paramag_centre_fixed') and cdp.paramag_centre_fixed): raise RelaxError("The paramagnetic centre has not yet been specified.") @@ -850,6 +856,10 @@ # Spin index. j = j + 1 + + # ID and PCS count printout. + if verbosity: + print(" Alignment ID '%s': %i" % (align_id, j)) # Pseudo-atom. for spin in spin_loop(): Modified: trunk/pipe_control/rdc.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/rdc.py?rev=26344&r1=26343&r2=26344&view=diff ============================================================================== --- trunk/pipe_control/rdc.py (original) +++ trunk/pipe_control/rdc.py Wed Oct 22 14:22:11 2014 @@ -926,11 +926,13 @@ cdp.rdc_ids.append(align_id) -def return_rdc_data(sim_index=None): +def return_rdc_data(sim_index=None, verbosity=0): """Set up the data structures for optimisation using RDCs as base data sets. @keyword sim_index: The index of the simulation to optimise. This should be None if normal optimisation is desired. @type sim_index: None or int + @keyword verbosity: A flag specifying the amount of information to print. The higher the value, the greater the verbosity. + @type verbosity: int @return: The assembled data structures for using RDCs as the base data for optimisation. These include: - rdc, the RDC values. - rdc_err, the RDC errors. @@ -944,6 +946,10 @@ @rtype: tuple of (numpy rank-2 float64 array, numpy rank-2 float64 array, numpy rank-2 float64 array, list of numpy rank-3 float64 arrays, list of lists of floats, numpy rank-2 int32 array, numpy rank-2 int32 array, numpy rank-2 float64 array, numpy rank-1 int32 array) """ + # Initial printout. + if verbosity: + print("\nRDC data counts:") + # Sort out pseudo-atoms first. This only needs to be called once. setup_pseudoatom_rdc() @@ -1078,6 +1084,7 @@ T_flags.append([]) # Interatom loop. + j = 0 for interatom in interatomic_loop(): # Get the spins. spin1 = return_spin(interatom.spin_id1) @@ -1136,6 +1143,13 @@ absolute[-1].append(interatom.absolute_rdc[align_id]) else: absolute[-1].append(False) + + # Interatom index. + j = j + 1 + + # ID and RDC count printout. + if verbosity: + print(" Alignment ID '%s': %i" % (align_id, j)) # Convert to numpy objects. rdc = array(rdc, float64)