Package pipe_control :: Module interatomic
[hide private]
[frames] | no frames]

Module interatomic

source code

Module for the manipulation of the interatomic data structures in the relax data store.

Functions [hide private]
 
copy(pipe_from=None, pipe_to=None, spin_id1=None, spin_id2=None, verbose=True)
Copy the interatomic data from one data pipe to another.
source code
 
consistent_interatomic_data(pipe1=None, pipe2=None)
Check that the interatomic data is consistent between two data pipes.
source code
data.interatomic.InteratomContainer instance
create_interatom(spin_id1=None, spin_id2=None, spin1=None, spin2=None, pipe=None, verbose=False)
Create and return the interatomic data container for the two spins.
source code
 
define_dipole_pair(spin_id1=None, spin_id2=None, spin1=None, spin2=None, pipe=None, direct_bond=False, spin_selection=False, verbose=True)
Set up the magnetic dipole-dipole interaction.
source code
bool
exists_data(pipe=None)
Determine if any interatomic data exists.
source code
 
hash_update(interatom=None, pipe=None)
Recreate the spin hashes for the interatomic data container.
source code
 
interatomic_loop(selection1=None, selection2=None, pipe=None, skip_desel=True)
Generator function for looping over all the interatomic data containers.
source code
 
metadata_update(interatom_index=None, pipe=None)
Update all of the private look up metadata.
source code
 
read_dist(file=None, dir=None, unit='meter', spin_id1_col=None, spin_id2_col=None, data_col=None, sep=None)
Set up the magnetic dipole-dipole interaction.
source code
data.interatomic.InteratomContainer instance or None
return_interatom(spin_hash1=None, spin_hash2=None, pipe=None)
Return the list of interatomic data containers for the two spins.
source code
list of data.interatomic.InteratomContainer instances
return_interatom_list(spin_hash=None, pipe=None)
Return the list of interatomic data containers for the given spin.
source code
 
set_dist(spin_id1=None, spin_id2=None, ave_dist=None, unit='meter')
Set up the magnetic dipole-dipole interaction.
source code
 
unit_vectors(ave=True)
Extract the bond vectors from the loaded structures and store them in the spin container.
source code
Variables [hide private]
  __package__ = 'pipe_control'

Imports: deepcopy, float64, zeros, norm, search, sys, warn, is_float, RelaxError, RelaxInteratomInconsistentError, RelaxNoInteratomError, RelaxNoSpinError, extract_data, strip, write_data, RelaxWarning, RelaxZeroVectorWarning, pipes, Selection, count_spins, exists_mol_res_spin_data, generate_spin_id_unique, return_spin, spin_loop, check_pipe


Function Details [hide private]

copy(pipe_from=None, pipe_to=None, spin_id1=None, spin_id2=None, verbose=True)

source code 

Copy the interatomic data from one data pipe to another.

Parameters:
  • pipe_from (str) - The data pipe to copy the interatomic data from. This defaults to the current data pipe.
  • pipe_to (str) - The data pipe to copy the interatomic data to. This defaults to the current data pipe.
  • spin_id1 (str) - The spin ID string of the first atom.
  • spin_id2 (str) - The spin ID string of the second atom.
  • verbose (bool) - A flag which if True will cause info about each spin pair to be printed out.

consistent_interatomic_data(pipe1=None, pipe2=None)

source code 

Check that the interatomic data is consistent between two data pipes.

Parameters:
  • pipe1 (str) - The name of the first data pipe to compare.
  • pipe2 (str) - The name of the second data pipe to compare.
Raises:

create_interatom(spin_id1=None, spin_id2=None, spin1=None, spin2=None, pipe=None, verbose=False)

source code 

Create and return the interatomic data container for the two spins.

Parameters:
  • spin_id1 (str) - The spin ID string of the first atom.
  • spin_id2 (str) - The spin ID string of the second atom.
  • spin1 (str) - The optional spin container for the first atom. This is for speeding up the interatomic data container creation, if the spin containers are already available in the calling function.
  • spin2 (str) - The optional spin container for the second atom. This is for speeding up the interatomic data container creation, if the spin containers are already available in the calling function.
  • pipe (str or None) - The data pipe to create the interatomic data container for. This defaults to the current data pipe if not supplied.
  • verbose (bool) - A flag which if True will result printouts.
Returns: data.interatomic.InteratomContainer instance
The newly created interatomic data container.

define_dipole_pair(spin_id1=None, spin_id2=None, spin1=None, spin2=None, pipe=None, direct_bond=False, spin_selection=False, verbose=True)

