mailRe: r26787 - /branches/nmrglue/user_functions/spectrum.py


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

Header


Content

Posted by Edward d'Auvergne on November 27, 2014 - 17:44:
Hi Troels,

This looks perfect, well apart from the commented out description.  I
think that this would look a lot better with the nmrglue logo
(http://thread.gmane.org/gmane.science.nmr.relax.devel/7321/focus=7339,
http://www.nmrglue.com/images/nmrglue_logo.jpg) rather than my ugly
200 px Sparky spectrum screen dump ;)

Cheers,

Edward


On 27 November 2014 at 16:43,  <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet
Date: Thu Nov 27 16:43:24 2014
New Revision: 26787

URL: http://svn.gna.org/viewcvs/relax?rev=26787&view=rev
Log:
Added the user funcion spectrum.nmrglue_read to read spectrum files via 
nmrglue.

Task #7873 (https://gna.org/task/index.php?7873): Write wrapper function to 
nmrglue, to read .ft2 files and process them.
Homepage: http://www.nmrglue.com/
Link to nmrglue discussion: 
https://groups.google.com/forum/#!forum/nmrglue-discuss
The code is develop at Github: https://github.com/jjhelmus/nmrglue/
Google code: https://code.google.com/p/nmrglue/
Documentation: http://nmrglue.readthedocs.org/en/latest/index.html

Modified:
    branches/nmrglue/user_functions/spectrum.py

Modified: branches/nmrglue/user_functions/spectrum.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/nmrglue/user_functions/spectrum.py?rev=26787&r1=26786&r2=26787&view=diff
==============================================================================
--- branches/nmrglue/user_functions/spectrum.py (original)
+++ branches/nmrglue/user_functions/spectrum.py Thu Nov 27 16:43:24 2014
@@ -33,7 +33,7 @@

 # relax module imports.
 from graphics import WIZARD_IMAGE_PATH
-from pipe_control import spectrum
+from pipe_control import nmrglue, spectrum
 from user_functions.data import Uf_info; uf_info = Uf_info()
 from user_functions.data import Uf_tables; uf_tables = Uf_tables()
 from user_functions.objects import Desc_container
@@ -213,6 +213,52 @@
 uf.wizard_image = WIZARD_IMAGE_PATH + 'spectrum' + sep + 'spectrum_200.png'


+# The spectrum.nmrglue_read user function.
+uf = uf_info.add_uf('spectrum.nmrglue_read')
+uf.title = "Read spectrum with nmrglue."
+uf.title_short = "spectrum reading."
+uf.add_keyarg(
+    name = "file",
+    py_type = "str_or_str_list",
+    arg_type = "file sel multi",
+    desc_short = "file name(s)",
+    desc = "The name of the file or the list of files containing the 
intensity data.",
+    wiz_filesel_wildcard = WILDCARD_SPECTRUM_PEAKLIST,
+    wiz_filesel_style = FD_OPEN
+)
+uf.add_keyarg(
+    name = "dir",
+    py_type = "str",
+    arg_type = "dir",
+    desc_short = "directory name",
+    desc = "The directory where the file is located.",
+    can_be_none = True
+)
+uf.add_keyarg(
+    name = "spectrum_id",
+    py_type = "str_or_str_list",
+    desc_short = "spectrum ID string",
+    desc = "The unique spectrum ID string or list of strings to associate 
with the peak intensity values.  If multiple files are given, then each 
file should have a corresponding spectrum ID string.  If 'auto' is provided 
for a NMRPipe seriesTab formatted file, the IDs are auto generated in form 
of Z_A{i}."
+)
+# Description.
+uf.desc.append(Desc_container())
+uf.desc[-1].add_paragraph("Read spectrum with nmrglue.")
+## File formats.
+#uf.desc.append(Desc_container("File formats"))
+#uf.desc[-1].add_paragraph("The peak list or intensity file will be 
automatically determined.")
+#uf.desc.append(Desc_container("Multiple files"))
+#uf.desc[-1].add_paragraph("The data from multiple files can be loaded 
simultaneously if a list of files is supplied.  In this case, a list of 
spectrum ID strings of equal length must be supplied.")
+## Prompt examples.
+#uf.desc.append(Desc_container("Prompt examples"))
+#uf.desc[-1].add_paragraph("To read the reference and saturated spectra 
peak heights from the Sparky formatted files 'ref.list' and 'sat.list', 
type:")
+uf.backend = nmrglue.read
+uf.menu_text = "&nmrglue_read"
+uf.gui_icon = "oxygen.actions.document-open"
+uf.wizard_height_desc = 300
+uf.wizard_size = (1000, 750)
+uf.wizard_image = WIZARD_IMAGE_PATH + 'spectrum' + sep + 'spectrum_200.png'
+
+
 # The spectrum.read_intensities user function.
 uf = uf_info.add_uf('spectrum.read_intensities')
 uf.title = "Read peak intensities from a file."


_______________________________________________
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



Related Messages


Powered by MHonArc, Updated Thu Nov 27 18:20:14 2014