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

Source Code for Module specific_analyses.frame_order.parameter_object

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2009-2011,2013-2014 Edward d'Auvergne                         # 
  4  #                                                                             # 
  5  # This file is part of the program relax (http://www.nmr-relax.com).          # 
  6  #                                                                             # 
  7  # This program is free software: you can redistribute it and/or modify        # 
  8  # it under the terms of the GNU General Public License as published by        # 
  9  # the Free Software Foundation, either version 3 of the License, or           # 
 10  # (at your option) any later version.                                         # 
 11  #                                                                             # 
 12  # This program is distributed in the hope that it will be useful,             # 
 13  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
 14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
 15  # GNU General Public License for more details.                                # 
 16  #                                                                             # 
 17  # You should have received a copy of the GNU General Public License           # 
 18  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
 19  #                                                                             # 
 20  ############################################################################### 
 21   
 22  # Module docstring. 
 23  """The module for the frame order parameter list object.""" 
 24   
 25  # Python module imports. 
 26  from math import pi 
 27   
 28  # relax module imports. 
 29  from lib.errors import RelaxError 
 30  from specific_analyses.parameter_object import Param_list 
 31   
 32   
33 -def angle_upper_excluding_bound(incs=None, model_info=None):
34 """Determine the upper grid bound for the angular parameters, excluding the bound value. 35 36 @keyword incs: The number of grid search increments. 37 @type incs: int 38 @keyword model_info: The model information from model_loop(). This is unused. 39 @type model_info: None 40 @return: The upper grid search bound for the angular parameters, excluding the bound value. 41 @rtype: float 42 """ 43 44 # Handle inc values of None or 1. 45 if incs in [None, 1]: 46 return 2.0 * pi 47 48 # Return the upper limit which is one inc before 2pi. 49 return 2.0*pi * (1.0 - 1.0/incs)
50 51
52 -def axis_alpha_upper(incs=None, model_info=None):
53 """Determine the upper grid bound for the axis alpha angle. 54 55 @keyword incs: The number of grid search increments. 56 @type incs: int 57 @keyword model_info: The model information from model_loop(). This is unused. 58 @type model_info: None 59 @return: The upper grid search bound for the axis alpha angle. 60 @rtype: float 61 """ 62 63 # Handle inc values of None or 1. 64 if incs in [None, 1]: 65 return pi 66 67 # Return the upper limit which is one inc before pi. 68 return pi * (1.0 - 2.0/incs)
69 70
71 -def cone_angle_lower(incs=None, model_info=None):
72 """Determine the lower grid bound for the cone and torsion angles. 73 74 @keyword incs: The number of grid search increments. 75 @type incs: int 76 @keyword model_info: The model information from model_loop(). This is unused. 77 @type model_info: None 78 @return: The lower grid search bound for the cone and torsion angles. 79 @rtype: float 80 """ 81 82 # Handle inc values of None or 1. 83 if incs in [None, 1]: 84 return 0.0 85 86 # Return the lower limit, excluding the first point. 87 return pi * (1.0/(incs+1))
88 89
90 -def cone_angle_upper(incs=None, model_info=None):
91 """Determine the upper grid bound for the cone and torsion angles. 92 93 @keyword incs: The number of grid search increments. 94 @type incs: int 95 @keyword model_info: The model information from model_loop(). This is unused. 96 @type model_info: None 97 @return: The upper grid search bound for the cone and torsion angles. 98 @rtype: float 99 """ 100 101 # Handle inc values of None or 1. 102 if incs in [None, 1]: 103 return pi 104 105 # Return the upper limit, excluding the last point. 106 return pi * (1.0 - 1.0/(incs+1))
107 108
109 -def pivot_grid_bound(param=None, extent=25.0):
110 """Determine the grid bounds for the pivot coordinates. 111 112 @keyword param: The parameter to find the bound for. This should be one of 'pivot_x', 'pivot_y', or 'pivot_z'. 113 @type param: str 114 @keyword extent: The length in Angstrom to extend out from the current coordinate to reach the grid bound. 115 @type extent: float 116 @return: The grid search bound for the given coordinate. 117 @rtype: float 118 """ 119 120 # No pivot set. 121 if not hasattr(cdp, param): 122 raise RelaxError("The pivot point has not been set, cannot determine the grid search bounds.") 123 124 # The value. 125 val = getattr(cdp, param) 126 127 # Return the bound. 128 return val + extent
129 130
131 -def pivot_x_lower(incs=None, model_info=None, size=25.0):
132 """Determine the lower grid bound for the pivot X coordinate. 133 134 @keyword incs: The number of grid search increments. 135 @type incs: int 136 @keyword model_info: The model information from model_loop(). This is unused. 137 @type model_info: None 138 @keyword size: The half grid size in Angstrom. 139 @type size: float 140 @return: The lower grid search bound for the coordinate. 141 @rtype: float 142 """ 143 144 # Return the value. 145 return pivot_grid_bound(param='pivot_x', extent=-size)
146 147
148 -def pivot_x_upper(incs=None, model_info=None, size=25.0):
149 """Determine the upper grid bound for the pivot X coordinate. 150 151 @keyword incs: The number of grid search increments. 152 @type incs: int 153 @keyword model_info: The model information from model_loop(). This is unused. 154 @type model_info: None 155 @keyword size: The half grid size in Angstrom. 156 @type size: float 157 @return: The upper grid search bound for the coordinate. 158 @rtype: float 159 """ 160 161 # Return the value. 162 return pivot_grid_bound(param='pivot_x', extent=size)
163 164
165 -def pivot_y_lower(incs=None, model_info=None, size=25.0):
166 """Determine the lower grid bound for the pivot Y coordinate. 167 168 @keyword incs: The number of grid search increments. 169 @type incs: int 170 @keyword model_info: The model information from model_loop(). This is unused. 171 @type model_info: None 172 @keyword size: The half grid size in Angstrom. 173 @type size: float 174 @return: The lower grid search bound for the coordinate. 175 @rtype: float 176 """ 177 178 # Return the value. 179 return pivot_grid_bound(param='pivot_y', extent=-size)
180 181
182 -def pivot_y_upper(incs=None, model_info=None, size=25.0):
183 """Determine the upper grid bound for the pivot Y coordinate. 184 185 @keyword incs: The number of grid search increments. 186 @type incs: int 187 @keyword model_info: The model information from model_loop(). This is unused. 188 @type model_info: None 189 @keyword size: The half grid size in Angstrom. 190 @type size: float 191 @return: The upper grid search bound for the coordinate. 192 @rtype: float 193 """ 194 195 # Return the value. 196 return pivot_grid_bound(param='pivot_y', extent=size)
197 198
199 -def pivot_z_lower(incs=None, model_info=None, size=25.0):
200 """Determine the lower grid bound for the pivot Z coordinate. 201 202 @keyword incs: The number of grid search increments. 203 @type incs: int 204 @keyword model_info: The model information from model_loop(). This is unused. 205 @type model_info: None 206 @keyword size: The half grid size in Angstrom. 207 @type size: float 208 @return: The lower grid search bound for the coordinate. 209 @rtype: float 210 """ 211 212 # Return the value. 213 return pivot_grid_bound(param='pivot_z', extent=-size)
214 215
216 -def pivot_z_upper(incs=None, model_info=None, size=25.0):
217 """Determine the upper grid bound for the pivot Z coordinate. 218 219 @keyword incs: The number of grid search increments. 220 @type incs: int 221 @keyword model_info: The model information from model_loop(). This is unused. 222 @type model_info: None 223 @keyword size: The half grid size in Angstrom. 224 @type size: float 225 @return: The upper grid search bound for the coordinate. 226 @rtype: float 227 """ 228 229 # Return the value. 230 return pivot_grid_bound(param='pivot_z', extent=size)
231 232 233
234 -class Frame_order_params(Param_list):
235 """The frame order parameter list singleton.""" 236 237 # Class variable for storing the class instance (for the singleton design pattern). 238 _instance = None 239
240 - def __init__(self):
241 """Define all the parameters of the analysis.""" 242 243 # The object is already initialised. 244 if self._initialised: return 245 246 # Execute the base class __init__ method. 247 Param_list.__init__(self) 248 249 # Add the model variables. 250 self._add_model_info() 251 252 # Add the base data. 253 self._add_align_data() 254 255 # Add the parameters of all models. 256 self._add( 257 'pivot_x', 258 scope = 'global', 259 units = 'Angstrom', 260 desc = 'The pivot point position x coordinate', 261 py_type = float, 262 set = 'params', 263 grid_lower = pivot_x_lower, 264 grid_upper = pivot_x_upper, 265 err = True, 266 sim = True 267 ) 268 self._add( 269 'pivot_y', 270 scope = 'global', 271 units = 'Angstrom', 272 desc = 'The pivot point position y coordinate', 273 py_type = float, 274 set = 'params', 275 grid_lower = pivot_y_lower, 276 grid_upper = pivot_y_upper, 277 err = True, 278 sim = True 279 ) 280 self._add( 281 'pivot_z', 282 scope = 'global', 283 units = 'Angstrom', 284 desc = 'The pivot point position z coordinate', 285 py_type = float, 286 set = 'params', 287 grid_lower = pivot_z_lower, 288 grid_upper = pivot_z_upper, 289 err = True, 290 sim = True 291 ) 292 self._add( 293 'pivot_disp', 294 scope = 'global', 295 units = 'Angstrom', 296 desc = 'The 2nd pivot point displacement - the minimum distance between the two rotor axes', 297 py_type = float, 298 set = 'params', 299 grid_lower = 10.0, 300 grid_upper = 60.0, 301 err = True, 302 sim = True 303 ) 304 self._add( 305 'ave_pos_x', 306 scope = 'global', 307 units = 'Angstrom', 308 desc = 'The average position x translation', 309 py_type = float, 310 set = 'params', 311 grid_lower = -50, 312 grid_upper = 50, 313 err = True, 314 sim = True 315 ) 316 self._add( 317 'ave_pos_y', 318 scope = 'global', 319 units = 'Angstrom', 320 desc = 'The average position y translation', 321 py_type = float, 322 set = 'params', 323 grid_lower = -50, 324 grid_upper = 50, 325 err = True, 326 sim = True 327 ) 328 self._add( 329 'ave_pos_z', 330 scope = 'global', 331 units = 'Angstrom', 332 desc = 'The average position z translation', 333 py_type = float, 334 set = 'params', 335 grid_lower = -50, 336 grid_upper = 50, 337 err = True, 338 sim = True 339 ) 340 self._add( 341 'ave_pos_alpha', 342 scope = 'global', 343 units = 'rad', 344 desc = 'The average position alpha Euler angle', 345 py_type = float, 346 set = 'params', 347 grid_lower = 0.0, 348 grid_upper = angle_upper_excluding_bound, 349 err = True, 350 sim = True 351 ) 352 self._add( 353 'ave_pos_beta', 354 scope = 'global', 355 units = 'rad', 356 desc = 'The average position beta Euler angle', 357 py_type = float, 358 set = 'params', 359 grid_lower = 0.0, 360 grid_upper = pi, 361 err = True, 362 sim = True 363 ) 364 self._add( 365 'ave_pos_gamma', 366 scope = 'global', 367 units = 'rad', 368 desc = 'The average position gamma Euler angle', 369 py_type = float, 370 set = 'params', 371 grid_lower = 0.0, 372 grid_upper = angle_upper_excluding_bound, 373 err = True, 374 sim = True 375 ) 376 self._add( 377 'eigen_alpha', 378 scope = 'global', 379 units = 'rad', 380 desc = 'The Eigenframe alpha Euler angle', 381 py_type = float, 382 set = 'params', 383 grid_lower = 0.0, 384 grid_upper = angle_upper_excluding_bound, 385 err = True, 386 sim = True 387 ) 388 self._add( 389 'eigen_beta', 390 scope = 'global', 391 units = 'rad', 392 desc = 'The Eigenframe beta Euler angle', 393 py_type = float, 394 set = 'params', 395 grid_lower = 0.0, 396 grid_upper = pi, 397 err = True, 398 sim = True 399 ) 400 self._add( 401 'eigen_gamma', 402 scope = 'global', 403 units = 'rad', 404 desc = 'The Eigenframe gamma Euler angle', 405 py_type = float, 406 set = 'params', 407 grid_lower = 0.0, 408 grid_upper = angle_upper_excluding_bound, 409 err = True, 410 sim = True 411 ) 412 self._add( 413 'axis_theta', 414 scope = 'global', 415 units = 'rad', 416 desc = 'The cone axis polar angle (for the isotropic cone model)', 417 py_type = float, 418 set = 'params', 419 grid_lower = 0.0, 420 grid_upper = pi, 421 err = True, 422 sim = True 423 ) 424 self._add( 425 'axis_phi', 426 scope = 'global', 427 units = 'rad', 428 desc = 'The cone axis azimuthal angle (for the isotropic cone model)', 429 py_type = float, 430 set = 'params', 431 grid_lower = 0.0, 432 grid_upper = angle_upper_excluding_bound, 433 err = True, 434 sim = True 435 ) 436 self._add( 437 'axis_alpha', 438 scope = 'global', 439 units = 'rad', 440 desc = 'The rotor axis alpha angle (the rotation angle out of the xy plane)', 441 py_type = float, 442 set = 'params', 443 grid_lower = -pi, 444 grid_upper = axis_alpha_upper, 445 err = True, 446 sim = True 447 ) 448 self._add( 449 'cone_theta_x', 450 scope = 'global', 451 units = 'rad', 452 desc = 'The pseudo-ellipse cone opening half-angle for the x-axis', 453 py_type = float, 454 set = 'params', 455 grid_lower = cone_angle_lower, 456 grid_upper = cone_angle_upper, 457 err = True, 458 sim = True 459 ) 460 self._add( 461 'cone_theta_y', 462 scope = 'global', 463 units = 'rad', 464 desc = 'The pseudo-ellipse cone opening half-angle for the y-axis', 465 py_type = float, 466 set = 'params', 467 grid_lower = cone_angle_lower, 468 grid_upper = cone_angle_upper, 469 err = True, 470 sim = True 471 ) 472 self._add( 473 'cone_theta', 474 scope = 'global', 475 units = 'rad', 476 desc = 'The isotropic cone opening half-angle', 477 py_type = float, 478 set = 'params', 479 grid_lower = cone_angle_lower, 480 grid_upper = cone_angle_upper, 481 err = True, 482 sim = True 483 ) 484 self._add( 485 'cone_sigma_max', 486 scope = 'global', 487 units = 'rad', 488 desc = 'The torsion angle', 489 py_type = float, 490 set = 'params', 491 grid_lower = cone_angle_lower, 492 grid_upper = cone_angle_upper, 493 err = True, 494 sim = True 495 ) 496 self._add( 497 'cone_sigma_max_2', 498 scope = 'global', 499 units = 'rad', 500 desc = 'The torsion angle of the 2nd motional mode', 501 py_type = float, 502 set = 'params', 503 grid_lower = cone_angle_lower, 504 grid_upper = cone_angle_upper, 505 err = True, 506 sim = True 507 ) 508 509 # Add minimisation structures. 510 self._add_min_data(min_stats_global=True) 511 512 # Set up the user function documentation. 513 self._set_uf_title("Frame order parameters") 514 self._uf_param_table(label="table: frame order parameters", caption="Frame order parameters.", scope='global') 515 self._uf_param_table(label="table: frame order parameter value setting with defaults", caption="Frame order parameter value setting.", scope='global', default=True)
516