Package specific_analyses :: Package frame_order :: Module optimisation
[hide private]
[frames] | no frames]

Module optimisation

source code

Module for the optimisation of the frame order models.

Functions [hide private]
list of float
grid_row(incs, lower, upper, dist_type=None, end_point=True)
Set up a row of the grid search for a given parameter.
source code
numpy rank-3 array, numpy rank-1 array.
minimise_setup_atomic_pos(sim_index=None)
Set up the atomic position data structures for optimisation using PCSs and PREs as base data sets.
source code
tuple of (numpy rank-2 array, numpy rank-2 array, numpy rank-2 array, numpy rank-1 array, numpy rank-1 array)
minimise_setup_pcs(sim_index=None)
Set up the data structures for optimisation using PCSs as base data sets.
source code
tuple of (numpy rank-2 array, numpy rank-2 array, numpy rank-2 array, numpy rank-3 array, numpy rank-2 array, numpy rank-2 array)
minimise_setup_rdcs(sim_index=None)
Set up the data structures for optimisation using RDCs as base data sets.
source code
tuple of 3 numpy nx5D, rank-1 arrays
minimise_setup_tensors(sim_index=None)
Set up the data structures for optimisation using alignment tensors as base data sets.
source code
bool
opt_uses_align_data(align_id=None)
Determine if the PCS or RDC data for the given alignment ID is needed for optimisation.
source code
bool
opt_uses_pcs(align_id)
Determine if the PCS data for the given alignment ID is needed for optimisation.
source code
bool
opt_uses_rdc(align_id)
Determine if the RDC data for the given alignment ID is needed for optimisation.
source code
 
store_bc_data(target_fn)
Store the back-calculated data.
source code
 
target_fn_setup(sim_index=None, verbosity=1, scaling_matrix=None)
Initialise the target function for optimisation or direct calculation.
source code
 
unpack_opt_results(results, scaling_matrix=None, sim_index=None)
Unpack and store the Frame Order optimisation results.
source code
Variables [hide private]
  __package__ = 'specific_analyses.frame_order'

Imports: cos, pi, arccos, array, dot, float64, ones, zeros, inv, norm, sys, warn, isNaN, isInf, RelaxError, RelaxInfError, RelaxNaNError, RelaxNoPCSError, RelaxNoRDCError, wrap_angles, order_parameters, periodic_table, dipolar_constant, RelaxWarning, interatomic_loop, return_spin, spin_loop, check_rdcs, pipe_centre_of_mass, check_ave_domain_setup, base_data_types, domain_moving, pivot_fixed, tensor_loop, translation_fixed, assemble_param_vector, frame_order


Function Details [hide private]

grid_row(incs, lower, upper, dist_type=None, end_point=True)

source code 

Set up a row of the grid search for a given parameter.

Parameters:
  • incs (int) - The number of increments.
  • lower (float) - The lower bounds.
  • upper (float) - The upper bounds.
  • dist_type (None or str) - The spacing or distribution type between grid nodes. If None, then a linear grid row is returned. If 'acos', then an inverse cos distribution of points is returned (e.g. for uniform sampling in angular space).
  • end_point (bool) - A flag which if False will cause the end point to be removed.
Returns: list of float
The row of the grid.

minimise_setup_atomic_pos(sim_index=None)

source code 

Set up the atomic position data structures for optimisation using PCSs and PREs as base data sets.

Parameters:
  • sim_index (None or int) - The index of the simulation to optimise. This should be None if normal optimisation is desired.
Returns: numpy rank-3 array, numpy rank-1 array.
The atomic positions (the first index is the spins, the second is the structures, and the third is the atomic coordinates) and the paramagnetic centre.

minimise_setup_pcs(sim_index=None)

source code 

Set up the data structures for optimisation using PCSs as base data sets.

Parameters:
  • sim_index (None or int) - The index of the simulation to optimise. This should be None if normal optimisation is desired.
Returns: tuple of (numpy rank-2 array, numpy rank-2 array, numpy rank-2 array, numpy rank-1 array, numpy rank-1 array)
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 PCS weight.
  • the nuclear spin.
  • the pseudocontact shift constants.

minimise_setup_rdcs(sim_index=None)

source code 

Set up the data structures for optimisation using RDCs as base data sets.

Parameters:
  • sim_index (None or int) - The index of the simulation to optimise. This should be None if normal optimisation is desired.
Returns: tuple of (numpy rank-2 array, numpy rank-2 array, numpy rank-2 array, numpy rank-3 array, numpy rank-2 array, numpy rank-2 array)
The assembled data structures for using RDCs as the base data for optimisation. These include:
  • rdc, the RDC values.
  • rdc_err, the RDC errors.
  • rdc_weight, the RDC weights.
  • vectors, the interatomic vectors.
  • rdc_const, the dipolar constants.
  • absolute, the absolute value flags (as 1's and 0's).

minimise_setup_tensors(sim_index=None)

source code 

Set up the data structures for optimisation using alignment tensors as base data sets.

Parameters:
  • sim_index (None or int) - The simulation index. This should be None if normal optimisation is desired.
Returns: tuple of 3 numpy nx5D, rank-1 arrays
The assembled data structures for using alignment tensors as the base data for optimisation. These include:
  • full_tensors, the full tensors as concatenated arrays.
  • full_err, the full tensor errors as concatenated arrays.
  • full_in_ref_frame, the flags specifying if the tensor is the full or reduced tensor in the non-moving reference domain.

opt_uses_align_data(align_id=None)

source code 

Determine if the PCS or RDC data for the given alignment ID is needed for optimisation.

Parameters:
  • align_id (str) - The optional alignment ID string.
Returns: bool
True if alignment data is to be used for optimisation, False otherwise.

opt_uses_pcs(align_id)

source code 

Determine if the PCS data for the given alignment ID is needed for optimisation.

Parameters:
  • align_id (str) - The alignment ID string.
Returns: bool
True if the PCS data is to be used for optimisation, False otherwise.

opt_uses_rdc(align_id)

source code 

Determine if the RDC data for the given alignment ID is needed for optimisation.

Parameters:
  • align_id (str) - The alignment ID string.
Returns: bool
True if the RDC data is to be used for optimisation, False otherwise.

store_bc_data(target_fn)

source code 

Store the back-calculated data.

Parameters:
  • target_fn (class instance) - The frame-order target function class.

target_fn_setup(sim_index=None, verbosity=1, scaling_matrix=None)

source code 

Initialise the target function for optimisation or direct calculation.

Parameters:
  • sim_index (None or int) - The index of the simulation to optimise. This should be None if normal optimisation is desired.
  • verbosity (int) - The amount of information to print. The higher the value, the greater the verbosity.
  • scaling_matrix (numpy rank-2, float64 array or None) - The diagonal and square scaling matrices.

unpack_opt_results(results, scaling_matrix=None, sim_index=None)

source code 

Unpack and store the Frame Order optimisation results.

Parameters:
  • results (tuple) - The results tuple returned by the minfx generic_minimise() function.
  • scaling_matrix (numpy rank-2, float64 array or None) - The diagonal and square scaling matrices.
  • sim_index (None or int) - The index of the simulation to optimise. This should be None for normal optimisation.