Closed kaustubhmote closed 5 years ago
@kaustubhmote This is really neat. I don't know they best location for this file in nmrglue but for the time being nmrglue/util seems fine.
Thanks! I actually thought I will have time for a couple of additions to improve the usability a bit before this is merged. I'll open a separate PR for that then.
Bruker-Topspin now being freely available under an academic licence, this is a feature request that comes up often for me, and has popped up on the
nmrglue-discuss
group as well. The filexcpy.py
, which is included in thenmrglue/util
folder, will allow the use of nmrglue (and any other cpython script) from within Topspin. It is a lightly polished version of what has been sitting in one of my repositories for sometime now, and takes some suggestions from the nmrglue-discuss thread. This should go nicely with the ability of nmrglue to read and write (#85, #88) bruker datasets, and also with the philosophy of nmrglue of being the 'glue'. I am including a simple "Hello World" script as well (xcpy_test.py), but some real world examples can be found here.The documentation on how to use this file are given in the file docstring itself. The TLDR version is: Copy or symlink is the directory where your topspin is located. If you now type
xcpy.py
to the<topspin>/exp/stan/nmr/py/user
directory, wherexcpy
orxcpy -h
from within Topspin, the documentation should pop up and is hopefully self-explanatory regarding the various options and initial set up.A simple GIF on how this should look like:
This approach is, of course, not restricted to
nmrglue
; other programs likenmrpipe
,matnmr
, etc can all be accessed from within Topspin in a similar fashion (xcpy uses thesubprocess
module of the internal Jython to call an external script). I am inclined to start with just this, and see whether any bugs pop up before including other things in there. Currently, this is tested with Linux and Windows, and Topspin 3.6 and 4.0.