mailr24785 - /branches/r1rho_plotting/specific_analyses/relax_disp/data.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by tlinnet on July 28, 2014 - 15:56:
Author: tlinnet
Date: Mon Jul 28 15:56:54 2014
New Revision: 24785

URL: http://svn.gna.org/viewcvs/relax?rev=24785&view=rev
Log:
Added functionality to function to accept how the first part of the filename 
is formed.

This is to prepare to re-use the same plotting function.

sr #3124(https://gna.org/support/?3124): Grace graphs production for R1rho 
analysis with R2_eff as function of Omega_eff.
sr #3138(https://gna.org/support/?3138): Interpolating theta through 
spin-lock offset [Omega], rather than spin-lock field strength [w1].

Modified:
    branches/r1rho_plotting/specific_analyses/relax_disp/data.py

Modified: branches/r1rho_plotting/specific_analyses/relax_disp/data.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/r1rho_plotting/specific_analyses/relax_disp/data.py?rev=24785&r1=24784&r2=24785&view=diff
==============================================================================
--- branches/r1rho_plotting/specific_analyses/relax_disp/data.py        
(original)
+++ branches/r1rho_plotting/specific_analyses/relax_disp/data.py        Mon 
Jul 28 15:56:54 2014
@@ -1772,11 +1772,13 @@
     colour_order = [4, 15, 2, 13, 11, 1, 3, 5, 6, 7, 8, 9, 10, 12, 14] * 1000
 
     # Plot dispersion curves, extending over number of dispersion points.
-    plot_disp_curves_disp(dir=dir, num_points=num_points, extend=extend, 
force=force, proton_mmq_flag=proton_mmq_flag, colour_order=colour_order)
+    file_name_ini = "disp"
+    plot_disp_curves_disp(file_name_ini=file_name_ini, dir=dir, 
num_points=num_points, extend=extend, force=force, 
proton_mmq_flag=proton_mmq_flag, colour_order=colour_order)
 
     # For R1rho models, interpolate through spin-lock field strength, and 
plot R1rho R2 as function of effective field in rotating frame w_eff.
     if cdp.exp_type_list == [EXP_TYPE_R1RHO]:
-        plot_disp_curves_r1rho_r2_as_func_of_w_eff(dir=dir, 
num_points=num_points, extend=extend, force=force, 
proton_mmq_flag=proton_mmq_flag, colour_order=colour_order)
+        file_name_ini = "r1rho_r2_as_func_of_w_eff"
+        
plot_disp_curves_r1rho_r2_as_func_of_w_eff(file_name_ini=file_name_ini, 
dir=dir, num_points=num_points, extend=extend, force=force, 
proton_mmq_flag=proton_mmq_flag, colour_order=colour_order)
 
     # Write a python "grace to PNG/EPS/SVG..." conversion script.
     # Open the file for writing.
@@ -1796,11 +1798,13 @@
         chmod(file_name, S_IRWXU|S_IRGRP|S_IROTH)
 
 
-def plot_disp_curves_disp(dir=None, num_points=None, extend=None, 
force=None, proton_mmq_flag=None, colour_order=None):
+def plot_disp_curves_disp(file_name_ini=None, dir=None, num_points=None, 
extend=None, force=None, proton_mmq_flag=None, colour_order=None):
     """Custom 2D Grace plotting function for the dispersion curves, looping 
over dispersion points.
 
     One file will be created per spin system.
 
+    @keyword file_name_ini:     The first part of the file_name.
+    @type file_name_ini:        str
     @keyword dir:               The optional directory to place the file 
into.
     @type dir:                  str
     @keyword num_points:        The number of points to generate the 
interpolated fitted curves with.
@@ -1836,7 +1840,7 @@
         linestyle = []
 
         # The unique file name.
-        file_name = "disp%s.agr" % spin_id.replace('#', '_').replace(':', 
'_').replace('@', '_')
+        file_name = "%s%s.agr" % (file_name_ini, spin_id.replace('#', 
'_').replace(':', '_').replace('@', '_'))
 
         # Set up the interpolated curve data structures.
         interpolated_flag = False
@@ -1914,11 +1918,13 @@
         add_result_file(type='grace', label='Grace', file=file_path)
 
 
-def plot_disp_curves_r1rho_r2_as_func_of_w_eff(dir=None, num_points=None, 
extend=None, force=None, proton_mmq_flag=None, colour_order=None):
+def plot_disp_curves_r1rho_r2_as_func_of_w_eff(file_name_ini=None, dir=None, 
num_points=None, extend=None, force=None, proton_mmq_flag=None, 
colour_order=None):
     """Custom 2D Grace plotting function for the dispersion curves, 
interpolating theta through spin-lock offset rather than spin-lock field 
strength.
 
     One file will be created per spin system.
 
+    @keyword file_name_ini:     The first part of the file_name.
+    @type file_name_ini:        str
     @keyword dir:               The optional directory to place the file 
into.
     @type dir:                  str
     @keyword num_points:        The number of points to generate the 
interpolated fitted curves with.
@@ -1957,7 +1963,7 @@
         interpolated_flag = False
 
         # The unique file name.
-        file_name = "r1rho_r2_as_func_of_w_eff%s.agr" % spin_id.replace('#', 
'_').replace(':', '_').replace('@', '_')
+        file_name = "%s%s.agr" % (file_name_ini, spin_id.replace('#', 
'_').replace(':', '_').replace('@', '_'))
 
         if not spin.model in [MODEL_R2EFF]:
             # Interpolate through disp points.




Related Messages


Powered by MHonArc, Updated Mon Jul 28 16:00:02 2014