Author: bugman Date: Wed Apr 16 14:40:42 2008 New Revision: 5751 URL: http://svn.gna.org/viewcvs/relax?rev=5751&view=rev Log: Renamed the opendx.opendx module to opendx.main. Added: 1.3/opendx/main.py - copied unchanged from r5750, 1.3/opendx/opendx.py Removed: 1.3/opendx/opendx.py Modified: 1.3/opendx/__init__.py Modified: 1.3/opendx/__init__.py URL: http://svn.gna.org/viewcvs/relax/1.3/opendx/__init__.py?rev=5751&r1=5750&r2=5751&view=diff ============================================================================== --- 1.3/opendx/__init__.py (original) +++ 1.3/opendx/__init__.py Wed Apr 16 14:40:42 2008 @@ -26,4 +26,4 @@ __all__ = ['base_map', 'isosurface_3D', - 'map'] + 'main'] Removed: 1.3/opendx/opendx.py URL: http://svn.gna.org/viewcvs/relax/1.3/opendx/opendx.py?rev=5750&view=auto ============================================================================== --- 1.3/opendx/opendx.py (original) +++ 1.3/opendx/opendx.py (removed) @@ -1,74 +1,0 @@ -############################################################################### -# # -# Copyright (C) 2003-2005, 2007-2008 Edward d'Auvergne # -# # -# This file is part of the program relax. # -# # -# relax is free software; you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# relax is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with relax; if not, write to the Free Software # -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# # -############################################################################### - -# Python module imports. -from os import system -from re import search - -# relax module imports. -from data import Data as relax_data_store -from isosurface_3D import Iso3D -from relax_errors import RelaxError, RelaxNoResError - - -def map(run=None, params=None, map_type='Iso3D', res_num=None, inc=20, lower=None, upper=None, axis_incs=10, file="map", dir="dx", point=None, point_file="point", remap=None): - """Function for mapping the given space and creating OpenDX files.""" - - # Residue index. - index = None - if res_num: - for i in xrange(len(relax_data_store.res[run])): - if relax_data_store.res[run][i].num == res_num: - index = i - break - if index == None: - raise RelaxNoResError, res_num - - # Space type. - if search("^[Ii]so3[Dd]", map_type): - if len(params) != 3: - raise RelaxError, "The 3D isosurface map requires a 3 parameter model." - - # Create the map. - self.iso3d.map_space(run, params, res_num, index, inc, lower, upper, axis_incs, file, dir, point, point_file, remap) - else: - raise RelaxError, "The map type '" + map_type + "' is not supported." - - -def run(file="map", dir="dx", dx_exe="dx", vp_exec=1): - """Function for running OpenDX.""" - - # Text for changing to the directory dir. - dir_text = "" - if dir != None: - dir_text = " -directory " + dir - - # Text for executing OpenDX. - execute_text = "" - if vp_exec: - execute_text = " -execute" - - # Test the binary file string corresponds to a valid executable. - self.relax.IO.test_binary(dx_exe) - - # Run OpenDX. - system(dx_exe + dir_text + " -program " + file + ".net" + execute_text + " &")