Author: bugman Date: Thu Sep 12 18:39:21 2013 New Revision: 20990 URL: http://svn.gna.org/viewcvs/relax?rev=20990&view=rev Log: Started to create the relax_disp.catia_input user function. The frontend has been written and a stub of a function for the backend. The new specific_analyses.relax_disp.catia module has been created for this. Added: branches/relax_disp/specific_analyses/relax_disp/catia.py Modified: branches/relax_disp/specific_analyses/relax_disp/__init__.py branches/relax_disp/user_functions/relax_disp.py Modified: branches/relax_disp/specific_analyses/relax_disp/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/__init__.py?rev=20990&r1=20989&r2=20990&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/__init__.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/__init__.py Thu Sep 12 18:39:21 2013 @@ -26,6 +26,7 @@ # The available modules. __all__ = [ 'api', + 'catia', 'checks', 'cpmgfit', 'disp_data', Added: branches/relax_disp/specific_analyses/relax_disp/catia.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/catia.py?rev=20990&view=auto ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/catia.py (added) +++ branches/relax_disp/specific_analyses/relax_disp/catia.py Thu Sep 12 18:39:21 2013 @@ -1,0 +1,51 @@ +############################################################################### +# # +# Copyright (C) 2013 Edward d'Auvergne # +# # +# This file is part of the program relax (http://www.nmr-relax.com). # +# # +# This program 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 3 of the License, or # +# (at your option) any later version. # +# # +# This program 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 this program. If not, see <http://www.gnu.org/licenses/>. # +# # +############################################################################### + +# Module docstring. +"""Functions for interfacing with Flemming Hansen's CATIA program.""" + +# relax module imports. +from lib.io import mkdir_nofail +from pipe_control import pipes +from pipe_control.mol_res_spin import check_mol_res_spin_data +from specific_analyses.relax_disp.checks import check_model_type, check_spectra_id_setup + + +def catia_input(file='Fit.catia', dir=None, force=False): + """Create the CATIA input files. + + @keyword file: The main CATIA execution file. + @type file: str + @keyword dir: The optional directory to place the files into. If None, then the files will be placed into the current directory. + @type dir: str or None + @keyword force: A flag which if True will cause all pre-existing files to be overwritten. + @type force: bool + """ + + # Data checks. + pipes.test() + check_mol_res_spin_data() + check_spectra_id_setup() + check_model_type() + + # Directory creation. + if dir != None: + mkdir_nofail(dir, verbosity=0) Modified: branches/relax_disp/user_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/user_functions/relax_disp.py?rev=20990&r1=20989&r2=20990&view=diff ============================================================================== --- branches/relax_disp/user_functions/relax_disp.py (original) +++ branches/relax_disp/user_functions/relax_disp.py Thu Sep 12 18:39:21 2013 @@ -36,6 +36,7 @@ from graphics import ANALYSIS_IMAGE_PATH, WIZARD_IMAGE_PATH from pipe_control import pipes, spectrum from pipe_control.mol_res_spin import get_spin_ids +from specific_analyses.relax_disp.catia import catia_input from specific_analyses.relax_disp.cpmgfit import cpmgfit_execute, cpmgfit_input from specific_analyses.relax_disp.disp_data import cpmg_frq, exp_type, plot_disp_curves, plot_exp_curves, relax_time, spin_lock_field, spin_lock_offset from specific_analyses.relax_disp.nessy import nessy_input @@ -52,6 +53,36 @@ uf_class.title = "Class for relaxation curve fitting." uf_class.menu_text = "&relax_disp" uf_class.gui_icon = "relax.relax_disp" + + +# The relax_disp.catia_input user function. +uf = uf_info.add_uf('relax_disp.catia_input') +uf.title = "Create the input files for Flemming Hansen's CATIA program." +uf.title_short = "CATIA input file creation." +uf.add_keyarg( + name = "dir", + default = "catia", + py_type = "str", + arg_type = "dir sel", + desc_short = "directory name", + desc = "The directory to place the CATIA input files, output directory, etc.", + can_be_none = True +) +uf.add_keyarg( + name = "force", + default = False, + py_type = "bool", + desc_short = "force flag", + desc = "A flag which if set to True will cause the files to be overwritten if they already exist." +) +# Description. +uf.desc.append(Desc_container()) +uf.desc[-1].add_paragraph("This will create all of the input file required for CATIA as well as the CATIA results output directory.") +uf.backend = catia_input +uf.menu_text = "&catia_input" +uf.wizard_size = (800, 600) +uf.wizard_apply_button = False +uf.wizard_image = ANALYSIS_IMAGE_PATH + 'relax_disp_200x200.png' # The relax_disp.cluster user function.