.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/FIDtoEcho_Actual.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_FIDtoEcho_Actual.py: FID from Echo after Phasing and Timing Correction ================================================= Demonstrate how we can automatically find the zeroth order phase and the center of the echo and then slice, in order to get a properly phased FID. Here we see this This example provides a relatively routine example. .. GENERATED FROM PYTHON SOURCE LINES 11-44 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_001.png :alt: enhancement_10C autoslicing! :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_002.png :alt: enhancement_10C power terms :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_002.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_003.png :alt: enhancement_10C check covariance test :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_003.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_004.png :alt: enhancement_10C residual after shift :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_004.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_005.png :alt: enhancement_10C final phased spectrum :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_005.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_006.png :alt: enhancement_10C_repeat autoslicing! :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_006.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_007.png :alt: enhancement_10C_repeat power terms :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_007.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_008.png :alt: enhancement_10C_repeat check covariance test :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_008.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_009.png :alt: enhancement_10C_repeat residual after shift :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_009.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_010.png :alt: enhancement_10C_repeat final phased spectrum :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_010.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_011.png :alt: enhancement_15C autoslicing! :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_011.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_012.png :alt: enhancement_15C power terms :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_012.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_013.png :alt: enhancement_15C check covariance test :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_013.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_014.png :alt: enhancement_15C residual after shift :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_014.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_015.png :alt: enhancement_15C final phased spectrum :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_015.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_016.png :alt: enhancement_21C autoslicing! :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_016.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_017.png :alt: enhancement_21C power terms :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_017.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_018.png :alt: enhancement_21C check covariance test :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_018.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_019.png :alt: enhancement_21C residual after shift :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_019.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_020.png :alt: enhancement_21C final phased spectrum :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_020.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_021.png :alt: enhancement_5C autoslicing! :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_021.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_022.png :alt: enhancement_5C power terms :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_022.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_023.png :alt: enhancement_5C check covariance test :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_023.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_024.png :alt: enhancement_5C residual after shift :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_024.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_025.png :alt: enhancement_5C final phased spectrum :srcset: /auto_examples/images/sphx_glr_FIDtoEcho_Actual_025.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none ---------- logging output to /home/jmfranck/pyspecdata.0.log ---------- You didn't set units for power before saving the data!!! /home/jmfranck/git_repos/proc_scripts/pyspecProcScripts/load_data.py:567: RuntimeWarning: invalid value encountered in divide s.getaxis("power") / prog_power, peakrange [-134.95278479 429.39522435] You didn't set units for power before saving the data!!! peakrange [-134.95278479 343.51617948] You didn't set units for power before saving the data!!! peakrange [-208.56339468 294.44243955] You didn't set units for power before saving the data!!! peakrange [-220.83182966 429.39522435] You didn't set units for power before saving the data!!! /home/jmfranck/git_repos/pyspecdata/pyspecdata/figlist.py:418: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`). Consider using `matplotlib.pyplot.close()`. fig = plt.figure(num_figs_before_add + 1, **kwargs) peakrange [-134.95278479 343.51617948] 1: enhancement_10C autoslicing! 2: enhancement_10C power terms |||ms 3: enhancement_10C check covariance test 4: enhancement_10C residual after shift 5: enhancement_10C final phased spectrum |||('kHz', None) 6: enhancement_10C_repeat autoslicing! 7: enhancement_10C_repeat power terms |||ms 8: enhancement_10C_repeat check covariance test 9: enhancement_10C_repeat residual after shift 10: enhancement_10C_repeat final phased spectrum |||('kHz', None) 11: enhancement_15C autoslicing! 12: enhancement_15C power terms |||ms 13: enhancement_15C check covariance test 14: enhancement_15C residual after shift 15: enhancement_15C final phased spectrum |||('kHz', None) 16: enhancement_21C autoslicing! 17: enhancement_21C power terms |||ms 18: enhancement_21C check covariance test 19: enhancement_21C residual after shift 20: enhancement_21C final phased spectrum |||('kHz', None) 21: enhancement_5C autoslicing! 22: enhancement_5C power terms |||ms 23: enhancement_5C check covariance test 24: enhancement_5C residual after shift 25: enhancement_5C final phased spectrum |||('kHz', None) | .. code-block:: Python import pyspecdata as psd import pyspecProcScripts as pypcs import matplotlib.pyplot as plt from pyspecProcScripts.load_data import lookup_table psd.init_logging(level="info") plt.rcParams["image.aspect"] = "auto" # needed for sphinx gallery # sphinx_gallery_thumbnail_number = 1 signal_pathway = {"ph1": 1} with psd.figlist_var(file_name="tempdata220922final.pdf") as fl: for nodename in [ "enhancement_10C", "enhancement_10C_repeat", "enhancement_15C", "enhancement_21C", "enhancement_5C", ]: d = psd.find_file( "211103_TEMPOL_269uM_HeatExch.h5", exp_type="ODNP_NMR_comp/ODNP", postproc="spincore_ODNP_v1", lookup=lookup_table, expno=nodename, ) # returns signal with t=0 set approximately correctly fl.basename = nodename d = pypcs.fid_from_echo(d, signal_pathway, fl=fl) fl.next("final phased spectrum") fl.image(d) # in the following, I assume the units are auto-scaled to kHz print("peakrange", d.get_prop("peakrange")) plt.axvline(x=d.get_prop("peakrange")[0] / 1e3, color="w", ls=":") plt.axvline(x=d.get_prop("peakrange")[1] / 1e3, color="w", ls=":") .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 12.416 seconds) .. _sphx_glr_download_auto_examples_FIDtoEcho_Actual.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: FIDtoEcho_Actual.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: FIDtoEcho_Actual.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_