source code 

Set up the magnetic dipole-dipole interaction.

Parameters:
  • spin_id1 (str) - The spin identifier string of the first spin of the pair.
  • spin_id2 (str) - The spin identifier string of the second spin of the pair.
  • spin1 (str) - An optional single spin container for the first atom. This is for speeding up the interatomic data container creation, if the spin containers are already available in the calling function.
  • spin2 (str) - An optional single spin container for the second atom. This is for speeding up the interatomic data container creation, if the spin containers are already available in the calling function.
  • pipe (str) - The data pipe to operate on. Defaults to the current data pipe.
  • direct_bond (bool) - A flag specifying if the two spins are directly bonded.
  • spin_selection (bool) - Define the interatomic data container selection based on the spin selection. If either spin is deselected, the interatomic container will also be deselected. Otherwise the container will be selected.
  • verbose (bool) - A flag which if True will result in printouts of the created interatomoic data containers.

exists_data(pipe=None)

source code 

Determine if any interatomic data exists.

Parameters:
  • pipe (str) - The data pipe in which the interatomic data will be checked for.
Returns: bool
The answer to the question about the existence of data.

hash_update(interatom=None, pipe=None)

source code 

Recreate the spin hashes for the interatomic data container.

Parameters:
  • interatom (InteratomContainer instance) - The interatomic data container.
  • pipe (str or None) - The data pipe containing the interatomic data container. Defaults to the current data pipe.

interatomic_loop(selection1=None, selection2=None, pipe=None, skip_desel=True)

source code 

Generator function for looping over all the interatomic data containers.

Parameters:
  • selection1 (str) - The optional spin ID selection of the first atom.
  • selection2 (str) - The optional spin ID selection of the second atom.
  • pipe (str) - The data pipe containing the spin. Defaults to the current data pipe.
  • skip_desel (bool) - A flag which if True will cause only selected interatomic data containers to be returned.

metadata_update(interatom_index=None, pipe=None)

source code 

Update all of the private look up metadata.

Parameters:
  • interatom_index (int or None) - The index of the interatomic data container to update. If not supplied, all containers will be updated.
  • pipe (str or None) - The data pipe to update, defaulting to the current data pipe.

read_dist(file=None, dir=None, unit='meter', spin_id1_col=None, spin_id2_col=None, data_col=None, sep=None)

source code 

Set up the magnetic dipole-dipole interaction.

Parameters:
  • file (str) - The name of the file to open.
  • dir (str or None) - The directory containing the file (defaults to the current directory if None).
  • unit (str) - The measurement unit. This can be either 'meter' or 'Angstrom'.
  • spin_id1_col (int) - The column containing the spin ID strings of the first spin.
  • spin_id2_col (int) - The column containing the spin ID strings of the second spin.
  • data_col (int or None) - The column containing the averaged distances in meters.
  • sep (str or None) - The column separator which, if None, defaults to whitespace.

return_interatom(spin_hash1=None, spin_hash2=None, pipe=None)

source code 

Return the list of interatomic data containers for the two spins.

Parameters:
  • spin_hash1 (str) - The unique spin hash for the first atom.
  • spin_hash2 (str) - The unique spin hash for the second atom.
  • pipe (str or None) - The data pipe holding the container. Defaults to the current data pipe.
Returns: data.interatomic.InteratomContainer instance or None
The matching interatomic data container, if it exists.

return_interatom_list(spin_hash=None, pipe=None)

source code 

Return the list of interatomic data containers for the given spin.

Parameters:
  • spin_hash (str) - The unique spin hash.
  • pipe (str or None) - The data pipe holding the container. This defaults to the current data pipe.
Returns: list of data.interatomic.InteratomContainer instances
The list of matching interatomic data containers, if any exist.

set_dist(spin_id1=None, spin_id2=None, ave_dist=None, unit='meter')

source code 

Set up the magnetic dipole-dipole interaction.

Parameters:
  • spin_id1 (str) - The spin identifier string of the first spin of the pair.
  • spin_id2 (str) - The spin identifier string of the second spin of the pair.
  • ave_dist (float) - The r^-3 averaged interatomic distance.
  • unit (str) - The measurement unit. This can be either 'meter' or 'Angstrom'.

unit_vectors(ave=True)

source code 

Extract the bond vectors from the loaded structures and store them in the spin container.

Parameters:
  • ave (bool) - A flag which if True will cause the average of all vectors to be calculated.