.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/integrate_limits_realData.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_integrate_limits_realData.py: Demonstrate Integrate Limits on Experimental Data ================================================= Here we load in low SNR Hahn echo data and demonstrate that we can find reasonable and accurate integration limits on this data. Similar to the demonstration on fake data, we use integrate_limits to detect the frequency limits used for peak integration, and demonstrate, separately, the integration limits using a matched Lorentzian filter and a matched Gaussian filter on our frequency domain data. We illustrate the position of the frequency limits with vertical lines on the final plots. .. GENERATED FROM PYTHON SOURCE LINES 19-68 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/images/sphx_glr_integrate_limits_realData_001.png :alt: Lorentzian method: integration diagnostic :srcset: /auto_examples/images/sphx_glr_integrate_limits_realData_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_integrate_limits_realData_002.png :alt: Lorentzian method: matched filter diagnostic -- signal Energy :srcset: /auto_examples/images/sphx_glr_integrate_limits_realData_002.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_integrate_limits_realData_003.png :alt: Lorentzian method: matched filter diagnostic -- time domain :srcset: /auto_examples/images/sphx_glr_integrate_limits_realData_003.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_integrate_limits_realData_004.png :alt: Gaussian method: integration diagnostic :srcset: /auto_examples/images/sphx_glr_integrate_limits_realData_004.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_integrate_limits_realData_005.png :alt: Gaussian method: matched filter diagnostic -- signal Energy :srcset: /auto_examples/images/sphx_glr_integrate_limits_realData_005.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_integrate_limits_realData_006.png :alt: Gaussian method: matched filter diagnostic -- time domain :srcset: /auto_examples/images/sphx_glr_integrate_limits_realData_006.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none You didn't set units for t2 before saving the data!!! phasing dimension as one | .. code-block:: Python from pylab import * from pyspecdata import * from pyspecProcScripts import * fl = figlist_var() rcParams["image.aspect"] = "auto" # sphinx_gallery_thumbnail_number = 1 for ( filename, expno, subplot_name, ) in [ # ('210604_50mM_4AT_AOT_w11_cap_probe_echo_tau_1000_before_noApod_ex','prealignment','tau1000, before'), # ('210604_50mM_4AT_AOT_w11_cap_probe_echo_tau_1000_after_noApod_ex','aligned','tau1000, after'), # ('210604_50mM_4AT_AOT_w11_cap_probe_echo_tau_3500_before_noApod_ex','prealignment','tau3500, before'), # ('210604_50mM_4AT_AOT_w11_cap_probe_echo_tau_3500_after_noApod_ex','aligned','tau3500, after'), # ('210604_50mM_4AT_AOT_w11_cap_probe_echo_tau_11_before_noApod_ex','prealignment','tau11135, before'), ( "210604_50mM_4AT_AOT_w11_cap_probe_echo_tau_11_after_noApod_ex", "aligned", "tau11135, after", ), ]: d = find_file(filename, exp_type="ODNP_NMR_comp/processed", expno=expno) signal_pathway = {"ph1": 1, "ph2": 0} excluded_pathways = [(0, 0), (0, -1)] d.ift("t2") # Zeroth order correction ph0 = select_pathway(d["t2":0], signal_pathway) if len(ph0.dimlabels) > 0: assert len(ph0.dimlabels) == 1, ( repr(ndshape(ph0.dimlabels)) + " has too many dimensions" ) ph0 = zeroth_order_ph(ph0) print("phasing dimension as one") else: print( "there is only one dimension left -- standard 1D zeroth order phasing" ) ph0 = ph0 / abs(ph0) d /= ph0 fl.basename = expno d.ft("t2") for method in ["Lorentzian", "Gaussian"]: fl.basename = "%s method: " % method freq_lim = integrate_limits( select_pathway(d, signal_pathway), convolve_method=method, fl=fl ) fl.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.787 seconds) .. _sphx_glr_download_auto_examples_integrate_limits_realData.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: integrate_limits_realData.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: integrate_limits_realData.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_