From 521c4776235df6642a99a61b29519e0fcaab3466 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Tue, 6 Dec 2022 23:01:30 +0100 Subject: [PATCH] Delete trailing spaces at end-of-line --- INSTALL.txt | 8 +- LICENSE.txt | 4 +- README.rst | 6 +- TODO.txt | 28 +-- doc/README.txt | 2 +- doc/source/_static/scipy.css | 44 ++--- doc/source/devel/index.rst | 92 +++++----- doc/source/examples/agilent2pipe_1d.rst | 2 +- doc/source/examples/agilent2pipe_2d.rst | 2 +- doc/source/examples/agilent2pipe_2d_tppi.rst | 6 +- doc/source/examples/agilent2pipe_3d.rst | 2 +- doc/source/examples/apod_viewer_1win.rst | 10 +- doc/source/examples/apod_viewer_2win.rst | 12 +- doc/source/examples/bruker2pipe_1d.rst | 4 +- doc/source/examples/bruker2pipe_2d.rst | 4 +- doc/source/examples/bruker2pipe_3d.rst | 4 +- doc/source/examples/coadd_1d_pipe.rst | 6 +- doc/source/examples/coadd_2d_pipe.rst | 6 +- doc/source/examples/coadd_pseudo3d_pipe.rst | 10 +- doc/source/examples/fitting_t1_data.rst | 20 +- doc/source/examples/index.rst | 2 +- doc/source/examples/integrate_1d.rst | 4 +- doc/source/examples/integrate_2d.rst | 8 +- doc/source/examples/interactive_1d.rst | 8 +- doc/source/examples/interactive_2d.rst | 10 +- doc/source/examples/peakpick.rst | 3 +- doc/source/examples/pipe2sparky_2d.rst | 4 +- doc/source/examples/pipe2sparky_3d.rst | 4 +- doc/source/examples/plot_1d_freq.rst | 6 +- doc/source/examples/plot_1d_time.rst | 4 +- doc/source/examples/plot_2d_assignments.rst | 4 +- doc/source/examples/plot_2d_boxes.rst | 6 +- doc/source/examples/plot_2d_spectrum.rst | 8 +- doc/source/examples/plot_2d_spectrum_pts.rst | 6 +- doc/source/examples/process_pipe_1d.rst | 6 +- doc/source/examples/process_pipe_2d.rst | 8 +- doc/source/examples/process_pipe_2d_tppi.rst | 6 +- doc/source/examples/process_pipe_3d.rst | 8 +- doc/source/examples/separate_1d_varian.rst | 8 +- doc/source/examples/separate_2d_bruker.rst | 12 +- doc/source/examples/separate_2d_varian.rst | 12 +- doc/source/examples/simulate_ucsf.rst | 3 +- doc/source/install.rst | 14 +- doc/source/jbnmr_examples/index.rst | 8 +- .../s10_covariance_processing.rst | 2 +- .../jbnmr_examples/s1_sparky_to_nmrpipe.rst | 2 +- .../jbnmr_examples/s2_s3_1d_plotting.rst | 4 +- doc/source/jbnmr_examples/s4_2d_plotting.rst | 2 +- .../s5_seperate_interleaved.rst | 2 +- .../s6_seperate_inner_phase.rst | 2 +- .../jbnmr_examples/s7-s9_s3e_processing.rst | 2 +- doc/source/reference/analysisbase.rst | 4 +- doc/source/reference/fileiobase.rst | 4 +- doc/source/reference/index.rst | 6 +- doc/source/reference/linesh.rst | 7 +- doc/source/reference/lineshapes1d.rst | 3 +- doc/source/reference/misc.rst | 3 +- doc/source/reference/peakpick.rst | 7 +- doc/source/reference/pipe.rst | 14 +- doc/source/reference/pipe_proc.rst | 4 +- doc/source/reference/proc_base.rst | 1 - doc/source/reference/proc_lp.rst | 4 +- doc/source/reference/rnmrtk.rst | 4 +- doc/source/reference/segmentation.rst | 6 +- doc/source/reference/simpson.rst | 2 +- doc/source/reference/sparky.rst | 12 +- doc/source/reference/spinsolve.rst | 1 - doc/source/reference/table.rst | 5 +- doc/source/reference/varian.rst | 10 +- doc/source/reference/xcpy.rst | 13 +- doc/source/tutorial.rst | 172 +++++++++--------- examples/bruker_data/README.rst | 18 +- .../bruker_processed_1d/dig_filter_remove.py | 3 +- .../coadd_pseudo3d_pipe/coadd_pseudo3d.py | 8 +- .../agilent2pipe_1d/agilent2pipe_1d.py | 1 - .../agilent2pipe_2d/agilent2pipe_2d.py | 4 +- .../agilent2pipe_2d_tppi.py | 4 +- .../convert/bruker2pipe_2d/bruker2pipe_2d.py | 4 +- .../convert/pipe2sparky_2d/pipe2sparky_2d.py | 2 +- .../convert/pipe2sparky_3d/pipe2sparky_3d.py | 2 +- .../interactive_2d/2d_interactive.py | 2 +- .../jbnmr_examples/s11_strip_plots/README.rst | 2 +- .../s11_strip_plots/make_strip_plots.py | 30 +-- .../s12-s15_relaxation_analysis/README.rst | 11 +- .../s12-s15_relaxation_analysis/fit_exp.py | 6 +- .../s12-s15_relaxation_analysis/plot_boxes.py | 2 +- .../plot_trajectories.py | 4 +- .../s2_s3_1d_plotting/README.rst | 6 +- .../jbnmr_examples/s4_2d_plotting/README.rst | 4 +- .../s5_seperate_interleaved/README.rst | 2 +- .../s6_seperate_inner_phase/README.rst | 2 +- .../s7-s9_s3e_processing/README.rst | 10 +- examples/peak_picking/2d_picking.py | 1 - .../plotting/plot_1d/plot_1d_pipe_freq.py | 4 +- examples/plotting/plot_2d/plot_assignments.py | 4 +- examples/plotting/plot_2d/plot_spectrum.py | 4 +- .../plotting/plot_2d/plot_spectrum_pts.py | 4 +- .../plot_sparky_savefile/plot_sparky.py | 2 +- examples/processing/process_pipe_3d.py | 4 +- .../sample_applications/apod_viewer_1win.py | 28 +-- .../sample_applications/apod_viewer_2win.py | 26 +-- .../separate/separate_1d_varian/separate.py | 2 +- .../separate/separate_2d_bruker/separate.py | 2 +- .../separate/separate_2d_varian/separate.py | 4 +- nmrglue/analysis/leastsqbound.py | 2 +- nmrglue/fileio/pipe.py | 4 +- nmrglue/fileio/sparky.py | 8 +- nmrglue/fileio/spinsolve.py | 10 +- nmrglue/util/xcpy.py | 2 +- nmrglue/util/xcpy_test.py | 2 +- 110 files changed, 472 insertions(+), 500 deletions(-) diff --git a/INSTALL.txt b/INSTALL.txt index fc3d30bc..e829cc72 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -5,21 +5,21 @@ Installation Guide Where to get nmrglue -------------------- -Downloads for all platforms are available at +Downloads for all platforms are available at ``_. Tar files are available for UNIX-like systems (Linux or OSX) and a binary installer for Windows. Requirements ------------ -nmrglue requires `numpy `_ and -`scipy `_ to be installed. Please see the install +nmrglue requires `numpy `_ and +`scipy `_ to be installed. Please see the install instructions for these packages for details. Unix/OSX Installation --------------------- -After installing the above dependencies download and extract the source +After installing the above dependencies download and extract the source distribution and run:: $ python setup.py install diff --git a/LICENSE.txt b/LICENSE.txt index f76fe2f6..b8f465b4 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -20,8 +20,8 @@ b. Redistributions in binary form must reproduce the above copyright distribution. -c. Neither the name of the author nor the names of contributors may - be used to endorse or promote products derived from this software +c. Neither the name of the author nor the names of contributors may + be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/README.rst b/README.rst index b294c01a..ba530bf8 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ ======= -nmrglue +nmrglue ======= What is nmrglue? @@ -25,13 +25,13 @@ nmrglue has the ability to read, write and convert between a number of common NMR file formats including Varian, Bruker, NMRPipe, and Sparky files. The files, which are represented in python as dictionaries of spectral parameters and Numpy array objects, can be easily examined, modified and processed as -desired. +desired. nmrglue provides a number of common functions for processing NMR data such as apodization, spectral shifting, Fourier and other transformations, baseline smoothing and flattening, and linear prediction. In addition new processing schemes can be implemented easily using the nmrglue provided functions and the -multitude of numerical routines provided by the Numpy and Scipy packages. +multitude of numerical routines provided by the Numpy and Scipy packages. When used in conjunction with the matplotlib (or other) python plotting library nmrglue can be used to create publication quality figures of NMR diff --git a/TODO.txt b/TODO.txt index 45ab65eb..047ac2d6 100644 --- a/TODO.txt +++ b/TODO.txt @@ -21,7 +21,7 @@ nmrglue - sparky_nd object? or dimension agnostic functions? - spinev module? - gui? + gui? ---- - gui module with common gui functions? @@ -45,19 +45,19 @@ test Module Notes ------ ------ -fileiobase Tested -glue Not currently imported -table -proc_base Partially tested with pipe_proc test +fileiobase Tested +glue Not currently imported +table +proc_base Partially tested with pipe_proc test proc_bl Partially tested with pipe_proc test proc_lp Partially tested with pipe_proc test -analysisbase No tests needed -helpers -leastsqbound -lineshapes1d -linesh -peakpick -segmentation +analysisbase No tests needed +helpers +leastsqbound +lineshapes1d +linesh +peakpick +segmentation misc - Check coverage on current tests, get to 80%+ @@ -67,9 +67,9 @@ misc doc --- -- Rewrite tutorial including a mention of analysis modules. +- Rewrite tutorial including a mention of analysis modules. - pipe_proc: Add References to low level function / better description -- proc_base : Additional documentation, indication which functions work on +- proc_base : Additional documentation, indication which functions work on arbitrary dimensional data. - proc_bl : Flesh out the sol_* functions? - helpers : Better documentation, examples? diff --git a/doc/README.txt b/doc/README.txt index 257953b0..3c91dd76 100644 --- a/doc/README.txt +++ b/doc/README.txt @@ -21,7 +21,7 @@ Instructions 3. Run ``make html``. in this directory. -The html documentation should be stored in the build/html directory. +The html documentation should be stored in the build/html directory. ReadTheDocs diff --git a/doc/source/_static/scipy.css b/doc/source/_static/scipy.css index 89984b67..645c765e 100644 --- a/doc/source/_static/scipy.css +++ b/doc/source/_static/scipy.css @@ -8,7 +8,7 @@ div.body p, div.body dd, div.body li { line-height: 125%; } -ul.simple { +ul.simple { margin-top: 0; margin-bottom: 0; padding-top: 0; @@ -39,22 +39,22 @@ div.sphinxsidebarwrapper p.topless { } /** - * Hide dummy toctrees + * Hide dummy toctrees */ -ul { +ul { padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; } -ul li { +ul li { padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; } -ul li a.reference { +ul li a.reference { padding-top: 0; padding-bottom: 0; margin-top: 0; @@ -64,24 +64,24 @@ ul li a.reference { /** * Make high-level subsections easier to distinguish from top-level ones */ -div.body h3 { +div.body h3 { background-color: transparent; } -div.body h4 { +div.body h4 { border: none; background-color: transparent; } -/** +/** * Scipy colors */ -body { +body { background-color: rgb(100,135,220); } -div.document { +div.document { background-color: rgb(230,230,230); } @@ -122,8 +122,8 @@ div.sphinxsidebar ul.want-points { white-space: nowrap; } -/** - * Extra admonitions +/** + * Extra admonitions */ div.tip { @@ -131,18 +131,18 @@ div.tip { border: 1px solid #ee6; } -div.plot-output { +div.plot-output { clear-after: both; } -div.plot-output .figure { +div.plot-output .figure { float: left; text-align: center; margin-bottom: 0; padding-bottom: 0; } -div.plot-output .caption { +div.plot-output .caption { margin-top: 2; padding-top: 0; } @@ -151,11 +151,11 @@ div.plot-output p.admonition-title { display: none; } -div.plot-output:after { - content: ""; - display: block; - height: 0; - clear: both; +div.plot-output:after { + content: ""; + display: block; + height: 0; + clear: both; } @@ -175,12 +175,12 @@ table.field-list th { padding-left: 5px; } -table.field-list { +table.field-list { border-collapse: separate; border-spacing: 10px; } -/** +/** * Styling for footnotes */ diff --git a/doc/source/devel/index.rst b/doc/source/devel/index.rst index c0e559c7..9d204bec 100644 --- a/doc/source/devel/index.rst +++ b/doc/source/devel/index.rst @@ -24,17 +24,17 @@ and available. * `git `_ -In addition the following Python packages are highly recommended. +In addition the following Python packages are highly recommended. * `matplotlib `_ * `IPython `_ -A easy way of obtaining and installing these packages is to use a Python +A easy way of obtaining and installing these packages is to use a Python distribution which provides these packages, such as `Anaconda/Miniconda `_. Detailed information on `installing a Scipy stack `_ is available. -Finally, other NMR software packages must be installed to process and convert +Finally, other NMR software packages must be installed to process and convert the test and example data. These are not required for using nmrglue, but are needed to verify its functionality and to run some of the examples. @@ -52,51 +52,51 @@ Source Code ----------- nmrglue uses `github `_ for source code hosting. For access -to the source code, see the +to the source code, see the `nmrglue github `_ site. To check out the latest version of nmrglue use git:: - + git clone git://github.com/jjhelmus/nmrglue.git nmrglue is a pure python module, the root directory can be included in your PYTHONPATH directly, or a symbolic link can be added to the *site-packages* directory of your Python install. In this way any modifications to the nmrglue -source tree will be picked up when nmrglue is imported. +source tree will be picked up when nmrglue is imported. -Test and Example Data +Test and Example Data --------------------- nmrglue uses experimental and simulated NMR data for testing and in many -examples, this data is divided into two archives, the test data set and -additional data needed for the examples. +examples, this data is divided into two archives, the test data set and +additional data needed for the examples. .. _test_data: The nmrglue test data sets must be downloaded and unpacked into a directory (a directory named ``data`` under the root directory is recommended but not required). The conversions scripts contained in the archive must be run to -convert and process the time domain NMR data. Additional NMR software -(NMRPipe, etc) are requires for this processing and conversion, see the +convert and process the time domain NMR data. Additional NMR software +(NMRPipe, etc) are requires for this processing and conversion, see the ``README`` file in the test data archive for details. After installing this test data edit the ``setup.py`` file in the ``test`` directory and the -``make_links.sh`` file in the ``examples`` directory to correctly point to the -location of the test data directory. +``make_links.sh`` file in the ``examples`` directory to correctly point to the +location of the test data directory. .. _`nmrglue test data`: http://code.google.com/p/nmrglue/downloads/list?q=label:Test-Data .. _example_data: -Additional data required for the nmrglue examples can be downloaded as a -`single archive -`_. +Additional data required for the nmrglue examples can be downloaded as a +`single archive +`_. Unpack this archive in the ``examples`` directory. Run the ``make_links.sh`` shell script to make symbolic links to the test data which reused in a number of example. On operating systems which do not support -symbolic links (Windows), the data in the test data directory will need to be -copied by hand into the appropriate locations. +symbolic links (Windows), the data in the test data directory will need to be +copied by hand into the appropriate locations. Project Layout @@ -107,9 +107,9 @@ The directory layout of the nmrglue project is as follows. * ``nmrglue`` : source code for the project. * ``doc`` : contains the setup file and source code for building the - nmrglue documentation using `Sphinx `__. + nmrglue documentation using `Sphinx `__. -* ``tests`` : unit tests which use the +* ``tests`` : unit tests which use the `nose `_ framework to verify the functionality of nmrglue. See the :ref:`testing` section for details. @@ -118,42 +118,42 @@ The directory layout of the nmrglue project is as follows. Two additional directories can be created to aid in developments. These are -not required but will be ignored by git using the default ``.gitignore`` file +not required but will be ignored by git using the default ``.gitignore`` file * ``data`` : Suggested location to hold the :ref:`test data `. * ``sandbox`` : Suggested location to store code, data, etc not yet ready to be - include in nmrglue. + include in nmrglue. Suggestions ----------- When working with the nmrglue source code please consider the following when -preparing patches. +preparing patches. -* Coding Style : The nmrglue source code tries to follow the - `PEP8 `_ style guide. Consider - using a tool, such as `pep8 `__ or - `pylint `_ to check your Python code against +* Coding Style : The nmrglue source code tries to follow the + `PEP8 `_ style guide. Consider + using a tool, such as `pep8 `__ or + `pylint `_ to check your Python code against these conventions. * Documentation : All public functions and classes should have a docstring which - follows the `NumPy/SciPy documentation standard - `_. - Private functions and classes may have shorter dostrings. The nmrglue - documentation is build using `Sphinx `__. Sphinx - translates `reST `_ formatted + follows the `NumPy/SciPy documentation standard + `_. + Private functions and classes may have shorter dostrings. The nmrglue + documentation is build using `Sphinx `__. Sphinx + translates `reST `_ formatted documents (including docstring) into html. When adding new functions, classes or parameters to nmrglue please update the docstring and make any necessary changes to the Sphinx files in the doc directory. - + * :ref:`testing` : Tests are available for verifying the functionality of nmrglue, please include a tests when adding new functionality to the package. * Examples : Numerous examples showing real world use of nmrglue are provided in the ``examples`` directory. Contributions of additional example are welcome - and appreciated. + and appreciated. .. _testing: @@ -173,23 +173,23 @@ Requirements To run these tests NumPy, SciPy, nmrglue, and nose must be installed and in the Python search path. NMRPipe must be installed to run the pipe_proc tests. -In addition, the location of the the test data sets must be specified in the -``setup.py`` file in the test directory. The `nmrglue test data`_ is available for download. +In addition, the location of the the test data sets must be specified in the +``setup.py`` file in the test directory. The `nmrglue test data`_ is available for download. .. _`nmrglue test data`: http://code.google.com/p/nmrglue/downloads/list?q=label:Test-Data -In order to run all nmrglue unit tests, the tests data sets must be +In order to run all nmrglue unit tests, the tests data sets must be downloaded, unpacked, and the all conversions scripts contained in the -archive must be run. Many of these scripts require additional NMR software -(NMRPipe, etc), see the ``README`` file in the test data archive for additional -details. A subset of the full test suite can be run without installing any +archive must be run. Many of these scripts require additional NMR software +(NMRPipe, etc), see the ``README`` file in the test data archive for additional +details. A subset of the full test suite can be run without installing any additional software. Running the unit tests ^^^^^^^^^^^^^^^^^^^^^^ -After ensuring that all required packages are installed and ``setup.py`` +After ensuring that all required packages are installed and ``setup.py`` correctly points to the location of the test data directory, the unit tests can be run using the following:: @@ -208,7 +208,7 @@ Reporting Bugs The preferred location for submitting feature requests and reporting bugs is the `github issue tracker `_. -Reports are also welcomed on the +Reports are also welcomed on the `nmrglue mailing list `_ or by contacting `Jonathan Helmus `_ directly. @@ -216,10 +216,10 @@ Contributions ------------- Contribution of source code or examples to nmrglue is welcomed provided the -contents can be distributed under the -`New BSD License `_. The +contents can be distributed under the +`New BSD License `_. The preferred method for contributing is by creating a feature branch on a github fork of nmrglue and submitting a pull request, although patches are also -accepted. Refer to the Numpy/SciPy +accepted. Refer to the Numpy/SciPy `git workflow `_ for -details on how to prepare a patch or submit a pull request. +details on how to prepare a patch or submit a pull request. diff --git a/doc/source/examples/agilent2pipe_1d.rst b/doc/source/examples/agilent2pipe_1d.rst index e6bd522f..5f01b00d 100644 --- a/doc/source/examples/agilent2pipe_1d.rst +++ b/doc/source/examples/agilent2pipe_1d.rst @@ -6,7 +6,7 @@ convert example: agilent2pipe_1d This example shows how to use nmrglue to convert a 1D Agilent/Varian data set into a NMRPipe file. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/convert/agilent2pipe_1d/agilent2pipe_1d.py>`] diff --git a/doc/source/examples/agilent2pipe_2d.rst b/doc/source/examples/agilent2pipe_2d.rst index f9028431..74f82f7c 100644 --- a/doc/source/examples/agilent2pipe_2d.rst +++ b/doc/source/examples/agilent2pipe_2d.rst @@ -6,7 +6,7 @@ convert example: agilent2pipe_2d This example shows how to use nmrglue to convert a 2D Agilent/Varian data set into a NMRPipe file. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/convert/agilent2pipe_2d/agilent2pipe_2d.py>`] diff --git a/doc/source/examples/agilent2pipe_2d_tppi.rst b/doc/source/examples/agilent2pipe_2d_tppi.rst index cca9eca8..f62e30df 100644 --- a/doc/source/examples/agilent2pipe_2d_tppi.rst +++ b/doc/source/examples/agilent2pipe_2d_tppi.rst @@ -3,10 +3,10 @@ convert example: agilent2pipe_2d_tppi ===================================== -This example shows how to use nmrglue to convert between the 2D Agilent/Varian -data set collected using TPPI in the indirect dimension into a NMRPipe file. +This example shows how to use nmrglue to convert between the 2D Agilent/Varian +data set collected using TPPI in the indirect dimension into a NMRPipe file. -The data used in this example is available for +The data used in this example is available for `download. `_ diff --git a/doc/source/examples/agilent2pipe_3d.rst b/doc/source/examples/agilent2pipe_3d.rst index 5b0db410..f71dbb79 100644 --- a/doc/source/examples/agilent2pipe_3d.rst +++ b/doc/source/examples/agilent2pipe_3d.rst @@ -6,7 +6,7 @@ convert example: agilent2pipe_3d This example shows how to use nmrglue to convert a 3D Agilent/Varian data set into a NMRPipe file. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/convert/agilent2pipe_3d/agilent2pipe_3d.py>`] diff --git a/doc/source/examples/apod_viewer_1win.rst b/doc/source/examples/apod_viewer_1win.rst index c88a45d5..fff31878 100644 --- a/doc/source/examples/apod_viewer_1win.rst +++ b/doc/source/examples/apod_viewer_1win.rst @@ -3,17 +3,17 @@ application example: apod_viewer_1win ===================================== -This is a sample GUI application showing how nmrglue can be used with -additional python modules like -`matplotlib `_ and +This is a sample GUI application showing how nmrglue can be used with +additional python modules like +`matplotlib `_ and `wxPython `_ to create full fledged NMR applications. -In this application users can examine graphically the apodization windows +In this application users can examine graphically the apodization windows produced by the various window functions supported by NMRPipe. In this example the canvas in which the apodization windows are drawn and the location to input the apodization parameter are contained in the same window. The :ref:`apod_viewer_2win` example has the canvas and input area in separate -windows. +windows. [:download:`source code <../../../examples/sample_applications/apod_viewer_1win.py>`] diff --git a/doc/source/examples/apod_viewer_2win.rst b/doc/source/examples/apod_viewer_2win.rst index 36de90db..265f115b 100644 --- a/doc/source/examples/apod_viewer_2win.rst +++ b/doc/source/examples/apod_viewer_2win.rst @@ -3,17 +3,17 @@ application example: apod_viewer_2win ===================================== -This is a sample GUI application showing how nmrglue can be used with -additional python modules like -`matplotlib `_ and +This is a sample GUI application showing how nmrglue can be used with +additional python modules like +`matplotlib `_ and `wxPython `_ to create full fledged NMR applications. -In this application users can examine graphically the apodization windows +In this application users can examine graphically the apodization windows produced by the various window functions supported by NMRPipe. In this example the canvas in which the apodization windows are drawn and the location to input the apodization parameter are contained in two separate same window. The -:ref:`apod_viewer_1win` example has the canvas and input area in a single -window. +:ref:`apod_viewer_1win` example has the canvas and input area in a single +window. [:download:`source code <../../../examples/sample_applications/apod_viewer_2win.py>`] diff --git a/doc/source/examples/bruker2pipe_1d.rst b/doc/source/examples/bruker2pipe_1d.rst index 804e0bdd..e63ca192 100644 --- a/doc/source/examples/bruker2pipe_1d.rst +++ b/doc/source/examples/bruker2pipe_1d.rst @@ -3,10 +3,10 @@ convert example: bruker2pipe_1d =============================== -This example shows how to use nmrglue to convert a 1D Bruker data set into a +This example shows how to use nmrglue to convert a 1D Bruker data set into a NMRPipe file. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/convert/bruker2pipe_1d/bruker2pipe_1d.py>`] diff --git a/doc/source/examples/bruker2pipe_2d.rst b/doc/source/examples/bruker2pipe_2d.rst index 954fbd04..da4cedc7 100644 --- a/doc/source/examples/bruker2pipe_2d.rst +++ b/doc/source/examples/bruker2pipe_2d.rst @@ -3,10 +3,10 @@ convert example: bruker2pipe_2d =============================== -This example shows how to use nmrglue to convert a 2D Bruker data set into a +This example shows how to use nmrglue to convert a 2D Bruker data set into a NMRPipe file. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/convert/bruker2pipe_2d/bruker2pipe_2d.py>`] diff --git a/doc/source/examples/bruker2pipe_3d.rst b/doc/source/examples/bruker2pipe_3d.rst index e44ecd87..5544af10 100644 --- a/doc/source/examples/bruker2pipe_3d.rst +++ b/doc/source/examples/bruker2pipe_3d.rst @@ -3,10 +3,10 @@ convert example: bruker2pipe_3d =============================== -This example shows how to use nmrglue to convert a 3D Bruker data set into a +This example shows how to use nmrglue to convert a 3D Bruker data set into a NMRPipe file. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/convert/bruker2pipe_3d/bruker2pipe_3d.py>`] diff --git a/doc/source/examples/coadd_1d_pipe.rst b/doc/source/examples/coadd_1d_pipe.rst index 79a97d0d..f2d8c9a9 100644 --- a/doc/source/examples/coadd_1d_pipe.rst +++ b/doc/source/examples/coadd_1d_pipe.rst @@ -4,10 +4,10 @@ coadd example: coadd_1d_pipe ============================ This example shows how to use nmrglue to coadd a series of 1D NMRPipe files. -All files matching the ``test*.fid`` pattern will be coadded into a file -named ``coadded.fid``. +All files matching the ``test*.fid`` pattern will be coadded into a file +named ``coadded.fid``. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/coadd/coadd_1d_pipe/coadd_1d.py>`] diff --git a/doc/source/examples/coadd_2d_pipe.rst b/doc/source/examples/coadd_2d_pipe.rst index 240110f7..e4780a71 100644 --- a/doc/source/examples/coadd_2d_pipe.rst +++ b/doc/source/examples/coadd_2d_pipe.rst @@ -4,10 +4,10 @@ coadd example: coadd_2d_pipe ============================ This example shows how to use nmrglue to coadd a series of 2d NMRPipe files. -All files matching the ``test*.fid`` pattern will be coadded into a file -named ``coadded.fid``. +All files matching the ``test*.fid`` pattern will be coadded into a file +named ``coadded.fid``. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/coadd/coadd_2d_pipe/coadd_2d.py>`] diff --git a/doc/source/examples/coadd_pseudo3d_pipe.rst b/doc/source/examples/coadd_pseudo3d_pipe.rst index ed791850..f6db1899 100644 --- a/doc/source/examples/coadd_pseudo3d_pipe.rst +++ b/doc/source/examples/coadd_pseudo3d_pipe.rst @@ -4,13 +4,13 @@ coadd example: coadd_pseudo3d_pipe ================================== This example shows how to use nmrglue to coadd a number of collections of 2D -NMRPipe files which constitute a pseudo-3D data set. The two (or more) -psuedo-3D data sets are assumed to be in directories named ``run*.dir`` with -subdirectories named ``*.fid`` containing a ``test.fid`` file. The directory -``coadded_data.dir`` is created with the same subdirectory structure containing +NMRPipe files which constitute a pseudo-3D data set. The two (or more) +psuedo-3D data sets are assumed to be in directories named ``run*.dir`` with +subdirectories named ``*.fid`` containing a ``test.fid`` file. The directory +``coadded_data.dir`` is created with the same subdirectory structure containing ``test.fid`` files containing data created by coadding each pseudo-3D. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/coadd/coadd_pseudo3d_pipe/coadd_pseudo3d.py>`] diff --git a/doc/source/examples/fitting_t1_data.rst b/doc/source/examples/fitting_t1_data.rst index 62f65590..84b67777 100644 --- a/doc/source/examples/fitting_t1_data.rst +++ b/doc/source/examples/fitting_t1_data.rst @@ -3,16 +3,16 @@ fitting example: fitting_t1_data ================================ -This example shows how to use nmrglue and the `SciPy `_ +This example shows how to use nmrglue and the `SciPy `_ optimize module to fit T1 relaxation trajectories. Three scripts are used in the process. -The data used in this example is available for +The data used in this example is available for `download. `_ First the ``extract_trajs.py`` script reads in box limits from ``boxes.in`` and a list of spectra from ``spectra.in``. The script integrates each peak in each -spectrum and writes the trajectory for each peak to disk as ``traj.npy`` in +spectrum and writes the trajectory for each peak to disk as ``traj.npy`` in `NumPy `_ ``.npy`` format. [:download:`extract_trajs.py <../../../examples/fitting_data/t1_measurements/extract_trajs.py>`] @@ -29,12 +29,12 @@ spectrum and writes the trajectory for each peak to disk as ``traj.npy`` in The second script ``fit_exp_leastsq.py`` reads in this ``traj.npy`` file and the -T1 relaxation times associated with the spectra collected from ``time.dat``. +T1 relaxation times associated with the spectra collected from ``time.dat``. Each trajectory is fit using the least squares approach. Other optimization -algorithms can be substituted with small changes to the code, see the +algorithms can be substituted with small changes to the code, see the `scipy.optimize `_ -documentation). The resulting fits are saved to a `fits.pickle` file for -easy reading into python as well as the human readable ``fits.txt`` file. +documentation). The resulting fits are saved to a `fits.pickle` file for +easy reading into python as well as the human readable ``fits.txt`` file. [:download:`fit_exp_leastsq.py <../../../examples/fitting_data/t1_measurements/fit_exp_leastsq.py>`] @@ -44,14 +44,14 @@ easy reading into python as well as the human readable ``fits.txt`` file. .. literalinclude:: ../../../examples/fitting_data/t1_measurements/time.dat -Results: +Results: [:download:`fits.txt <../../../examples/fitting_data/t1_measurements/fits.txt>`] .. literalinclude:: ../../../examples/fitting_data/t1_measurements/fits.txt -The last script ``pt.py`` reads in the fits, trajectories and T1 -relaxation times and plots the experimental points and best fit to a series +The last script ``pt.py`` reads in the fits, trajectories and T1 +relaxation times and plots the experimental points and best fit to a series of ``*_plot.png`` files. [:download:`pt.py <../../../examples/fitting_data/t1_measurements/pt.py>`] diff --git a/doc/source/examples/index.rst b/doc/source/examples/index.rst index 9cb0ed2b..61ba3af8 100644 --- a/doc/source/examples/index.rst +++ b/doc/source/examples/index.rst @@ -13,7 +13,7 @@ Application Examples -------------------- .. toctree:: - + apod_viewer_1win.rst apod_viewer_2win.rst diff --git a/doc/source/examples/integrate_1d.rst b/doc/source/examples/integrate_1d.rst index dfedce22..97027264 100644 --- a/doc/source/examples/integrate_1d.rst +++ b/doc/source/examples/integrate_1d.rst @@ -4,11 +4,11 @@ integration example: integrate_1d ================================== This example shows how to use nmrglue to integrate a 1D NMRPipe spectra. The -script reads in ppm peak limits from ``limits.in`` and takes a simple +script reads in ppm peak limits from ``limits.in`` and takes a simple summation integral of each peak using the spectra contained in ``1d_data.ft``. The integration values are writing to ``area.out`` and a plot is make showing the integration limits and values overlaid on the spectra to ``plot.png``. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/integration/integrate_1d/integrate_1d.py>`] diff --git a/doc/source/examples/integrate_2d.rst b/doc/source/examples/integrate_2d.rst index a2e2cd7b..fa32e021 100644 --- a/doc/source/examples/integrate_2d.rst +++ b/doc/source/examples/integrate_2d.rst @@ -4,13 +4,13 @@ integration example: integrate_2d ================================== This example shows how to use nmrglue to integrate a 2D NMRPipe spectra. The -script reads in point limits from ``limits.in`` and takes a simple -summation integral of all points in each box described. The integrated +script reads in point limits from ``limits.in`` and takes a simple +summation integral of all points in each box described. The integrated volumes are writing to ``volumes.out``. For a method to graphically examine -these limits see :ref:`plot_2d_boxes`. Similarly to check the peak +these limits see :ref:`plot_2d_boxes`. Similarly to check the peak assignments see :ref:`plot_2d_assignments`. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/integration/integrate_2d/integrate_2d.py>`] diff --git a/doc/source/examples/interactive_1d.rst b/doc/source/examples/interactive_1d.rst index bca38a6a..47ae9408 100644 --- a/doc/source/examples/interactive_1d.rst +++ b/doc/source/examples/interactive_1d.rst @@ -3,12 +3,12 @@ interactive example: interactive_1d =================================== -This example shows how to use nmrglue and -`matplotlib `_ to create a -simple interactive environment for examining a 1D spectrum from a NMRPipe +This example shows how to use nmrglue and +`matplotlib `_ to create a +simple interactive environment for examining a 1D spectrum from a NMRPipe file. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/interactive/interactive_1d/1d_interactive.py>`] diff --git a/doc/source/examples/interactive_2d.rst b/doc/source/examples/interactive_2d.rst index 2bcaec0f..a5295f68 100644 --- a/doc/source/examples/interactive_2d.rst +++ b/doc/source/examples/interactive_2d.rst @@ -3,12 +3,12 @@ interactive example: interactive_2d =================================== -This example shows how to use nmrglue and -`matplotlib `_ to create a -simple interactive environment for examining a 2D spectrum from a NMRPipe -file. +This example shows how to use nmrglue and +`matplotlib `_ to create a +simple interactive environment for examining a 2D spectrum from a NMRPipe +file. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/interactive/interactive_2d/2d_interactive.py>`] diff --git a/doc/source/examples/peakpick.rst b/doc/source/examples/peakpick.rst index 0469df2b..d3d58f27 100644 --- a/doc/source/examples/peakpick.rst +++ b/doc/source/examples/peakpick.rst @@ -5,7 +5,7 @@ Peak picking in multidimensional datasets NMRglue provides a single function (`ng.peakpick.pick`) that can pick peaks in multidimensional NMR datasets. Currently, 4 algorithms are implemented (`thres`, `fast-thres`, `downward`, `connected`) -that can be passed as an argument to the keyword `algorithm` in the function call. +that can be passed as an argument to the keyword `algorithm` in the function call. The code below reads previously processed datasets, picks peaks above a given threshold, and plots the spectrum with all the peaks marked. A unit conversion @@ -31,4 +31,3 @@ simple example is shown below [:download:`figure <../../../examples/peak_picking/peak_picking_2d.png>`] .. image:: ../../../examples/peak_picking/peak_picking_2d.png - diff --git a/doc/source/examples/pipe2sparky_2d.rst b/doc/source/examples/pipe2sparky_2d.rst index a57ff082..4daabc6a 100644 --- a/doc/source/examples/pipe2sparky_2d.rst +++ b/doc/source/examples/pipe2sparky_2d.rst @@ -3,10 +3,10 @@ convert example: pipe2sparky_2d =============================== -This example shows how to use nmrglue to convert a 2D NMRPipe file into a +This example shows how to use nmrglue to convert a 2D NMRPipe file into a Sparky formatted file. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/convert/pipe2sparky_2d/pipe2sparky_2d.py>`] diff --git a/doc/source/examples/pipe2sparky_3d.rst b/doc/source/examples/pipe2sparky_3d.rst index e85b0dcc..80454a6d 100644 --- a/doc/source/examples/pipe2sparky_3d.rst +++ b/doc/source/examples/pipe2sparky_3d.rst @@ -3,10 +3,10 @@ convert example: pipe2sparky_3d =============================== -This example shows how to use nmrglue to convert a 3D NMRPipe file into a +This example shows how to use nmrglue to convert a 3D NMRPipe file into a Sparky formatted file. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/convert/pipe2sparky_3d/pipe2sparky_3d.py>`] diff --git a/doc/source/examples/plot_1d_freq.rst b/doc/source/examples/plot_1d_freq.rst index 48572b05..382d287a 100644 --- a/doc/source/examples/plot_1d_freq.rst +++ b/doc/source/examples/plot_1d_freq.rst @@ -3,12 +3,12 @@ plotting example: plot_1d_freq ============================== -This example shows how to use nmrglue and +This example shows how to use nmrglue and `matplotlib `_ to create figures -for examining data or publication. In this example the spectrum from a 1D +for examining data or publication. In this example the spectrum from a 1D NMRPipe file is plotted. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/plotting/plot_1d/plot_1d_pipe_freq.py>`] diff --git a/doc/source/examples/plot_1d_time.rst b/doc/source/examples/plot_1d_time.rst index fc61f761..eda9bc59 100644 --- a/doc/source/examples/plot_1d_time.rst +++ b/doc/source/examples/plot_1d_time.rst @@ -3,12 +3,12 @@ plotting example: plot_1d_time ============================== -This example shows how to use nmrglue and +This example shows how to use nmrglue and `matplotlib `_ to create figures for examining data or publication. In this example the fid from a 1D NMRPipe file is plotted. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/plotting/plot_1d/plot_1d_pipe_time.py>`] diff --git a/doc/source/examples/plot_2d_assignments.rst b/doc/source/examples/plot_2d_assignments.rst index 46f2363a..4b56a8ff 100644 --- a/doc/source/examples/plot_2d_assignments.rst +++ b/doc/source/examples/plot_2d_assignments.rst @@ -3,14 +3,14 @@ plotting example: plot_2d_assignments ===================================== -This example shows how to use nmrglue and +This example shows how to use nmrglue and `matplotlib `_ to create figures for examining data or publication. In this example the assignments used in :ref:`integrate_2d` are graphically examined. A contour plot of the spectrum with the boxes and assignments is created. To examine the box limit more closely see :ref:`plot_2d_boxes`. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/plotting/plot_2d/plot_assignments.py>`] diff --git a/doc/source/examples/plot_2d_boxes.rst b/doc/source/examples/plot_2d_boxes.rst index 37b10964..6b5d6b6c 100644 --- a/doc/source/examples/plot_2d_boxes.rst +++ b/doc/source/examples/plot_2d_boxes.rst @@ -3,14 +3,14 @@ plotting example: plot_2d_boxes =============================== -This example shows how to use nmrglue and +This example shows how to use nmrglue and `matplotlib `_ to create figures for examining data or publication. In this example the box limits used in -:ref:`integrate_2d` are graphically examined. A contour plot of each peak is +:ref:`integrate_2d` are graphically examined. A contour plot of each peak is plotted with the box limits indicated by the dark dashed line. To check peak assignments see :ref:`plot_2d_assignments`. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/plotting/plot_2d/plot_boxes.py>`] diff --git a/doc/source/examples/plot_2d_spectrum.rst b/doc/source/examples/plot_2d_spectrum.rst index d9f7b85d..6875fe53 100644 --- a/doc/source/examples/plot_2d_spectrum.rst +++ b/doc/source/examples/plot_2d_spectrum.rst @@ -3,14 +3,14 @@ plotting example: plot_2d_spectrum ================================== -This example shows how to use nmrglue and +This example shows how to use nmrglue and `matplotlib `_ to create figures -for examining data or publication. In this example a contour plot of the -spectrum from a 2D NMRPipe file is created. Slices are added in the 15N and +for examining data or publication. In this example a contour plot of the +spectrum from a 2D NMRPipe file is created. Slices are added in the 15N and 13C dimension as well as sample peak labels. :ref:`plot_2d_spectrum_pts` is similar to this example but plotted on a point scale. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/plotting/plot_2d/plot_spectrum.py>`] diff --git a/doc/source/examples/plot_2d_spectrum_pts.rst b/doc/source/examples/plot_2d_spectrum_pts.rst index f0c079be..0ea96e9f 100644 --- a/doc/source/examples/plot_2d_spectrum_pts.rst +++ b/doc/source/examples/plot_2d_spectrum_pts.rst @@ -3,10 +3,10 @@ plotting example: plot_2d_spectrum_pts ====================================== -This example shows how to use nmrglue and +This example shows how to use nmrglue and `matplotlib `_ to create figures -for examining data or publication. In this example a contour plot of the -spectrum from a 2D NMRPipe file is created. Slices are added in the 15N and +for examining data or publication. In this example a contour plot of the +spectrum from a 2D NMRPipe file is created. Slices are added in the 15N and 13C dimension as well as sample peak labels. :ref:`plot_2d_spectrum` is similar to this example but plotted on a ppm scale. diff --git a/doc/source/examples/process_pipe_1d.rst b/doc/source/examples/process_pipe_1d.rst index fcb82757..ad9cf113 100644 --- a/doc/source/examples/process_pipe_1d.rst +++ b/doc/source/examples/process_pipe_1d.rst @@ -3,11 +3,11 @@ process example: process_pipe_1d ================================ -This example shows how nmrglue can be used to process NMR data. In this -script a 1D time domain NMRPipe file is processing into a 1D NMRPipe +This example shows how nmrglue can be used to process NMR data. In this +script a 1D time domain NMRPipe file is processing into a 1D NMRPipe frequency domain file. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/processing/process_pipe_1d.py>`] diff --git a/doc/source/examples/process_pipe_2d.rst b/doc/source/examples/process_pipe_2d.rst index e3a6eafe..027c0e06 100644 --- a/doc/source/examples/process_pipe_2d.rst +++ b/doc/source/examples/process_pipe_2d.rst @@ -3,11 +3,11 @@ process example: process_pipe_2d ================================ -This example shows how nmrglue can be used to process NMR data. In this -script a 2D time domain NMRPipe file is processing into a 2D NMRPipe -frequency domain file. +This example shows how nmrglue can be used to process NMR data. In this +script a 2D time domain NMRPipe file is processing into a 2D NMRPipe +frequency domain file. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/processing/process_pipe_2d.py>`] diff --git a/doc/source/examples/process_pipe_2d_tppi.rst b/doc/source/examples/process_pipe_2d_tppi.rst index df98a8c7..4f1cdcd1 100644 --- a/doc/source/examples/process_pipe_2d_tppi.rst +++ b/doc/source/examples/process_pipe_2d_tppi.rst @@ -3,11 +3,11 @@ process example: process_pipe_2d_tppi ===================================== -This example shows how nmrglue can be used to process NMR data. In this -script a 2D time domain NMRPipe file is processing into a 2D NMRPipe +This example shows how nmrglue can be used to process NMR data. In this +script a 2D time domain NMRPipe file is processing into a 2D NMRPipe frequency domain file. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/processing/process_pipe_2d_tppi.py>`] diff --git a/doc/source/examples/process_pipe_3d.rst b/doc/source/examples/process_pipe_3d.rst index 18df1c10..2855e20d 100644 --- a/doc/source/examples/process_pipe_3d.rst +++ b/doc/source/examples/process_pipe_3d.rst @@ -3,13 +3,13 @@ process example: process_pipe_3d ================================ -This example shows how nmrglue can be used to process NMR data. In this -script a 3D time domain NMRPipe file is processing into a 3D NMRPipe -frequency domain file. For 3D processing the iter3D object is used to loop +This example shows how nmrglue can be used to process NMR data. In this +script a 3D time domain NMRPipe file is processing into a 3D NMRPipe +frequency domain file. For 3D processing the iter3D object is used to loop over XY and ZX planes. Detail on this object can be found in the :ref:`varian_module` documentation. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/processing/process_pipe_3d.py>`] diff --git a/doc/source/examples/separate_1d_varian.rst b/doc/source/examples/separate_1d_varian.rst index fb43dc15..fe41c4ac 100644 --- a/doc/source/examples/separate_1d_varian.rst +++ b/doc/source/examples/separate_1d_varian.rst @@ -1,16 +1,16 @@ .. _separate_1d_varian: -separate example: separate_1d_varian +separate example: separate_1d_varian ==================================== -This example shows how to use nmrglue to separate Agilent/Varian data +This example shows how to use nmrglue to separate Agilent/Varian data collected with an innermost parameter interleaved. The full experimental -data in the ``arrayed_data.dir`` directory is unpacked into a series of +data in the ``arrayed_data.dir`` directory is unpacked into a series of directories with names ``tHX_*.fid`` which can be converted with nmrglue or NMRPipe. The name and values of the interleaved parameter is determined from the ``procpar`` file in the ``arrayed_data.dir`` directory. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/separate/separate_1d_varian/separate.py>`] diff --git a/doc/source/examples/separate_2d_bruker.rst b/doc/source/examples/separate_2d_bruker.rst index ece4d172..08624852 100644 --- a/doc/source/examples/separate_2d_bruker.rst +++ b/doc/source/examples/separate_2d_bruker.rst @@ -1,16 +1,16 @@ .. _separate_2d_bruker: -separate example: separate_2d_bruker +separate example: separate_2d_bruker ==================================== This example shows how to use nmrglue to separate Bruker data collected with -an innermost parameter interleaved. The full experimental data in the -``arrayed_data.dir`` directory is unpacked into a series of directories named -``1`` , ``2`` , ``3`` , ... which can be converted with nmrglue or NMRPipe. -The data shape, array size and additional files to copy to the new directories +an innermost parameter interleaved. The full experimental data in the +``arrayed_data.dir`` directory is unpacked into a series of directories named +``1`` , ``2`` , ``3`` , ... which can be converted with nmrglue or NMRPipe. +The data shape, array size and additional files to copy to the new directories must be determined by the user. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/separate/separate_2d_bruker/separate.py>`] diff --git a/doc/source/examples/separate_2d_varian.rst b/doc/source/examples/separate_2d_varian.rst index 6227df3a..5f5f4626 100644 --- a/doc/source/examples/separate_2d_varian.rst +++ b/doc/source/examples/separate_2d_varian.rst @@ -1,16 +1,16 @@ .. _separate_2d_varian: -separate example: separate_2d_varian +separate example: separate_2d_varian ==================================== -This example shows how to use nmrglue to separate Agilent/Varian data -collected with an innermost parameter interleaved. The full experimental data +This example shows how to use nmrglue to separate Agilent/Varian data +collected with an innermost parameter interleaved. The full experimental data in the ``arrayed_data.dir`` directory is unpacked into a series of directories -with names ``tXmix_*.fid`` which can be converted with nmrglue or NMRPipe. -The name and values of the interleaved parameter is determined from the +with names ``tXmix_*.fid`` which can be converted with nmrglue or NMRPipe. +The name and values of the interleaved parameter is determined from the ``procpar`` file in the ``arrayed_data.dir`` directory. -The data used in this example is available for +The data used in this example is available for `download. `_ [:download:`source code <../../../examples/separate/separate_2d_varian/separate.py>`] diff --git a/doc/source/examples/simulate_ucsf.rst b/doc/source/examples/simulate_ucsf.rst index 8b280d6c..e75764f2 100644 --- a/doc/source/examples/simulate_ucsf.rst +++ b/doc/source/examples/simulate_ucsf.rst @@ -1,6 +1,6 @@ .. _simulate_ucsf: -Simulate a ucsf (Sparky) file +Simulate a ucsf (Sparky) file ============================= @@ -16,4 +16,3 @@ is saved as a ucsf (Sparky) file named `test.ucsf`. [:download:`peaks.txt <../../../examples/simulation/simulate_ucsf/peaks.txt>`] .. literalinclude:: ../../../examples/simulation/simulate_ucsf/peaks.txt - diff --git a/doc/source/install.rst b/doc/source/install.rst index f02b6376..2c2cb57d 100644 --- a/doc/source/install.rst +++ b/doc/source/install.rst @@ -5,9 +5,9 @@ Installation Guide Where to get nmrglue -------------------- -Install files for all platforms are available for `download +Install files for all platforms are available for `download `_. -The .tar.gz file should be used on Linux and OS X and a binary, .exe file for +The .tar.gz file should be used on Linux and OS X and a binary, .exe file for Windows. Requirements @@ -26,8 +26,8 @@ in the Python ecosystem. +------------+------------+---------------------------------------+ | Scipy | 0.16+ | Required for processing functions | +------------+------------+---------------------------------------+ -| Matplotlib | 2.2.3+ | Optional, required for some functions | -| | | such as interactive phase correction | +| Matplotlib | 2.2.3+ | Optional, required for some functions | +| | | such as interactive phase correction | +------------+------------+---------------------------------------+ Additionally, an interactive environment such as `IPython `_, (available via several distributions such as `Jupyterlab `_, `Spyder `_, `Google Colaboratory `_, etc.) is highly recommended. An easy way of obtaining and installing these packages is to use a Python distribution which provides these packages, such as `Anaconda/Miniconda `_. Detailed information on `installing a Scipy stack `_ is available. The nmrglue codebase no longer supports Python 2, the last version to support Python 2.7 was 0.8. @@ -38,7 +38,7 @@ Platform Independent Installation nmrglue is available for installation via the Python Package Index. The latest stable version can be installed using:: - + $ python -m pip install nmrglue The current development version can be installed directly from GitHub using:: @@ -51,7 +51,7 @@ This requires `git` to be installed and available. Unix/OSX Installation --------------------- -After installing the above dependencies download and extract the source +After installing the above dependencies download and extract the source distribution and run:: $ python setup.py install @@ -64,5 +64,5 @@ Installation of the Scipy stack via a distribution such as `Anaconda/Miniconda`_ Installing from source code --------------------------- -nmrglue can also be installed from source code. See the :ref:`source_code` +nmrglue can also be installed from source code. See the :ref:`source_code` section of the :ref:`development-guide` for details on this process. diff --git a/doc/source/jbnmr_examples/index.rst b/doc/source/jbnmr_examples/index.rst index 9abcfeb1..93dec1e5 100644 --- a/doc/source/jbnmr_examples/index.rst +++ b/doc/source/jbnmr_examples/index.rst @@ -5,14 +5,14 @@ Examples from JBNMR article ########################### -These are all the examples from the Journal of Biomolecular NMR `article`_ +These are all the examples from the Journal of Biomolecular NMR `article`_ on nmrglue. The full reference for this article is: J.J. Helmus, C.P. Jaroniec, Nmrglue: An open source Python package for the analysis of multidimensional -NMR data, -J. Biomol. NMR, -2013, +NMR data, +J. Biomol. NMR, +2013, 10.1007/s10858-013-9718-x diff --git a/doc/source/jbnmr_examples/s10_covariance_processing.rst b/doc/source/jbnmr_examples/s10_covariance_processing.rst index 564ea700..94278658 100644 --- a/doc/source/jbnmr_examples/s10_covariance_processing.rst +++ b/doc/source/jbnmr_examples/s10_covariance_processing.rst @@ -1,6 +1,6 @@ .. include:: ../../../examples/jbnmr_examples/s10_covariance_processing/README.rst -The data used in this example is available for +The data used in this example is available for `download. `_ [14.65 MB] Listing S10 diff --git a/doc/source/jbnmr_examples/s1_sparky_to_nmrpipe.rst b/doc/source/jbnmr_examples/s1_sparky_to_nmrpipe.rst index 1013353b..2b0d0f6c 100644 --- a/doc/source/jbnmr_examples/s1_sparky_to_nmrpipe.rst +++ b/doc/source/jbnmr_examples/s1_sparky_to_nmrpipe.rst @@ -1,6 +1,6 @@ .. include:: ../../../examples/jbnmr_examples/s1_sparky_to_nmrpipe/README.rst -The data used in this example is available for +The data used in this example is available for `download. `_ [29.6 MB] Listing S1 diff --git a/doc/source/jbnmr_examples/s2_s3_1d_plotting.rst b/doc/source/jbnmr_examples/s2_s3_1d_plotting.rst index 0c08de93..6df5c7ba 100644 --- a/doc/source/jbnmr_examples/s2_s3_1d_plotting.rst +++ b/doc/source/jbnmr_examples/s2_s3_1d_plotting.rst @@ -1,6 +1,6 @@ .. include:: ../../../examples/jbnmr_examples/s2_s3_1d_plotting/README.rst -The data used in this example is available for +The data used in this example is available for `download. `_ [28.18 KB] Listing S2 @@ -18,5 +18,3 @@ Listing S3 .. literalinclude:: ../../../examples/jbnmr_examples/s2_s3_1d_plotting/plot_1d_pipe_spectrum.py .. image:: ../../../examples/jbnmr_examples/s2_s3_1d_plotting/spectrum.png - - diff --git a/doc/source/jbnmr_examples/s4_2d_plotting.rst b/doc/source/jbnmr_examples/s4_2d_plotting.rst index 7fa67ba1..ce4707ac 100644 --- a/doc/source/jbnmr_examples/s4_2d_plotting.rst +++ b/doc/source/jbnmr_examples/s4_2d_plotting.rst @@ -1,6 +1,6 @@ .. include:: ../../../examples/jbnmr_examples/s4_2d_plotting/README.rst -The data used in this example is available for +The data used in this example is available for `download. `_ [59.09 MB] Listing S4 diff --git a/doc/source/jbnmr_examples/s5_seperate_interleaved.rst b/doc/source/jbnmr_examples/s5_seperate_interleaved.rst index dc80dfe0..cdcf2341 100644 --- a/doc/source/jbnmr_examples/s5_seperate_interleaved.rst +++ b/doc/source/jbnmr_examples/s5_seperate_interleaved.rst @@ -1,6 +1,6 @@ .. include:: ../../../examples/jbnmr_examples/s5_seperate_interleaved/README.rst -The data used in this example is available for +The data used in this example is available for `download. `_ [78.42 MB] Listing S5 diff --git a/doc/source/jbnmr_examples/s6_seperate_inner_phase.rst b/doc/source/jbnmr_examples/s6_seperate_inner_phase.rst index 336fc0ec..e1b473b1 100644 --- a/doc/source/jbnmr_examples/s6_seperate_inner_phase.rst +++ b/doc/source/jbnmr_examples/s6_seperate_inner_phase.rst @@ -1,6 +1,6 @@ .. include:: ../../../examples/jbnmr_examples/s6_seperate_inner_phase/README.rst -The data used in this example is available for +The data used in this example is available for `download. `_ [12.42 MB] Listing S6 diff --git a/doc/source/jbnmr_examples/s7-s9_s3e_processing.rst b/doc/source/jbnmr_examples/s7-s9_s3e_processing.rst index 7877af29..4a9a3292 100644 --- a/doc/source/jbnmr_examples/s7-s9_s3e_processing.rst +++ b/doc/source/jbnmr_examples/s7-s9_s3e_processing.rst @@ -1,6 +1,6 @@ .. include:: ../../../examples/jbnmr_examples/s7-s9_s3e_processing/README.rst -The data used in this example is available for +The data used in this example is available for `download. `_ [5.42 MB] Listing S7 diff --git a/doc/source/reference/analysisbase.rst b/doc/source/reference/analysisbase.rst index 57ed83d7..56d2b911 100644 --- a/doc/source/reference/analysisbase.rst +++ b/doc/source/reference/analysisbase.rst @@ -11,9 +11,9 @@ Developer Functions These functions are typically not used directly by users. They are called by high level functions. -.. autosummary:: +.. autosummary:: :toctree: generated/ - + neighbors valid_pt find_limits diff --git a/doc/source/reference/fileiobase.rst b/doc/source/reference/fileiobase.rst index bcdf775c..106fbfb3 100644 --- a/doc/source/reference/fileiobase.rst +++ b/doc/source/reference/fileiobase.rst @@ -21,7 +21,7 @@ high level functions. uc_from_udic uc_from_freqscale open_towrite - ndfrom_iter + ndfrom_iter ndto_iter ndtofrom_iter size_and_ndtofrom_iter @@ -35,7 +35,7 @@ high level functions. Developer Classes ^^^^^^^^^^^^^^^^^ -These classes are typically not used directly by users. Developers may be +These classes are typically not used directly by users. Developers may be interested in these classes. .. autosummary:: diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst index 702f8ae4..9d31986b 100644 --- a/doc/source/reference/index.rst +++ b/doc/source/reference/index.rst @@ -9,7 +9,7 @@ fileio modules .. toctree:: :maxdepth: 1 - + agilent bruker convert @@ -43,7 +43,7 @@ analysis modules .. toctree:: :maxdepth: 1 - + analysisbase helpers integration @@ -59,6 +59,6 @@ util modules .. toctree:: :maxdepth: 1 - + misc xcpy diff --git a/doc/source/reference/linesh.rst b/doc/source/reference/linesh.rst index 04ef486a..9e61ae3b 100644 --- a/doc/source/reference/linesh.rst +++ b/doc/source/reference/linesh.rst @@ -10,13 +10,13 @@ User Functions These are the functions the majority of users will use from the linesh module. -.. autosummary:: +.. autosummary:: :toctree: generated/ fit_spectrum fit_NDregion sim_NDregion - + add_to_table pack_table unpack_table @@ -27,7 +27,7 @@ Developer Functions ------------------- These functions are typically not used directly by users. Developers who -want fine control over lineshape fitting may be interested in these +want fine control over lineshape fitting may be interested in these functions. .. autosummary:: @@ -40,4 +40,3 @@ functions. s_single_NDregion err_NDregion f_NDregion - diff --git a/doc/source/reference/lineshapes1d.rst b/doc/source/reference/lineshapes1d.rst index 04c83cc9..34b45f08 100644 --- a/doc/source/reference/lineshapes1d.rst +++ b/doc/source/reference/lineshapes1d.rst @@ -8,7 +8,7 @@ This modules is imported as nmrglue.lineshapes1d and can be called as such. Developer Functions ------------------- -These functions are typically not used directly by users. Developers who +These functions are typically not used directly by users. Developers who want to segment spectra will be interested in these functions. .. autosummary:: @@ -41,4 +41,3 @@ Developer Classes voigt_sigmagamma pvoigt_fwhm scale - diff --git a/doc/source/reference/misc.rst b/doc/source/reference/misc.rst index f3c55a54..dd5c6e21 100644 --- a/doc/source/reference/misc.rst +++ b/doc/source/reference/misc.rst @@ -10,10 +10,9 @@ Functions .. autosummary:: :toctree: generated/ - + pair_similar isdatasimilar isdicsimilar islistsimilar isitemsimilar - diff --git a/doc/source/reference/peakpick.rst b/doc/source/reference/peakpick.rst index fc0c9002..dc0eeee5 100644 --- a/doc/source/reference/peakpick.rst +++ b/doc/source/reference/peakpick.rst @@ -17,7 +17,7 @@ User Functions Developer Functions ------------------- -These functions are typically not used directly by users. Developers who +These functions are typically not used directly by users. Developers who want fine control over peak picking will be interested in these functions. .. autosummary:: @@ -34,8 +34,3 @@ want fine control over peak picking will be interested in these functions. find_all_nthres_fast find_pseg_slice find_nseg_slice - - - - - diff --git a/doc/source/reference/pipe.rst b/doc/source/reference/pipe.rst index e33f524f..5209a4d0 100644 --- a/doc/source/reference/pipe.rst +++ b/doc/source/reference/pipe.rst @@ -15,7 +15,7 @@ User Functions :toctree: generated/ read - write + write read_lowmem write_lowmem read_table @@ -56,7 +56,7 @@ fine control over NMRPipe files may be interested in these functions. add_axis_to_dic create_empty_dic read_1D - read_2D + read_2D read_lowmem_2D read_stream read_lowmem_stream @@ -69,22 +69,22 @@ fine control over NMRPipe files may be interested in these functions. write_4D write_lowmem_2D write_lowmem_3D - write_lowmem_3Ds + write_lowmem_3Ds write_lowmem_4D write_lowmem_4Ds put_fdata - put_trace + put_trace put_data write_slice_3D pack_complex - transpose_3D + transpose_3D find_shape reshape_data - unshape_data + unshape_data unappend_data append_data fdata2dic - dic2fdata + dic2fdata get_fdata get_data get_fdata_data diff --git a/doc/source/reference/pipe_proc.rst b/doc/source/reference/pipe_proc.rst index 9dbeada4..cf69200b 100644 --- a/doc/source/reference/pipe_proc.rst +++ b/doc/source/reference/pipe_proc.rst @@ -56,7 +56,7 @@ Standard NMR tp zf -Baseline +Baseline -------- .. autosummary:: @@ -128,5 +128,3 @@ Not Implemented poly xyz2zyx ztp - - diff --git a/doc/source/reference/proc_base.rst b/doc/source/reference/proc_base.rst index c9e306dc..86618f14 100644 --- a/doc/source/reference/proc_base.rst +++ b/doc/source/reference/proc_base.rst @@ -186,4 +186,3 @@ are included here for completeness. std_flt sum_flt largest_power_of_2 - diff --git a/doc/source/reference/proc_lp.rst b/doc/source/reference/proc_lp.rst index b56f494b..f2a9517a 100644 --- a/doc/source/reference/proc_lp.rst +++ b/doc/source/reference/proc_lp.rst @@ -29,7 +29,7 @@ Developer Functions .. include:: ../../../nmrglue/process/proc_lp.py :start-line: 5 - :end-line: 20 + :end-line: 20 These functions are called by high-level function are and most users will not @@ -64,5 +64,3 @@ use them in common processing scripts. Developers may be interested in them. reverse_filter fix_roots extrapolate - - diff --git a/doc/source/reference/rnmrtk.rst b/doc/source/reference/rnmrtk.rst index b015f98c..0ea14e70 100644 --- a/doc/source/reference/rnmrtk.rst +++ b/doc/source/reference/rnmrtk.rst @@ -54,7 +54,7 @@ functions. Developer Classes ^^^^^^^^^^^^^^^^^ -.. autosummary:: +.. autosummary:: :toctree: generated/ - rnmrtk_nd + rnmrtk_nd diff --git a/doc/source/reference/segmentation.rst b/doc/source/reference/segmentation.rst index 8fefc190..7451357f 100644 --- a/doc/source/reference/segmentation.rst +++ b/doc/source/reference/segmentation.rst @@ -8,7 +8,7 @@ This modules is imported as nmrglue.segmentation and can be called as such. Developer Functions ------------------- -These functions are typically not used directly by users. Developers who +These functions are typically not used directly by users. Developers who want to segment spectra will be interested in these functions. .. autosummary:: @@ -17,7 +17,7 @@ want to segment spectra will be interested in these functions. find_all_connected find_all_nconnected find_all_downward - find_all_upward + find_all_upward label_connected label_nconnected label_downward @@ -25,7 +25,7 @@ want to segment spectra will be interested in these functions. find_downward find_connected find_nconnected - find_upward + find_upward mark_dseg label_downward_seg mark_useg diff --git a/doc/source/reference/simpson.rst b/doc/source/reference/simpson.rst index c0e8c8b7..48260b2b 100644 --- a/doc/source/reference/simpson.rst +++ b/doc/source/reference/simpson.rst @@ -31,7 +31,7 @@ Developer Functions ^^^^^^^^^^^^^^^^^^^ These functions are typically not used directly by users. Developers who -want fine control over SIMPSON files will be interested in these +want fine control over SIMPSON files will be interested in these functions. .. autosummary:: diff --git a/doc/source/reference/sparky.rst b/doc/source/reference/sparky.rst index cf908ab2..72b2879d 100644 --- a/doc/source/reference/sparky.rst +++ b/doc/source/reference/sparky.rst @@ -22,7 +22,7 @@ User Functions make_uc guess_udic create_dic - datetime2dic + datetime2dic dic2datetime Developer Information @@ -35,7 +35,7 @@ Developer Information Developer Functions ^^^^^^^^^^^^^^^^^^^ -These functions are typically not used directly by users. Developers who +These functions are typically not used directly by users. Developers who want fine control over Sparky files may be interested in these functions. .. autosummary:: @@ -61,13 +61,13 @@ want fine control over Sparky files may be interested in these functions. find_tilen_3d tile_data3d untile_data3D - get_fileheader - put_fileheader + get_fileheader + put_fileheader fileheader2dic dic2fileheader get_axisheader put_axisheader - axisheader2dic + axisheader2dic dic2axisheader Developer Classes @@ -75,6 +75,6 @@ Developer Classes .. autosummary:: :toctree: generated/ - + sparky_2d sparky_3d diff --git a/doc/source/reference/spinsolve.rst b/doc/source/reference/spinsolve.rst index c2c4175e..ac88aaaf 100644 --- a/doc/source/reference/spinsolve.rst +++ b/doc/source/reference/spinsolve.rst @@ -40,4 +40,3 @@ fine control over Spinsolve files may be interested in these functions. parse_spinsolve_par_line get_udic_from_acqu_dict get_udic_from_jcamp_dict - diff --git a/doc/source/reference/table.rst b/doc/source/reference/table.rst index 8fd28556..8a9489ed 100644 --- a/doc/source/reference/table.rst +++ b/doc/source/reference/table.rst @@ -15,9 +15,9 @@ User Functions :toctree: generated/ read - write + write insert_row - append_row + append_row delete_row reorder_rows insert_column @@ -27,4 +27,3 @@ User Functions pipe2glue glue2pipe guess_pformat - diff --git a/doc/source/reference/varian.rst b/doc/source/reference/varian.rst index 8a069e9e..82d3a0b6 100644 --- a/doc/source/reference/varian.rst +++ b/doc/source/reference/varian.rst @@ -24,7 +24,7 @@ User Functions read_fid write_fid read_fid_lowmem - write_fid_lowmem + write_fid_lowmem read_fid_ntraces read_procpar write_procpar @@ -43,7 +43,7 @@ Developer Functions ^^^^^^^^^^^^^^^^^^^ These functions are typically not used directly by users. Developers who -want fine control over Agilent/Varian files will be interested in these +want fine control over Agilent/Varian files will be interested in these functions. .. autosummary:: @@ -83,7 +83,7 @@ functions. find_shape find_cdtype find_dtype - uninterleave_data + uninterleave_data interleave_data get_parameter @@ -91,7 +91,7 @@ functions. Developer Classes ^^^^^^^^^^^^^^^^^ -.. autosummary:: +.. autosummary:: :toctree: generated/ - fid_nd + fid_nd diff --git a/doc/source/reference/xcpy.rst b/doc/source/reference/xcpy.rst index e916afdd..25c919bb 100644 --- a/doc/source/reference/xcpy.rst +++ b/doc/source/reference/xcpy.rst @@ -1,15 +1,15 @@ nmrglue.misc.xcpy ================= -This module is intended for use with the Bruker Topspin software. -It runs external scripts via Jython (subprocess module) that ships with Topspin. +This module is intended for use with the Bruker Topspin software. +It runs external scripts via Jython (subprocess module) that ships with Topspin. Currently, it allows only external CPython programs to run. By default, it passes the current folder, expno and procno to the external CPython program (if available). -For an example of how this should look like in practice, see +For an example of how this should look like in practice, see `PR #103 `_. -A test script `xcpy_test.py` is provided in the same folder. This can be used to test -the setup. After copying over xcpy.py and xcpy.test to the prescribed locations (see below), +A test script `xcpy_test.py` is provided in the same folder. This can be used to test +the setup. After copying over xcpy.py and xcpy.test to the prescribed locations (see below), the output should look something like this: .. image:: https://user-images.githubusercontent.com/7735086/60869506-baff0480-a24c-11e9-92d2-63d0e7fec558.gif @@ -17,7 +17,7 @@ the output should look something like this: Usage ----- -.. code-block:: +.. code-block:: xcpy xcpy [OPTIONS] @@ -70,4 +70,3 @@ the external program not used for \*nix, but is used for Windows. (*Warning*: this is a known security risk and users are advised to be careful with their input while using this option) - diff --git a/doc/source/tutorial.rst b/doc/source/tutorial.rst index 10d7e503..37659d65 100644 --- a/doc/source/tutorial.rst +++ b/doc/source/tutorial.rst @@ -7,17 +7,17 @@ Tutorial Introduction ============ -nmrglue is a python module for reading, writing, and interacting with the -spectral data stored in a number of common NMR data formats. This tutorial -provides an overview of some of the features of nmrglue. A basic +nmrglue is a python module for reading, writing, and interacting with the +spectral data stored in a number of common NMR data formats. This tutorial +provides an overview of some of the features of nmrglue. A basic understanding of python is assumed which can be obtained by reading some -of the `python documentation `_. The examples in +of the `python documentation `_. The examples in this tutorial can be run interactively from the python shell but the use of an -enhanced python shell which provides non-blocking control of GUI threads, -for example `ipython `_, is +enhanced python shell which provides non-blocking control of GUI threads, +for example `ipython `_, is recommended when trying the examples which use matplotlib. The sample data -using in this tutorial is -`available `_ is you wish to +using in this tutorial is +`available `_ is you wish to follow along with the same files. The software can also be used in Google Colabs - see details below_. @@ -25,21 +25,21 @@ The software can also be used in Google Colabs - see details below_. Reading NMR files ================= -nmrglue can read and write to a number of common NMR file formats. To see -how simple this can be let's read a 2D NMRPipe file. (Note: If you need an example +nmrglue can read and write to a number of common NMR file formats. To see +how simple this can be let's read a 2D NMRPipe file. (Note: If you need an example dataset, use the one provided `here `_, and replace ``test.fid`` or ``test.ft`` with the names of the files ending in ``.fid`` or ``.dat``). >>> import nmrglue as ng >>> dic,data = ng.pipe.read("test.fid") -Here we have imported the ``nmrglue`` module and opened the NMRPipe file +Here we have imported the ``nmrglue`` module and opened the NMRPipe file ``test.fid``. nmrglue contains a number of modules for reading and writing NMR files and all of these modules have a ``read`` function which opens a file -or directory containing NMR data, reads in any necessary information, and loads -the spectral data into memory. The ``read`` function returns a 2-tuple -containing a python dictionary with file and spectral parameters and a -`numpy `_ array object containing the numeric +or directory containing NMR data, reads in any necessary information, and loads +the spectral data into memory. The ``read`` function returns a 2-tuple +containing a python dictionary with file and spectral parameters and a +`numpy `_ array object containing the numeric spectral data. Currently the following file formats are supported by nmrglue with the associated module: @@ -69,42 +69,42 @@ Examining the data object in more detail: dtype('complex64') We can see that this is a two dimensional data set with 1500 complex points -in the direct dimension and 332 points in the indirect dimension. nmrglue -takes care of converting the raw data in the file into an array of appropriate -type, dimensionality, and quadrature. For complex data the last axis, +in the direct dimension and 332 points in the indirect dimension. nmrglue +takes care of converting the raw data in the file into an array of appropriate +type, dimensionality, and quadrature. For complex data the last axis, typically the direct dimension, is converted to a complex data type. The other axes are not converted. -In some cases, not all of the information needed to represent the spectral data -as a well formed numpy array is stored in the file, or the values determined -automatically are incorrect. In many of these cases, this information can be +In some cases, not all of the information needed to represent the spectral data +as a well formed numpy array is stored in the file, or the values determined +automatically are incorrect. In many of these cases, this information can be specified directly in the function call. -For example, the ``read`` function in the ``varian`` module sometimes cannot -determine the shape or fid ordering of 3D files correctly. These parameters +For example, the ``read`` function in the ``varian`` module sometimes cannot +determine the shape or fid ordering of 3D files correctly. These parameters can be explicitly provided in the function call with the shape and torder keywords. See :ref:`varian_module` for details. Universal dictionaries ====================== -In addition to the spectral data, the ``read`` function also determines -various spectral parameters that were stored in the file and stores them in a +In addition to the spectral data, the ``read`` function also determines +various spectral parameters that were stored in the file and stores them in a python dictionary: - + >>> dic["FDF2SW"] 50000.0 >>> dic["FDF1LABEL"] '15N' -Here we see NMRPipe files stores the spectal width of the direct dimension -(50000.0 Hz) and the name of the indirect dimension (15N) as well as a number +Here we see NMRPipe files stores the spectal width of the direct dimension +(50000.0 Hz) and the name of the indirect dimension (15N) as well as a number of additional parameters. -Some file formats describe well the spectral data, listing a large number of -parameters, other only a few. In addition, different formats express -parameters in different units and under different names. For users who are +Some file formats describe well the spectral data, listing a large number of +parameters, other only a few. In addition, different formats express +parameters in different units and under different names. For users who are familiar with the specific file format or are working with only a single file type, this is not a problem; the dictionary allows direct access to these parameters. If a more uniform listing of spectral parameters is desired, the @@ -117,7 +117,7 @@ parameters. If a more uniform listing of spectral parameters is desired, the This 'universal' dictionary of spectral parameters contains only the most fundamental parameters, the dimensionality of the data, and a dictionary -of parameters for each axis numbered according to the data array ordering +of parameters for each axis numbered according to the data array ordering (the direct dimension is the highest numbered dimension). The axis dictionaries contain the following keys: @@ -150,7 +150,7 @@ For our 2D NMRPipe file, these parameters for the indirect dimension are: obs 50.6479988098 size 332 -One note on the size key, it was designed to always match the shape of the +One note on the size key, it was designed to always match the shape of the data: >>> [udic[n]["size"] for n in range(udic["ndim"])] @@ -163,9 +163,9 @@ Not all NMR files formats contain all the information necessary to determine uniquely all of the universal dictionary parameters. In these cases, the dictionary will be filled with generic values (999.99, "X", "Y", etc) and should be updated by the user with the correct values. -In converting to a 'universal' dictionary we have sacrificed additional +In converting to a 'universal' dictionary we have sacrificed additional information about the data which was contained in the original file in order -to provide a common description of NMR data. Despite the universal +to provide a common description of NMR data. Despite the universal dictionary's limited information, together with the data array, it is sufficient for most NMR tasks. We will later see that the universal dictionary allows for conversions between file formats. @@ -174,7 +174,7 @@ for conversions between file formats. Manipulating NMR data ===================== -Let us return again to the data array. By providing direct access to the +Let us return again to the data array. By providing direct access to the spectral data as a numpy array we can examine and manipulate this data using a number of simple methods as well as a number of functions. Since the ``read`` function moves the data into memory all this data manipulation @@ -253,20 +253,20 @@ Or a region: >>> data[9].imag array([ 1., 1., 1., ..., 1., 1., 1.], dtype=float32) -The `numpy documentation `_ has additional -information on the -`array `_ -object. In addition by combining nmrglue with +The `numpy documentation `_ has additional +information on the +`array `_ +object. In addition by combining nmrglue with `numpy `_ and/or `scipy `_ more complex data manipulation and calculation can be performed. Later we -will show how these modules are used to create a full suite of processing +will show how these modules are used to create a full suite of processing functions. - + Writing NMR files ================= -Now that we have modified the original NMR data we can write our modification +Now that we have modified the original NMR data we can write our modification to a file. nmrglue again makes this simple: >>> ng.pipe.write("new_data.fid",dic,data) @@ -287,7 +287,7 @@ The parameter dictionary has not changed: >>> ng.misc.isdicsimilar(orig_dic,new_dic) True -By default nmrglue will not overwrite existing data with the ``write`` +By default nmrglue will not overwrite existing data with the ``write`` function: >>> ng.pipe.write("new_data.fid",dic,data) @@ -303,9 +303,9 @@ But this check can be by-passed with the overwrite parameter: The unit_conversion object ========================== -Earlier we used the array index values for slicing the numpy array. For -reference your data in more common NMR units nmrglue provides the -``unit_coversion`` object. Use the ``make_uc`` function to create a +Earlier we used the array index values for slicing the numpy array. For +reference your data in more common NMR units nmrglue provides the +``unit_coversion`` object. Use the ``make_uc`` function to create a ``unit_conversion`` object: >>> dic,data = ng.pipe.read("test.ft2") @@ -336,7 +336,7 @@ We can also convert from points to various units: >>> uc0.unit(768,"percent") 37.518319491939423 -These objects can also be used for slicing, for example to find the trace +These objects can also be used for slicing, for example to find the trace closes to 120 ppm: >>> data[uc0("120ppm")] @@ -359,11 +359,11 @@ module. For example to convert a 2D NMRPipe file to a Sparky file: Here we opened the NMRPipe file *test.ft2* , created a new ``converter`` object and loaded it with the NMRPipe data. The ``converter`` is then used to generate -the Sparky parameter dictionary and a data array appropriate for Sparky data +the Sparky parameter dictionary and a data array appropriate for Sparky data which is written to *sparky_file.ucsf*. -All type conversions, and sign manipulation of the data array is performed -internally by the ``converter`` object. In addition new dictionaries are -created from an internal universal dictionary for the desired output. +All type conversions, and sign manipulation of the data array is performed +internally by the ``converter`` object. In addition new dictionaries are +created from an internal universal dictionary for the desired output. Additional examples showing how to use nmrglue to convert between NMR file formats can be found in the :ref:`convert_examples`. @@ -372,23 +372,23 @@ Low memory reading/writing of files =================================== Up to this point we have read NMR data from files using the ``read`` function. -This function reads the spectral data from a NMR file into the computers -memory. For small data sets this is fine, modern computer have sufficient +This function reads the spectral data from a NMR file into the computers +memory. For small data sets this is fine, modern computer have sufficient RAM to store complete 1D and 2D NMR data sets and a few copies of the data while processing. For 3D and larger dimensionality data set this is often -not desired. Reading in an entire 3D data set is not required when only a +not desired. Reading in an entire 3D data set is not required when only a small portion must be examined for viewing or processing. With this in mind nmrglue provides methods to read only a portions of NMR data from files when it is required. This is accomplished by creating a new object which look -very similar to numpy array but does not load data into memory. -Rather when a particular slice is requested the object opens the -necessary file(s), reads in the data and returns to the user a numpy +very similar to numpy array but does not load data into memory. +Rather when a particular slice is requested the object opens the +necessary file(s), reads in the data and returns to the user a numpy array with the data. In addition these objects have transpose and swapaxes -method and can be iterated over just as numpy arrays but without using -large amounts of memory. The only limitation of these objects is that they +method and can be iterated over just as numpy arrays but without using +large amounts of memory. The only limitation of these objects is that they do not support assignment, so a slice must be taken before changing the value -of data. The fileio sub-modules all have some form of ``read_lowmem`` -function which return these low-memory objects. For example reading the 2D +of data. The fileio sub-modules all have some form of ``read_lowmem`` +function which return these low-memory objects. For example reading the 2D sparky file we created earlier: >>> dic,data = ng.sparky.read_lowmem("sparky_file.ucsf") @@ -404,8 +404,8 @@ Slicing returns a numpy array: >>> data[0] array([-2287.25195312, 1601.82910156, 475.85516357, ..., -4680.2265625 , -72.70507812, -1402.25256348], dtype=float32) - -The data can be transposed as a numpy array: + +The data can be transposed as a numpy array: >>> tdata = data.transpose() >>> type(tdata) @@ -415,11 +415,11 @@ The data can be transposed as a numpy array: >>> tdata[1,0] array(1601.8291015625, dtype=float32) -These low memory usage objects can be written to disk or used in to +These low memory usage objects can be written to disk or used in to load a ``conversion`` object just as if they were normal numpy arrays. -Similar when large data sets are to be written to disk, it often does -not make sense to write the entire data set at once. For this the +Similar when large data sets are to be written to disk, it often does +not make sense to write the entire data set at once. For this the ``write_lowmem`` functions in the fileIO submodules provide methods for trace-by-trace or similar writing. @@ -427,14 +427,14 @@ trace-by-trace or similar writing. Processing data =============== -With NMR spectral data being stored as a numpy array a number of linear -algebra and signal processing functions can be applied to the data. The +With NMR spectral data being stored as a numpy array a number of linear +algebra and signal processing functions can be applied to the data. The functions in the `numpy `_ and `scipy `_ modules offer a number of processing functions users might find useful. nmrglue provides a number of common NMR functions in the :ref:`proc_base` module, baseline related functions in :ref:`proc_bl`, and linear prediction functions in the :ref:`proc_lp` -module. For example we perform some simple processing on our 2D NMRPipe file +module. For example we perform some simple processing on our 2D NMRPipe file (output suppressed): >>> dic,data = ng.pipe.read("test.fid") @@ -445,10 +445,10 @@ module. For example we perform some simple processing on our 2D NMRPipe file These functions process only the data, they do not update the spectral parameter associated with the data. Because these -values are key when examining NMR data we want functions which take into -account these parameter while processing. nmrglue provides the +values are key when examining NMR data we want functions which take into +account these parameter while processing. nmrglue provides the :ref:`pipe_proc` module for processing NMRPipe data while updating the -spectral properties simultaneously. Additional modules for processing +spectral properties simultaneously. Additional modules for processing other file format are being developed. Using ``pipe_proc`` is similar to using NMRPipe itself. For example to process the sample 2D NMRPipe file: @@ -476,11 +476,11 @@ RAM after which the entire 2D data set was written to disk. For 1D and 2D data sets this is fine, but as mentioned earlier many 3D and larger data sets cannot be processed in this manner. For a 3D file what is desired is that each 2D XY plane be read, processed and saved. Then the ZX planes are read -from this new file, the Z plane processed and these planes saved into the +from this new file, the Z plane processed and these planes saved into the final file. In nmrglue this can be accomplished for NMRPipe files using the :ref:`iter3D object `. Currently no other file format allows -such processing but development of these is planned. -An example of processing a 3D NMRPipe file using a ``iter3D`` object can be +such processing but development of these is planned. +An example of processing a 3D NMRPipe file using a ``iter3D`` object can be found in :ref:`process_pipe_3d`. Additional examples showing how to use nmrglue to process NMR data can be @@ -492,10 +492,10 @@ Using matplotlib to create figures A number of python plotting libraries exist which can be used in conjunction with nmrglue to produce publication quality figures. matplotlib is one of -the more popular libraries and has the ability to output to a number of +the more popular libraries and has the ability to output to a number of hard copy formats as well as offering a robust interactive environment. When using matplotlib interactively use of `ipython`_ -or a similar shell is recommended although the standard python shell can be +or a similar shell is recommended although the standard python shell can be used. >>> import matplotlib.pyplot as plt @@ -505,8 +505,8 @@ used. >>> plt.savefig("plot_1d.png") -Here we have loaded the pyplot module from matplotlib (aliased as plt), and -used it to plot the 1D frequency domain data of a model protein. The resulting +Here we have loaded the pyplot module from matplotlib (aliased as plt), and +used it to plot the 1D frequency domain data of a model protein. The resulting figure is saved as ``plot_1d.png``. .. image:: plot_1d.png @@ -545,18 +545,18 @@ showcase some some of this functionality. For additional information see the Additional resources ==================== -Detailed information about each module in nmrglue as well as the functions +Detailed information about each module in nmrglue as well as the functions provided by that module can be found in the nmrglue :ref:`reference_guide` or by using the Python built-in help system: >>> help(ng.pipe.read) - -A number of :ref:`examples-index` using nmrglue to interact with + +A number of :ref:`examples-index` using nmrglue to interact with NMR data are available. Finally documentation for the following packages might be useful to users of nmrglue: -* `numpy `_ -* `scipy `_ +* `numpy `_ +* `scipy `_ * `matplotlib `_ * `h5py `_ @@ -604,5 +604,3 @@ For example, and so on. - - diff --git a/examples/bruker_data/README.rst b/examples/bruker_data/README.rst index 98935acb..e85a459a 100644 --- a/examples/bruker_data/README.rst +++ b/examples/bruker_data/README.rst @@ -3,20 +3,20 @@ Processing 1D Bruker Data ========================= -This example shows how nmrglue can be used to process and display one -dimensional Bruker data. +This example shows how nmrglue can be used to process and display one +dimensional Bruker data. -Raw Bruker data from modern spectrometers contains a *group delay artifact* +Raw Bruker data from modern spectrometers contains a *group delay artifact* which must be removed during processing. There has been much speculation as to the origins of this artifact and many methods for removing the artifact have been suggested [`1`_], [`2`_], [`3`_], [`4`_], [`5`_]. -Nmrglue provides an algorithm for removing this artifact based on the protocol +Nmrglue provides an algorithm for removing this artifact based on the protocol presented in "DMX DIGITAL FILTERS AND NON-BRUKER OFFLINE PROCESSING III" by -W. M. Westler and F. Abildgaard. +W. M. Westler and F. Abildgaard. This method is available for use through :py:func:`nmrglue.fileio.bruker.remove_digital_filter`. -Nmrglue users can use this included function to remove the artifact or +Nmrglue users can use this included function to remove the artifact or implement their own method if they are unsatisfied with the results. .. _1: http://nmr-analysis.blogspot.com/2008/02/why-arent-bruker-fids-time-corrected.html @@ -25,7 +25,7 @@ implement their own method if they are unsatisfied with the results. .. _4: http://qa.nmrwiki.org/question/196/bruker-grpdly-parameter .. _5: http://www.acornnmr.com/NutsHelp/rd_show.html -In this example a 1D NMR spectrum of 1,3 diaminopropane is processed and +In this example a 1D NMR spectrum of 1,3 diaminopropane is processed and plotted using nmrglue. The results can be compared with the spectrum produced from NMRPipe which provides a different artifact removal algorithm. Note that no apodization or baseline corrections are performed on these spectra. @@ -34,7 +34,7 @@ Instructions ------------ * Download the 1D proton spectrum of 1,3 diaminopropane and unpack in this - directory. This raw data is available from the + directory. This raw data is available from the `Madison Metabolomics Consortium Database`_ as `expnmr_00001_1.tar`_. .. _Madison Metabolomics Consortium Database: http://mmcd.nmrfam.wisc.edu/ @@ -71,5 +71,3 @@ Output: [:download:`figure_nmrpipe.png <../../../examples/bruker_data/figure_nmrpipe.png>`] .. image:: ../../../examples/bruker_data/figure_nmrpipe.png - - diff --git a/examples/bruker_processed_1d/dig_filter_remove.py b/examples/bruker_processed_1d/dig_filter_remove.py index 18b3294a..44bdf3d2 100644 --- a/examples/bruker_processed_1d/dig_filter_remove.py +++ b/examples/bruker_processed_1d/dig_filter_remove.py @@ -26,7 +26,7 @@ #---data processed using NMRPipe (post-processing) pipe_postcorr_frq = ng.pipe.read('post.ft')[1][::-1] -pipe_postcorr_frq = ng.proc_autophase.autops(pipe_postcorr_frq, 'acme') +pipe_postcorr_frq = ng.proc_autophase.autops(pipe_postcorr_frq, 'acme') # note: # 'acme' gave a better phase correction for the post-processing case @@ -58,4 +58,3 @@ plt.tight_layout() plt.savefig('dig_filter_remove.png') - diff --git a/examples/coadd/coadd_pseudo3d_pipe/coadd_pseudo3d.py b/examples/coadd/coadd_pseudo3d_pipe/coadd_pseudo3d.py index c1a295fa..f7ca1e87 100755 --- a/examples/coadd/coadd_pseudo3d_pipe/coadd_pseudo3d.py +++ b/examples/coadd/coadd_pseudo3d_pipe/coadd_pseudo3d.py @@ -15,17 +15,17 @@ # loop over the files for base_fname in flist: - + # initialize the new data dic, data = ng.pipe.read(base_fname) coadd_data = np.zeros_like(data) coadd_dic = dict(dic) - + # loop over the pseudo-3D directories for d in dlist: - + # the file names is found by replace the directory name - f = base_fname.replace(dlist[0], d, 1) + f = base_fname.replace(dlist[0], d, 1) print "Coadding file:", f dic, data = ng.pipe.read(f) coadd_data += data / len(dlist) diff --git a/examples/convert/agilent2pipe_1d/agilent2pipe_1d.py b/examples/convert/agilent2pipe_1d/agilent2pipe_1d.py index 3e82c160..6d4ee5e8 100755 --- a/examples/convert/agilent2pipe_1d/agilent2pipe_1d.py +++ b/examples/convert/agilent2pipe_1d/agilent2pipe_1d.py @@ -21,4 +21,3 @@ # create NMRPipe data and then write it out ng.pipe.write("1d_pipe.fid", *C.to_pipe(), overwrite=True) - diff --git a/examples/convert/agilent2pipe_2d/agilent2pipe_2d.py b/examples/convert/agilent2pipe_2d/agilent2pipe_2d.py index 38c25bf8..856da774 100755 --- a/examples/convert/agilent2pipe_2d/agilent2pipe_2d.py +++ b/examples/convert/agilent2pipe_2d/agilent2pipe_2d.py @@ -9,13 +9,13 @@ udic = ng.varian.guess_udic(dic, data) # Direct dimension # Indirect dimension -udic[1]['size'] = 1500 ; udic[0]['size'] = 332 +udic[1]['size'] = 1500 ; udic[0]['size'] = 332 udic[1]['complex'] = True ; udic[0]['complex'] = True udic[1]['encoding'] = 'direct' ; udic[0]['encoding'] = 'states' udic[1]['sw'] = 50000.0 ; udic[0]['sw'] = 5555.556 udic[1]['obs'] = 125.691 ; udic[0]['obs'] = 50.648 udic[1]['car'] = 55.0 * 125.691; udic[0]['car'] = 120.0 * 50.648 -udic[1]['label'] = '13C' ; udic[0]['label'] = '15N' +udic[1]['label'] = '13C' ; udic[0]['label'] = '15N' # create the converter object and initialize with Agilent data C = ng.convert.converter() diff --git a/examples/convert/agilent2pipe_2d_tppi/agilent2pipe_2d_tppi.py b/examples/convert/agilent2pipe_2d_tppi/agilent2pipe_2d_tppi.py index cae65463..4a809f84 100755 --- a/examples/convert/agilent2pipe_2d_tppi/agilent2pipe_2d_tppi.py +++ b/examples/convert/agilent2pipe_2d_tppi/agilent2pipe_2d_tppi.py @@ -10,12 +10,12 @@ # Direct Dimsion #Indirect Dimension u[1]['size'] = 1400 ; u[0]['size'] = 600 -u[1]['complex'] = True ; u[0]['complex'] = False +u[1]['complex'] = True ; u[0]['complex'] = False u[1]['encoding'] = 'direct' ; u[0]['encoding'] = 'tppi' u[1]['sw'] = 50000.0 ; u[0]['sw'] = 33333.333 u[1]['obs'] = 125.681 ; u[0]['obs'] = 125.681 u[1]['car'] = 101.274 * 125.681 ; u[0]['car'] = 101.274 * 125.681 -u[1]['label'] = 'C13x' ; u[0]['label'] = 'C13y' +u[1]['label'] = 'C13x' ; u[0]['label'] = 'C13y' # create the converter object and initialize with Agilent data C = ng.convert.converter() diff --git a/examples/convert/bruker2pipe_2d/bruker2pipe_2d.py b/examples/convert/bruker2pipe_2d/bruker2pipe_2d.py index 8d51a9d7..d774e386 100755 --- a/examples/convert/bruker2pipe_2d/bruker2pipe_2d.py +++ b/examples/convert/bruker2pipe_2d/bruker2pipe_2d.py @@ -10,12 +10,12 @@ # Direct Dimsion #Indirect Dimension u[1]['size'] = 768 ; u[0]['size'] = 600 -u[1]['complex'] = True ; u[0]['complex'] = True +u[1]['complex'] = True ; u[0]['complex'] = True u[1]['encoding'] = 'direct' ; u[0]['encoding'] = 'states' u[1]['sw'] = 11061.947 ; u[0]['sw'] = 4000.000 u[1]['obs'] = 800.134 ; u[0]['obs'] = 201.204 u[1]['car'] = 4.773 * 800.134 ; u[0]['car'] = 58.742 * 201.204 -u[1]['label'] = '1H' ; u[0]['label'] = '13C' +u[1]['label'] = '1H' ; u[0]['label'] = '13C' # create the converter object and initialize with Bruker data C = ng.convert.converter() diff --git a/examples/convert/pipe2sparky_2d/pipe2sparky_2d.py b/examples/convert/pipe2sparky_2d/pipe2sparky_2d.py index 3486cb1a..33e0697d 100755 --- a/examples/convert/pipe2sparky_2d/pipe2sparky_2d.py +++ b/examples/convert/pipe2sparky_2d/pipe2sparky_2d.py @@ -5,7 +5,7 @@ # read in the NMRPipe data dic,data = ng.pipe.read("nmrpipe_2d/test.ft2") -# Set the spectral parameters +# Set the spectral parameters udic = ng.pipe.guess_udic(dic, data) # create the converter object and initialize with NMRPipe data diff --git a/examples/convert/pipe2sparky_3d/pipe2sparky_3d.py b/examples/convert/pipe2sparky_3d/pipe2sparky_3d.py index 0d5f3bff..b83c61c1 100755 --- a/examples/convert/pipe2sparky_3d/pipe2sparky_3d.py +++ b/examples/convert/pipe2sparky_3d/pipe2sparky_3d.py @@ -6,7 +6,7 @@ dic, data = ng.pipe.read("nmrpipe_3d/ft/test%03d.ft3") #dic, data = ng.pipe.read_lowmem("nmrpipe_3d/ft/test%03d.ft3") -# Set the spectral parameters +# Set the spectral parameters udic = ng.pipe.guess_udic(dic, data) # create the converter object and initialize with NMRPipe data diff --git a/examples/interactive/interactive_2d/2d_interactive.py b/examples/interactive/interactive_2d/2d_interactive.py index 2dcb6104..c4d7c792 100755 --- a/examples/interactive/interactive_2d/2d_interactive.py +++ b/examples/interactive/interactive_2d/2d_interactive.py @@ -28,7 +28,7 @@ ax = fig.add_subplot(111) # plot the contours -ax.contour(data, cl, cmap=cmap, +ax.contour(data, cl, cmap=cmap, extent=(ppm_13c_0, ppm_13c_1, ppm_15n_0, ppm_15n_1)) # decorate the axes diff --git a/examples/jbnmr_examples/s11_strip_plots/README.rst b/examples/jbnmr_examples/s11_strip_plots/README.rst index ddb16998..b5db7769 100644 --- a/examples/jbnmr_examples/s11_strip_plots/README.rst +++ b/examples/jbnmr_examples/s11_strip_plots/README.rst @@ -4,7 +4,7 @@ Introduction ------------ -This example is taken from Listing S11 from the 2013 JBNMR nmrglue paper. In +This example is taken from Listing S11 from the 2013 JBNMR nmrglue paper. In this example a three 3D solid state NMR spectra are visualized as strip plots. diff --git a/examples/jbnmr_examples/s11_strip_plots/make_strip_plots.py b/examples/jbnmr_examples/s11_strip_plots/make_strip_plots.py index d53aa02a..aa0b4c9a 100644 --- a/examples/jbnmr_examples/s11_strip_plots/make_strip_plots.py +++ b/examples/jbnmr_examples/s11_strip_plots/make_strip_plots.py @@ -46,7 +46,7 @@ uc_s3_a2 = ng.pipe.make_uc(dic_3, data_3, 2) # CX # read in assignments -table_filename = 'ass.tab' +table_filename = 'ass.tab' table = ng.pipe.read_table(table_filename)[2] assignments = table['ASS'][1:] @@ -85,10 +85,10 @@ strip_ppm_x = uc_s1_a0.ppm_scale()[min_s1_a0:max_s1_a0+1] strip_ppm_y = uc_s1_a2.ppm_scale()[min_s1_a2:max_s1_a2+1] strip_x, strip_y = np.meshgrid(strip_ppm_x, strip_ppm_y) - + # add contour plot of strip to figure ax1 = fig.add_subplot(1, 21, 3 * i + 1) - ax1.contour(strip_x, strip_y, strip_s1.transpose(), cl_s1, + ax1.contour(strip_x, strip_y, strip_s1.transpose(), cl_s1, colors=colors_s1, linewidths=0.5) ax1.invert_yaxis() # flip axes since ppm indexed ax1.invert_xaxis() @@ -99,9 +99,9 @@ ax1.set_xlabel('%.1f'%(x_center_s1[i]), size=6) ax1.text(0.1, 0.975, '%.1f'%(z_plane_s1[i]), size=6, transform=ax1.transAxes) - + # label and put ticks on first strip plot - if i == 0: + if i == 0: ax1.set_ylabel("13C (ppm)") ax1.tick_params(axis='y', labelleft=True, left=True, direction='out') @@ -109,31 +109,31 @@ # find limits in units of points idx_s2_a0 = uc_s2_a0(z_plane_s2[i], "ppm") min_s2_a1 = uc_s2_a1(x_center_s2[i] + x_width, "ppm") - max_s2_a1 = uc_s2_a1(x_center_s2[i] - x_width, "ppm") + max_s2_a1 = uc_s2_a1(x_center_s2[i] - x_width, "ppm") min_s2_a2 = uc_s2_a2(y_min, "ppm") max_s2_a2 = uc_s2_a2(y_max, "ppm") if min_s2_a2 > max_s2_a2: min_s2_a2, max_s2_a2 = max_s2_a2, min_s2_a2 - # extract strip - strip_s2 = data_2[idx_s2_a0, min_s2_a1:max_s2_a1+1, min_s2_a2:max_s2_a2+1] + # extract strip + strip_s2 = data_2[idx_s2_a0, min_s2_a1:max_s2_a1+1, min_s2_a2:max_s2_a2+1] # add contour plot of strip to figure ax2 = fig.add_subplot(1, 21, 3 * i + 2) ax2.contour(strip_s2.transpose(), cl_s2, colors=colors_s2, linewidths=0.5) - + # turn off ticks and labels, add labels and assignment ax2.tick_params(axis='both', labelbottom=False, bottom=False, top=False, labelleft=False, left=False, right=False) ax2.set_xlabel('%.1f'%(x_center_s2[i]), size=6) - ax2.text(0.2, 0.975, '%.1f'%(z_plane_s2[i]), size=6, + ax2.text(0.2, 0.975, '%.1f'%(z_plane_s2[i]), size=6, transform=ax2.transAxes) ax2.set_title(assignments[i]) ### spectral 3, NCOCX # find limits in units of points - idx_s3_a0 = uc_s3_a0(z_plane_s3[i], "ppm") + idx_s3_a0 = uc_s3_a0(z_plane_s3[i], "ppm") min_s3_a1 = uc_s3_a1(x_center_s3[i] + x_width, "ppm") max_s3_a1 = uc_s3_a1(x_center_s3[i] - x_width, "ppm") min_s3_a2 = uc_s3_a2(y_min, "ppm") @@ -141,19 +141,19 @@ if min_s3_a2 > max_s3_a2: min_s3_a2, max_s3_a2 = max_s3_a2, min_s3_a2 - + # extract strip - strip_s3 = data_3[idx_s3_a0, min_s3_a1:max_s3_a1+1, min_s3_a2:max_s3_a2+1] + strip_s3 = data_3[idx_s3_a0, min_s3_a1:max_s3_a1+1, min_s3_a2:max_s3_a2+1] # add contour plot of strip to figure ax3 = fig.add_subplot(1, 21, 3 * i + 3) ax3.contour(strip_s3.transpose(), cl_s3, colors=colors_s3, linewidths=0.5) - + # turn off ticks and labels, add labels ax3.tick_params(axis='both', labelbottom=False, bottom=False, top=False, labelleft=False, left=False, right=False) ax3.set_xlabel('%.1f'%(x_center_s3[i]), size=6) - ax3.text(0.1, 0.975, '%.1f'%(z_plane_s3[i]), size=6, + ax3.text(0.1, 0.975, '%.1f'%(z_plane_s3[i]), size=6, transform=ax3.transAxes) # add X axis label, save figure diff --git a/examples/jbnmr_examples/s12-s15_relaxation_analysis/README.rst b/examples/jbnmr_examples/s12-s15_relaxation_analysis/README.rst index 7b4454df..bfb9b1b8 100644 --- a/examples/jbnmr_examples/s12-s15_relaxation_analysis/README.rst +++ b/examples/jbnmr_examples/s12-s15_relaxation_analysis/README.rst @@ -6,7 +6,7 @@ Introduction This example is taken from Listing S12 - S15 in the 2013 JBNMR nmrglue paper. In this example a series of 3D NMRPipe files containing relaxation trajectories -for a solid state NMR experiment and analyzed. +for a solid state NMR experiment and analyzed. @@ -18,10 +18,10 @@ the data set. 'XXX.dat' files are created for the peaks defined in the `boxes.in` file. The `spectra.in` file defines which spectra the trajectories will be extracted from. -Execute `python plot_boxes.py` to create plots showing the peak and -integration limits for all peaks defined in `boxes.in`. +Execute `python plot_boxes.py` to create plots showing the peak and +integration limits for all peaks defined in `boxes.in`. `peak_XXX_spectrum_X.png` files are created for all peaks and spectra. A -example plot is provided as Figure 7 of the paper, which corresponds to +example plot is provided as Figure 7 of the paper, which corresponds to `peak_D40_spectrum_0.png` Execute `python fit_exp.py` to fit all relaxation trajectories. The fitting @@ -29,7 +29,6 @@ results are provided in the `fits.txt` file. The `relaxation_times.in` file defines the relaxation times for each spectra. Execute `python plot_trajectories` to create plots of all experimental and fit -relaxation tranjectories. This script creates a series of `XXX_plot.png` +relaxation tranjectories. This script creates a series of `XXX_plot.png` files. An example plot is provided as Figure 8 of the paper, which corresponds to `D40_plot.png`. - diff --git a/examples/jbnmr_examples/s12-s15_relaxation_analysis/fit_exp.py b/examples/jbnmr_examples/s12-s15_relaxation_analysis/fit_exp.py index 31b6598c..9561c2d7 100644 --- a/examples/jbnmr_examples/s12-s15_relaxation_analysis/fit_exp.py +++ b/examples/jbnmr_examples/s12-s15_relaxation_analysis/fit_exp.py @@ -24,15 +24,15 @@ def residuals(p, y, x): # loop over the trajecory files for filename in glob.glob('*.dat'): - + peak = filename[:3] print "Fitting Peak:", peak # fit the trajectory using constrained least squares optimization trajectory = np.loadtxt(filename) - x, ier = leastsqbound(residuals, x0, bounds=bounds, + x, ier = leastsqbound(residuals, x0, bounds=bounds, args=(trajectory, relaxation_times)) - + # write fitting results to output file output.write('%s\t%.6f\t%.6f\t%i\n' % (peak, x[0], x[1], ier)) diff --git a/examples/jbnmr_examples/s12-s15_relaxation_analysis/plot_boxes.py b/examples/jbnmr_examples/s12-s15_relaxation_analysis/plot_boxes.py index e4089fe6..a364b938 100644 --- a/examples/jbnmr_examples/s12-s15_relaxation_analysis/plot_boxes.py +++ b/examples/jbnmr_examples/s12-s15_relaxation_analysis/plot_boxes.py @@ -15,7 +15,7 @@ peak_list = np.recfromtxt("boxes.in", names=True) spectra_list = np.recfromtxt("spectra.in") -# loop over the spectra +# loop over the spectra for spec_number, spectra in enumerate(spectra_list): # read in the spectral data diff --git a/examples/jbnmr_examples/s12-s15_relaxation_analysis/plot_trajectories.py b/examples/jbnmr_examples/s12-s15_relaxation_analysis/plot_trajectories.py index 82f736b7..7137c964 100644 --- a/examples/jbnmr_examples/s12-s15_relaxation_analysis/plot_trajectories.py +++ b/examples/jbnmr_examples/s12-s15_relaxation_analysis/plot_trajectories.py @@ -14,11 +14,11 @@ def fit_func(p,x): for peak, A, R2, ier in fitting_results: print "Plotting:", peak - + # load the experimental and simulated relaxation trajectories experimental_trajectory = np.loadtxt(peak + '.dat') simulated_trajectory = fit_func((A, R2), simulated_relaxation_times) - + # create the figure fig = plt.figure() ax = fig.add_subplot(111) diff --git a/examples/jbnmr_examples/s2_s3_1d_plotting/README.rst b/examples/jbnmr_examples/s2_s3_1d_plotting/README.rst index c1732885..ef8d4a0b 100644 --- a/examples/jbnmr_examples/s2_s3_1d_plotting/README.rst +++ b/examples/jbnmr_examples/s2_s3_1d_plotting/README.rst @@ -4,7 +4,7 @@ Introduction ------------ -These two examples are taken from Listing S2 and S3 in the 2013 JBNMR nmrglue +These two examples are taken from Listing S2 and S3 in the 2013 JBNMR nmrglue paper. In the first example a the 1D time domain signal from a NMRPipe file (`test.fid`) is visualized using the `plot_1d_pipe_time.py` script. In the second example a portion of a 1D 13C CP MAS NMR spectrum is visualized from @@ -15,9 +15,9 @@ Instructions ------------ Execute `python plot_1d_pipe_time.py` to visualize the data in the file -`test.fid`. The resulting file `fid.png` is presented as Figure 2 in the +`test.fid`. The resulting file `fid.png` is presented as Figure 2 in the paper. Execute `python plot_1d_pipe_spectrum.py` to visualize the data in the file -`test.ft`. The resulting file `spectrum.png` is presented as Figure 3 in the +`test.ft`. The resulting file `spectrum.png` is presented as Figure 3 in the paper. diff --git a/examples/jbnmr_examples/s4_2d_plotting/README.rst b/examples/jbnmr_examples/s4_2d_plotting/README.rst index 6ee3ddd4..f9cbf928 100644 --- a/examples/jbnmr_examples/s4_2d_plotting/README.rst +++ b/examples/jbnmr_examples/s4_2d_plotting/README.rst @@ -4,7 +4,7 @@ Introduction ------------ -This example is taken from Listing S4 from the 2013 JBNMR nmrglue paper. In +This example is taken from Listing S4 from the 2013 JBNMR nmrglue paper. In this example a 2D SSNMR spectrum is visualized using the script `plot_2d_pipe_spectrum.py` @@ -13,5 +13,5 @@ Instructions ------------ Execute `python plot_2d_pipe_spectrum.py` to visualize the data in the file -`test.ft`. The resulting file `spectrum_2d.png` is presented as Figure 4 in +`test.ft`. The resulting file `spectrum_2d.png` is presented as Figure 4 in the paper. diff --git a/examples/jbnmr_examples/s5_seperate_interleaved/README.rst b/examples/jbnmr_examples/s5_seperate_interleaved/README.rst index 1e38b136..40cfd22c 100644 --- a/examples/jbnmr_examples/s5_seperate_interleaved/README.rst +++ b/examples/jbnmr_examples/s5_seperate_interleaved/README.rst @@ -6,7 +6,7 @@ Introduction This example is taken from Listing S5 in the 2013 JBNMR nmrglue paper. In this example a pseudo-3D NMRPipe data set is separated into 2D data sets using -the script `seperate.py`. +the script `seperate.py`. Instructions diff --git a/examples/jbnmr_examples/s6_seperate_inner_phase/README.rst b/examples/jbnmr_examples/s6_seperate_inner_phase/README.rst index f516dd8d..9c57669e 100644 --- a/examples/jbnmr_examples/s6_seperate_inner_phase/README.rst +++ b/examples/jbnmr_examples/s6_seperate_inner_phase/README.rst @@ -6,7 +6,7 @@ Introduction This example is taken from Listing S6 in the 2013 JBNMR nmrglue paper. In this example a pseudo-3D NMRPipe data set is separated into 2D data sets using -the script `seperate.py` where there is an innermost quadrature phase loop. +the script `seperate.py` where there is an innermost quadrature phase loop. Instructions diff --git a/examples/jbnmr_examples/s7-s9_s3e_processing/README.rst b/examples/jbnmr_examples/s7-s9_s3e_processing/README.rst index c3471c31..e6a3c943 100644 --- a/examples/jbnmr_examples/s7-s9_s3e_processing/README.rst +++ b/examples/jbnmr_examples/s7-s9_s3e_processing/README.rst @@ -4,7 +4,7 @@ Processing S3E filtered data example Introduction ------------ -This example is taken from Listing S7, S8 and S9 in the 2013 JBNMR nmrglue +This example is taken from Listing S7, S8 and S9 in the 2013 JBNMR nmrglue paper. In this example a 2D Agilent/Varian data set collect using a S3E filter is separated (`seperate_s3e.py`), converted to NMRPipe format (`Sparky file (`data.ucsf`) is converted to a NMRPipe file ('convert.py') and finally @@ -14,12 +14,12 @@ processed (`xy_s3e.py`). Instructions ------------ -Execute `python seperate_s3e.py` to separate the S3E sum and difference +Execute `python seperate_s3e.py` to separate the S3E sum and difference spectra from data set in the Agilent/Varian `fid` file. This creates the files -fid_dif and fid_sum. +fid_dif and fid_sum. Execute `python convert.py` to convert these two files to NMRPipe format. This step creates the files `test_sum.fid` and `test_dif.fid`. -Execute `python xy_s3e.py` to process and combine the sum and different -spectra. This step creates the `test.ft2` file. +Execute `python xy_s3e.py` to process and combine the sum and different +spectra. This step creates the `test.ft2` file. diff --git a/examples/peak_picking/2d_picking.py b/examples/peak_picking/2d_picking.py index 59720a7c..79a258bf 100644 --- a/examples/peak_picking/2d_picking.py +++ b/examples/peak_picking/2d_picking.py @@ -37,4 +37,3 @@ ax.set_ylabel("$^{15}$N (ppm)") plt.show() - diff --git a/examples/plotting/plot_1d/plot_1d_pipe_freq.py b/examples/plotting/plot_1d/plot_1d_pipe_freq.py index 8648a0f6..4aa4cd00 100755 --- a/examples/plotting/plot_1d/plot_1d_pipe_freq.py +++ b/examples/plotting/plot_1d/plot_1d_pipe_freq.py @@ -21,8 +21,8 @@ textcoords='offset points', arrowprops=dict(arrowstyle="->")) ax.text(59, 1.55e6, "alphatic region") ax.annotate('', xy=(70,1.2e6), xycoords='data', xytext=(10, 1.2e6), - textcoords='data', - arrowprops=dict(arrowstyle="<->", connectionstyle="bar", + textcoords='data', + arrowprops=dict(arrowstyle="<->", connectionstyle="bar", ec="k", shrinkA=5, shrinkB=5,)) # decorate axes diff --git a/examples/plotting/plot_2d/plot_assignments.py b/examples/plotting/plot_2d/plot_assignments.py index 44594bbe..8165258c 100755 --- a/examples/plotting/plot_2d/plot_assignments.py +++ b/examples/plotting/plot_2d/plot_assignments.py @@ -27,7 +27,7 @@ ax = fig.add_subplot(111) # plot the contours -ax.contour(data, cl, cmap=cmap, +ax.contour(data, cl, cmap=cmap, extent=(0, data.shape[1] - 1, 0, data.shape[0] - 1)) # loop over the peaks @@ -41,7 +41,7 @@ # plot a box around each peak and label ax.plot([x0, x1, x1, x0, x0], [y0, y0, y1, y1, y0], 'k') ax.text(x1 + 1, y0, name, size=textsize, color='r') - + # set limits ax.set_xlim(1900, 2200) ax.set_ylim(750, 1400) diff --git a/examples/plotting/plot_2d/plot_spectrum.py b/examples/plotting/plot_2d/plot_spectrum.py index 562f5428..d7594a5d 100755 --- a/examples/plotting/plot_2d/plot_spectrum.py +++ b/examples/plotting/plot_2d/plot_spectrum.py @@ -13,7 +13,7 @@ contour_factor = 1.20 # scaling factor between contour levels # calculate contour levels -cl = contour_start * contour_factor ** np.arange(contour_num) +cl = contour_start * contour_factor ** np.arange(contour_num) # read in the data from a NMRPipe file dic, data = ng.pipe.read("nmrpipe_2d/test.ft2") @@ -31,7 +31,7 @@ ax = fig.add_subplot(111) # plot the contours -ax.contour(data, cl, cmap=cmap, +ax.contour(data, cl, cmap=cmap, extent=(ppm_13c_0, ppm_13c_1, ppm_15n_0, ppm_15n_1)) # add some labels diff --git a/examples/plotting/plot_2d/plot_spectrum_pts.py b/examples/plotting/plot_2d/plot_spectrum_pts.py index 209d5a05..27a3e4f2 100755 --- a/examples/plotting/plot_2d/plot_spectrum_pts.py +++ b/examples/plotting/plot_2d/plot_spectrum_pts.py @@ -13,7 +13,7 @@ contour_factor = 1.20 # scaling factor between contour levels # calculate contour levels -cl = contour_start * contour_factor ** np.arange(contour_num) +cl = contour_start * contour_factor ** np.arange(contour_num) # read in the data from a NMRPipe file dic, data = ng.pipe.read("nmrpipe_2d/test.ft2") @@ -23,7 +23,7 @@ ax = fig.add_subplot(111) # plot the contours -ax.contour(data, cl, cmap=cmap, +ax.contour(data, cl, cmap=cmap, extent=(0, data.shape[1] - 1, 0, data.shape[0] - 1)) # add some labels diff --git a/examples/plotting/plot_sparky_savefile/plot_sparky.py b/examples/plotting/plot_sparky_savefile/plot_sparky.py index d1f1a86f..584e7e84 100644 --- a/examples/plotting/plot_sparky_savefile/plot_sparky.py +++ b/examples/plotting/plot_sparky_savefile/plot_sparky.py @@ -15,7 +15,7 @@ def plot(dic, data, outfile=None, xlims=[], ylims=[]): """ - Plot the sparky data as it was annotated in the save file + Plot the sparky data as it was annotated in the save file """ diff --git a/examples/processing/process_pipe_3d.py b/examples/processing/process_pipe_3d.py index b1ac4117..851a907e 100755 --- a/examples/processing/process_pipe_3d.py +++ b/examples/processing/process_pipe_3d.py @@ -7,7 +7,7 @@ print "Processing XY planes..." for i, (dic, plane) in enumerate(xiter): - + # process the direct dimension (x) dic, plane = ng.pipe_proc.zf(dic, plane, auto=True) dic, plane = ng.pipe_proc.ft(dic, plane, auto=True) @@ -21,7 +21,7 @@ dic, plane = ng.pipe_proc.ps(dic, plane, p0=0.0, p1=0.0) dic, plane = ng.pipe_proc.di(dic, plane) dic, plane = ng.pipe_proc.tp(dic, plane) - + # write out the plane #print "Writing out Z slice:",i,"/",xiter.i_max xiter.write("./ft/test%03d.ft2", plane, dic) diff --git a/examples/sample_applications/apod_viewer_1win.py b/examples/sample_applications/apod_viewer_1win.py index bdbd6b3d..9a4ebe27 100755 --- a/examples/sample_applications/apod_viewer_1win.py +++ b/examples/sample_applications/apod_viewer_1win.py @@ -35,13 +35,13 @@ def __init__(self, parent): self.qName1 = wx.StaticText(self, -1, "Type:") self.qName2 = wx.Choice(self, -1, choices=apod_list) self.Bind(wx.EVT_CHOICE, self.ApodChoose, self.qName2) - + self.q1_1 = wx.StaticText(self, -1, "q1:") self.q1_2 = wx.TextCtrl(self, -1, "0.0") self.q2_1 = wx.StaticText(self, -1, "q2:") self.q2_2 = wx.TextCtrl(self, -1, "1.0") - + self.q3_1 = wx.StaticText(self, -1, "q3:") self.q3_2 = wx.TextCtrl(self, -1, "1.0") @@ -83,17 +83,17 @@ def __init__(self, parent): apod_grid.AddMany([self.qName1, self.qName2, self.q1_1, self.q1_2, self.q2_1, self.q2_2, - self.q3_1, self.q3_2, + self.q3_1, self.q3_2, self.c1, self.c2, self.start_1, self.start_2, self.size_1, self.size_2, self.inv, self.use_size]) - + data_grid = wx.GridSizer(2, 2) data_grid.AddMany([self.points_1, self.points_2, self.sw_1, self.sw_2]) - apod_box = wx.StaticBoxSizer(wx.StaticBox(self, -1, + apod_box = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Apodization Parameters")) apod_box.Add(apod_grid) @@ -124,7 +124,7 @@ def ApodChoose(self, event): def InitApod(self, qName): """ Set the default parameter for a chosen apodization window """ - + if qName == "SP": self.q1_1.Enable(True) self.q1_1.SetLabel("off") @@ -239,22 +239,22 @@ def OnDraw(self, event): c = float(self.c2.GetValue()) start = float(self.start_2.GetValue()) size = float(self.size_2.GetValue()) - + inv = self.inv.GetValue() use_size = self.use_size.GetValue() points = float(self.points_2.GetValue()) sw = float(self.sw_2.GetValue()) - self.parent.ApplyApod(qName, q1, q2, q3, c, start, size, inv, + self.parent.ApplyApod(qName, q1, q2, q3, c, start, size, inv, use_size, points, sw) - + def OnClear(self, event): """ Clear all apodization windows previously drawn """ self.parent.ClearFigure() class CanvasFrame(wx.Frame): - """ + """ WX frame containing a matplotlib canvas where the apodization windows are drawn and the parameter panel where apodization parameter can be set. """ @@ -270,14 +270,14 @@ def __init__(self): self.params = ParameterPanel(self) self.toolbar = NavigationToolbar2Wx(self.canvas) self.toolbar.Realize() - + # layout fsizer = wx.BoxSizer(wx.VERTICAL) fsizer.Add(self.canvas, 0, wx.EXPAND) fsizer.Add(self.toolbar, 0, wx.EXPAND) self.sizer = wx.BoxSizer(wx.HORIZONTAL) - self.sizer.Add(self.params, 0, wx.EXPAND) + self.sizer.Add(self.params, 0, wx.EXPAND) self.sizer.Add(fsizer, 0, wx.EXPAND) self.SetSizer(self.sizer) @@ -292,10 +292,10 @@ def ClearFigure(self): self.axes.cla() self.OnPaint(-1) - def ApplyApod(self, qName, q1, q2, q3, c, start, size, inv, use_size, + def ApplyApod(self, qName, q1, q2, q3, c, start, size, inv, use_size, points, sw): """ Apply the selected apodization, draw the windows on the canvas """ - + # create the dictionary dic = ng.fileiobase.create_blank_udic(1) dic[0]["sw"] = sw diff --git a/examples/sample_applications/apod_viewer_2win.py b/examples/sample_applications/apod_viewer_2win.py index d8de75c6..00a981bc 100755 --- a/examples/sample_applications/apod_viewer_2win.py +++ b/examples/sample_applications/apod_viewer_2win.py @@ -36,13 +36,13 @@ def __init__(self, parent, id): self.qName1 = wx.StaticText(self, -1, "Type:") self.qName2 = wx.Choice(self, -1, choices=apod_list) self.Bind(wx.EVT_CHOICE, self.ApodChoose, self.qName2) - + self.q1_1 = wx.StaticText(self, -1, "q1:") self.q1_2 = wx.TextCtrl(self, -1, "0.0") self.q2_1 = wx.StaticText(self, -1, "q2:") self.q2_2 = wx.TextCtrl(self, -1, "1.0") - + self.q3_1 = wx.StaticText(self, -1, "q3:") self.q3_2 = wx.TextCtrl(self, -1, "1.0") @@ -84,17 +84,17 @@ def __init__(self, parent, id): apod_grid.AddMany([self.qName1, self.qName2, self.q1_1, self.q1_2, self.q2_1, self.q2_2, - self.q3_1, self.q3_2, + self.q3_1, self.q3_2, self.c1, self.c2, self.start_1, self.start_2, self.size_1, self.size_2, self.inv, self.use_size]) - + data_grid = wx.GridSizer(2, 2) data_grid.AddMany([self.points_1, self.points_2, self.sw_1, self.sw_2]) - apod_box = wx.StaticBoxSizer(wx.StaticBox(self, -1, + apod_box = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Apodization Parameters")) apod_box.Add(apod_grid) @@ -128,7 +128,7 @@ def ApodChoose(self, event): def InitApod(self, qName): """ Set the default parameter for a chosen apodization window """ - + if qName == "SP": self.q1_1.Enable(True) self.q1_1.SetLabel("off") @@ -243,22 +243,22 @@ def OnDraw(self, event): c = float(self.c2.GetValue()) start = float(self.start_2.GetValue()) size = float(self.size_2.GetValue()) - + inv = self.inv.GetValue() use_size = self.use_size.GetValue() points = float(self.points_2.GetValue()) sw = float(self.sw_2.GetValue()) - self.parent.ApplyApod(qName, q1, q2, q3, c, start, size, inv, + self.parent.ApplyApod(qName, q1, q2, q3, c, start, size, inv, use_size, points, sw) - + def OnClear(self, event): """ Clear all apodization windows previously drawn """ self.parent.ClearFigure() class CanvasFrame(wx.Frame): - """ + """ WX frame containing a matplotlib canvas where the apodization windows are drawn. Launches the parameter frame where apodization parameter can be set. """ @@ -273,7 +273,7 @@ def __init__(self): self.canvas = FigureCanvas(self, -1, self.figure) self.toolbar = NavigationToolbar2Wx(self.canvas) self.toolbar.Realize() - + # open parameter window win = ParameterFrame(self, -1) win.Show(True) @@ -294,10 +294,10 @@ def ClearFigure(self): self.axes.cla() self.OnPaint(-1) - def ApplyApod(self, qName, q1, q2, q3, c, start, size, inv, use_size, + def ApplyApod(self, qName, q1, q2, q3, c, start, size, inv, use_size, points, sw): """ Apply the selected apodization, draw the windows on the canvas """ - + # create the dictionary dic = ng.fileiobase.create_blank_udic(1) dic[0]["sw"] = sw diff --git a/examples/separate/separate_1d_varian/separate.py b/examples/separate/separate_1d_varian/separate.py index 74441f2f..166605ca 100755 --- a/examples/separate/separate_1d_varian/separate.py +++ b/examples/separate/separate_1d_varian/separate.py @@ -1,5 +1,5 @@ #! /usr/bin/env python -# Separate 1D Agilent/Varian data creating directories based on the +# Separate 1D Agilent/Varian data creating directories based on the # array parameter found in the procpar file. import nmrglue as ng diff --git a/examples/separate/separate_2d_bruker/separate.py b/examples/separate/separate_2d_bruker/separate.py index 278c39cd..bb3a4c54 100755 --- a/examples/separate/separate_2d_bruker/separate.py +++ b/examples/separate/separate_2d_bruker/separate.py @@ -1,5 +1,5 @@ #! /usr/bin/env python -# Separate 2D data sets from an arrayed data set, directories will be names +# Separate 2D data sets from an arrayed data set, directories will be names # 1, 2, 3, ... 23 import nmrglue as ng diff --git a/examples/separate/separate_2d_varian/separate.py b/examples/separate/separate_2d_varian/separate.py index cef817df..1e1e13b3 100755 --- a/examples/separate/separate_2d_varian/separate.py +++ b/examples/separate/separate_2d_varian/separate.py @@ -1,10 +1,10 @@ #! /usr/bin/env python -# Unarray 2D Agilent/Varian data creating directories based on array parameter +# Unarray 2D Agilent/Varian data creating directories based on array parameter # found in procpar file. import nmrglue as ng -# read in the NMR data +# read in the NMR data dic, data = ng.varian.read('arrayed_data.dir') # set the new size of the separated data diff --git a/nmrglue/analysis/leastsqbound.py b/nmrglue/analysis/leastsqbound.py index c25c19f2..31e7edb8 100644 --- a/nmrglue/analysis/leastsqbound.py +++ b/nmrglue/analysis/leastsqbound.py @@ -9,7 +9,7 @@ from scipy.optimize.minpack import _check_func except ImportError: from scipy.optimize._minpack_py import _check_func - + from scipy.optimize import _minpack, leastsq diff --git a/nmrglue/fileio/pipe.py b/nmrglue/fileio/pipe.py index 2efb49f9..19ff3716 100644 --- a/nmrglue/fileio/pipe.py +++ b/nmrglue/fileio/pipe.py @@ -499,7 +499,7 @@ def read(filename): Parameters ---------- filename : str | pathlib.Path | bytes | io.BytesIO - Filename or filemask of NMRPipe file(s) to read. Binary io.BytesIO stream + Filename or filemask of NMRPipe file(s) to read. Binary io.BytesIO stream (e.g. open(filename, "rb")) or bytes buffer can also be provided Returns @@ -1623,7 +1623,7 @@ def get_data(filename): data = np.frombuffer(filename, dtype=np.float32) else: data = np.fromfile(filename, 'float32') - + if data[2] - 2.345 > 1e-6: # check for byteswap data = data.byteswap() return data[512:] diff --git a/nmrglue/fileio/sparky.py b/nmrglue/fileio/sparky.py index 6460613d..b1b3f717 100644 --- a/nmrglue/fileio/sparky.py +++ b/nmrglue/fileio/sparky.py @@ -505,9 +505,9 @@ def read_4D(filename): Read a 4D Sparky file. See :py:func:`read` for documentation. """ seek_pos = os.stat(filename).st_size - + with open(filename, 'rb') as f: - + # read the file header dic = fileheader2dic(get_fileheader(f)) @@ -523,7 +523,7 @@ def read_4D(filename): # read the data and untile lenA = dic["w1"]["npoints"] lenZ = dic["w2"]["npoints"] - lenY = dic["w3"]["npoints"] + lenY = dic["w3"]["npoints"] lenX = dic["w4"]["npoints"] lentA = dic["w1"]["bsize"] lentZ = dic["w2"]["bsize"] @@ -870,7 +870,7 @@ def read_savefile(filename, spectrum_file=None): spectrum_file = dic["spectrum"]["abspathname"] except KeyError: spectrum_file = os.path.join(os.path.dirname(filename), dic["spectrum"]["pathname"]) - + try: d, data = read(spectrum_file) except FileNotFoundError: diff --git a/nmrglue/fileio/spinsolve.py b/nmrglue/fileio/spinsolve.py index 55ddabd2..4f3b2361 100644 --- a/nmrglue/fileio/spinsolve.py +++ b/nmrglue/fileio/spinsolve.py @@ -12,19 +12,19 @@ from . import jcampdx __developer_info__ = """ -Spinsolve is the software used on the Magritek benchtop NMR devices. +Spinsolve is the software used on the Magritek benchtop NMR devices. A spectrum is saved in a folder with several files. The spectral data is stored in these files: 'data.1d' (FID), 'spectrum.1d' (Fourier transformed) and 'spectrum_processed.1d' (FT + processed by spinsolve) Optional spectral data (System->Prefs->Setup->Global data storage): -'nmr_fid.dx' (FID stored in `JCAMP-DX standard `), -'spectrum.csv' and 'spectrum_processed.csv' (FT + processed by Spinsolve with ppm for each +'nmr_fid.dx' (FID stored in `JCAMP-DX standard `), +'spectrum.csv' and 'spectrum_processed.csv' (FT + processed by Spinsolve with ppm for each point and intensity delimited by ';') Other files: 'acqu.par' - all parameters that are used for acquisition 'protocol.par' - text file used to reload data back into the Spinsolve software -'processing.script' - text file to transfer Spinsolve software protocol settings +'processing.script' - text file to transfer Spinsolve software protocol settings into MNOVA The Spinsolve Expert software has a slightly different output: @@ -60,7 +60,7 @@ def parse_spinsolve_par_line(line): return name, float(value) except ValueError: return name, str(value) - + def read(dir='.', specfile=None, acqupar="acqu.par", procpar="proc.par"): """ diff --git a/nmrglue/util/xcpy.py b/nmrglue/util/xcpy.py index 6d611d87..a935f930 100644 --- a/nmrglue/util/xcpy.py +++ b/nmrglue/util/xcpy.py @@ -437,7 +437,7 @@ def main(): # check for .py extension and append it if not given if not scriptname.endswith('.py'): scriptname = scriptname + '.py' - + # run the script if it exists and then break from the for loop # and set the executed status to true if exists(scriptname): diff --git a/nmrglue/util/xcpy_test.py b/nmrglue/util/xcpy_test.py index f65a873f..85ff35ed 100644 --- a/nmrglue/util/xcpy_test.py +++ b/nmrglue/util/xcpy_test.py @@ -20,7 +20,7 @@ def main(): except ValueError: message = f""" Welcome to Python {python}. - No directory is currently open, + No directory is currently open, or none was passed on to this script. """