Spin loop

From relax wiki
Jump to navigation Jump to search

View results per spin

  1. Looking at the contents of the spin viewer window in the GUI,
  2. Opening a relax results or state XML file in a text editor,
  3. Looking at the cdp.mol[i].res[j].spin[k] data structure.


Looping over cdp

print cdp.mol
for resiob in cdp.mol[0].res:
    print resiob.name, resiob.num

print dir(resiob)
['__class__', '__clone__', '__deepcopy__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__',
'__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__',
'__subclasshook__', '__weakref__', '_mol_index', '_mol_name', '_res_index', '_spin_name_count', '_spin_num_count',
'is_empty', 'name', 'num', 'spin']

Looping over spin

from pipe_control.mol_res_spin import spin_loop
for spin, spin_id in spin_loop(return_id=True, skip_desel=True):
    print("Spin '%s', model '%s'" % (spin_id, spin.model))

To see available information in the spin class

dir(spin)
['__class__', '__clone__', '__deepcopy__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', 
'__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', 
'__subclasshook__', '__weakref__', '_back_compat_hook', '_back_compat_hook_mf_data', '_back_compat_hook_ri_data', 
'_mol_index', '_mol_name', '_res_index', '_res_name', '_res_num', '_spin_ids', '_spin_index', 
'chi2', 'chi2_sim', 'f_count', 'f_count_sim', 'g_count', 'g_count_sim', 'h_count', 'h_count_sim', 'intensities', 'intensity_err', 'is_empty', 
'isotope', 'iter', 'iter_sim', 'kex', 'kex_err', 'kex_sim', 'model', 'name', 'num', 'params', 'phi_ex', 'phi_ex_err', 
'phi_ex_sim', 'r2', 'r2_err', 'r2_sim', 'r2eff', 'r2eff_bc', 'r2eff_err', 'r2eff_sim', 'select', 'select_sim', 'warning', 'warning_sim']

See also