Hello,
In Analysis 2.2.1 there is a function that hopefully will do what you
want. It is defined in ccp/format/spectra/OpenSpectrum.py:
def openSpectrum(fileName, nmrProject=None, experiment=None,
experimentName=None, spectrumName=None):
so you might use it like:
from ccp.format.spectra.OpenSpectrum import openSpectrum
nmrProject = project.findFirstNmrProject()
spectrum = openSpectrum(fileName, nmrProject=nmrProject)
where project is the root (MemopsRoot) object. What this function does is
loop through the various alternative formats in some kind of order, so
normally it ought to work but if something is wrong it doesn't report much
of a sensible error message. On the other hand, if you know the format
then if you read the code for openSpectrum() hopefully you can figure out
what to do (if not let me know).
Wayne
On Thu, 15 Dec 2011, Jakob J. Lopez wrote:
> Hello,
>
> I would like to open an NMR spectrum in analysis, from the command line. Is this possible ?
>
> I realize I would probably have to give as input the coordinates of the
> spectrum files, what the format is, and probably which type NMR spectrum
> it is, or something similar.
>
> If analysis doesnt do this, ss there some kind of macro that might do
> this for me? I did look around in the tutorials and documentation, but I
> didn't find anything.
>
> Thanks for your time,
> Jakob
>
|