Author: tlinnet
Date: Mon Oct 13 10:47:40 2014
New Revision: 26250
URL: http://svn.gna.org/viewcvs/relax?rev=26250&view=rev
Log:
Added boolean argument to dx.map() function, to specify the creation of a
parameter and associated chi2 values file.
For very very special situtaions, the creation of this file is not desired.
Modified:
trunk/pipe_control/opendx.py
trunk/test_suite/system_tests/relax_disp.py
trunk/user_functions/dx.py
Modified: trunk/pipe_control/opendx.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/opendx.py?rev=26250&r1=26249&r2=26250&view=diff
==============================================================================
--- trunk/pipe_control/opendx.py (original)
+++ trunk/pipe_control/opendx.py Mon Oct 13 10:47:40 2014
@@ -37,38 +37,40 @@
from pipe_control import value
from specific_analyses.api import return_api
-def map(params=None, map_type='Iso3D', spin_id=None, inc=20, lower=None,
upper=None, axis_incs=10, file_prefix="map", dir="dx", point=None,
point_file="point", chi_surface=None):
+def map(params=None, map_type='Iso3D', spin_id=None, inc=20, lower=None,
upper=None, axis_incs=10, file_prefix="map", dir="dx", point=None,
point_file="point", chi_surface=None, create_par_file=False):
"""Map the space corresponding to the spin identifier and create the
OpenDX files.
@keyword params:
@type params:
- @keyword map_type: The type of map to create. The available
options are:
- - 'Iso3D', a 3D isosurface visualisation
of the space.
- @type map_type: str
- @keyword spin_id: The spin identification string.
- @type spin_id: str
- @keyword inc: The resolution of the plot. This is the
number of increments per
- dimension.
- @type inc: int
- @keyword lower: The lower bounds of the space to map. If
supplied, this should be a
- list of floats, its length equal to the number
of parameters in the
- model.
- @type lower: None or list of float
- @keyword upper: The upper bounds of the space to map. If
supplied, this should be a
- list of floats, its length equal to the number
of parameters in the
- model.
- @type upper: None or list of float
- @keyword axis_incs: The number of tick marks to display in the
OpenDX plot in each
- dimension.
- @type axis_incs: int
- @keyword file_prefix: The file prefix for all the created files.
- @type file_prefix: str
- @keyword dir: The directory to place the files into.
- @type dir: str or None
- @keyword point: If supplied, a red sphere will be placed at
these coordinates.
- @type point: None or list of float
- @keyword point_file: The file prefix for the point output files.
- @type point_file: str or None
+ @keyword map_type: The type of map to create. The available
options are:
+ - 'Iso3D', a 3D isosurface
visualisation of the space.
+ @type map_type: str
+ @keyword spin_id: The spin identification string.
+ @type spin_id: str
+ @keyword inc: The resolution of the plot. This is the
number of increments per
+ dimension.
+ @type inc: int
+ @keyword lower: The lower bounds of the space to map. If
supplied, this should be a
+ list of floats, its length equal to the
number of parameters in the
+ model.
+ @type lower: None or list of float
+ @keyword upper: The upper bounds of the space to map. If
supplied, this should be a
+ list of floats, its length equal to the
number of parameters in the
+ model.
+ @type upper: None or list of float
+ @keyword axis_incs: The number of tick marks to display in the
OpenDX plot in each
+ dimension.
+ @type axis_incs: int
+ @keyword file_prefix: The file prefix for all the created files.
+ @type file_prefix: str
+ @keyword dir: The directory to place the files into.
+ @type dir: str or None
+ @keyword point: If supplied, a red sphere will be placed
at these coordinates.
+ @type point: None or list of float
+ @keyword point_file: The file prefix for the point output files.
+ @type point_file: str or None
+ @keyword create_par_file: Whether to create a file with parameters
and associated chi2 value.
+ @type point_file: bool
"""
# Check the args.
@@ -83,7 +85,7 @@
raise RelaxError("The 3D isosurface map requires a 3 parameter
model.")
# Create the map.
- Map(params, spin_id, inc, lower, upper, axis_incs, file_prefix,
dir, point, point_file, chi_surface)
+ Map(params, spin_id, inc, lower, upper, axis_incs, file_prefix,
dir, point, point_file, chi_surface, create_par_file)
else:
raise RelaxError("The map type '" + map_type + "' is not
supported.")
@@ -92,7 +94,7 @@
class Map:
"""The space mapping base class."""
- def __init__(self, params, spin_id, inc, lower, upper, axis_incs,
file_prefix, dir, point, point_file, chi_surface):
+ def __init__(self, params, spin_id, inc, lower, upper, axis_incs,
file_prefix, dir, point, point_file, chi_surface, create_par_file):
"""Map the space upon class instantiation."""
# Initialise.
@@ -168,7 +170,8 @@
self.create_map()
## Generate the file with parameters and associated chi2 value.
- self.create_par_chi2()
+ if create_par_file:
+ self.create_par_chi2()
# Default the chi2 surface values, for Innermost, Inner, Middle
and Outer Isosurface.
if chi_surface == None:
Modified: trunk/test_suite/system_tests/relax_disp.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_disp.py?rev=26250&r1=26249&r2=26250&view=diff
==============================================================================
--- trunk/test_suite/system_tests/relax_disp.py (original)
+++ trunk/test_suite/system_tests/relax_disp.py Mon Oct 13 10:47:40 2014
@@ -3201,7 +3201,7 @@
#self.interpreter.relax_disp.cluster(cluster_id='free spins',
spin_id=cur_spin_id)
# Then do the map.
- self.interpreter.dx.map(params=dx_params, map_type='Iso3D',
spin_id=cur_spin_id, inc=dx_inc, lower=lower, upper=upper, axis_incs=10,
file_prefix=file_name_map, dir=result_dir, point=dx_point_clustered_min,
point_file=file_name_point)
+ self.interpreter.dx.map(params=dx_params, map_type='Iso3D',
spin_id=cur_spin_id, inc=dx_inc, lower=lower, upper=upper, axis_incs=10,
file_prefix=file_name_map, dir=result_dir, point=dx_point_clustered_min,
point_file=file_name_point, create_par_file=True)
# Print where to locate values.
nr_chi2_val = (dx_inc + 1)**3
Modified: trunk/user_functions/dx.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/user_functions/dx.py?rev=26250&r1=26249&r2=26250&view=diff
==============================================================================
--- trunk/user_functions/dx.py (original)
+++ trunk/user_functions/dx.py Mon Oct 13 10:47:40 2014
@@ -197,6 +197,13 @@
desc = "A list of 4 numbers, setting the level for the 4 isosurfaces.
Useful in scripting if you create a set of OpenDX maps with all the same
contour levels. Ideal for comparisons.",
can_be_none = True,
dim = 4
+)
+uf.add_keyarg(
+ name = "create_par_file",
+ default = False,
+ py_type = "bool",
+ desc_short = "creation of file with parameter and calculated chi2",
+ desc = "A flag specifying whether to create a file with parameters and
associated chi2 value. The default of False causes the file not to be
created."
)
# Description.
uf.desc.append(Desc_container())
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
relax-commits@xxxxxxx
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits