.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/compare_CPMG_echo.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_compare_CPMG_echo.py: compare CPMG echo ================= .. GENERATED FROM PYTHON SOURCE LINES 5-204 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_001.png :alt: control raw data for CPMG no power large cyc SW = 10.0 :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_002.png :alt: control abs of raw data for CPMG no power large cyc SW = 10.0, signal average :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_002.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_003.png :alt: control abs(t domain) comparison :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_003.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_004.png :alt: control raw data for echo no power large cyc SW = 10.0 :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_004.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_005.png :alt: control abs of raw data for echo no power large cyc SW = 10.0, signal average :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_005.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_006.png :alt: control raw data for CPMG no power simple cyc SW = 10.0 :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_006.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_007.png :alt: control abs of raw data for CPMG no power simple cyc SW = 10.0, signal average :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_007.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_008.png :alt: no power raw data for CPMG no power large cyc SW = 10.0 :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_008.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_009.png :alt: no power abs of raw data for CPMG no power large cyc SW = 10.0, signal average :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_009.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_010.png :alt: no power abs(t domain) comparison :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_010.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_011.png :alt: no power raw data for echo no power large cyc SW = 10.0 :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_011.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_012.png :alt: no power abs of raw data for echo no power large cyc SW = 10.0, signal average :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_012.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_013.png :alt: no power raw data for CPMG no power simple cyc SW = 10.0 :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_013.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_014.png :alt: no power abs of raw data for CPMG no power simple cyc SW = 10.0, signal average :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_014.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_015.png :alt: 30 dBm uw power raw data for CPMG 30dBm large cyc SW = 10.0 :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_015.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_016.png :alt: 30 dBm uw power abs of raw data for CPMG 30dBm large cyc SW = 10.0, signal average :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_016.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_017.png :alt: 30 dBm uw power abs(t domain) comparison :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_017.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_018.png :alt: 30 dBm uw power raw data for echo 30dBm large cyc SW = 10.0 :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_018.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_019.png :alt: 30 dBm uw power abs of raw data for echo 30dBm large cyc SW = 10.0, signal average :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_019.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_020.png :alt: 34 dBm uw power raw data for CPMG 34dBm large cyc SW = 10.0 :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_020.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_021.png :alt: 34 dBm uw power abs of raw data for CPMG 34dBm large cyc SW = 10.0, signal average :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_021.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_022.png :alt: 34 dBm uw power abs(t domain) comparison :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_022.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_023.png :alt: 34 dBm uw power raw data for echo 34 dBm large cyc SW = 10.0 :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_023.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_024.png :alt: 34 dBm uw power abs of raw data for echo 34 dBm large cyc SW = 10.0, signal average :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_024.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_025.png :alt: 34 dBm uw power raw data for CPMG 34 dBm large cyc SW = 10.0 :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_025.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_compare_CPMG_echo_026.png :alt: 34 dBm uw power abs of raw data for CPMG 34 dBm large cyc SW = 10.0, signal average :srcset: /auto_examples/images/sphx_glr_compare_CPMG_echo_026.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none You didn't set units for indirect before saving the data!!! You didn't set units for nEcho before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for nEcho before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for nEcho before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for nEcho before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for nEcho before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for nEcho before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for nEcho before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for nEcho before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for nEcho before saving the data!!! You didn't set units for t2 before saving the data!!! You didn't set units for indirect before saving the data!!! You didn't set units for t2 before saving the data!!! 1: control raw data for CPMG no power large cyc SW = 10.0 |||(None, None) 2: control abs of raw data for CPMG no power large cyc SW = 10.0, signal average |||(None, None) 3: control abs(t domain) comparison |||None 4: control raw data for echo no power large cyc SW = 10.0 |||(None, None) 5: control abs of raw data for echo no power large cyc SW = 10.0, signal average |||(None, None) 6: control raw data for CPMG no power simple cyc SW = 10.0 |||(None, None) 7: control abs of raw data for CPMG no power simple cyc SW = 10.0, signal average |||(None, None) 8: no power raw data for CPMG no power large cyc SW = 10.0 |||(None, None) 9: no power abs of raw data for CPMG no power large cyc SW = 10.0, signal average |||(None, None) 10: no power abs(t domain) comparison |||None 11: no power raw data for echo no power large cyc SW = 10.0 |||(None, None) 12: no power abs of raw data for echo no power large cyc SW = 10.0, signal average |||(None, None) 13: no power raw data for CPMG no power simple cyc SW = 10.0 |||(None, None) 14: no power abs of raw data for CPMG no power simple cyc SW = 10.0, signal average |||(None, None) 15: 30 dBm uw power raw data for CPMG 30dBm large cyc SW = 10.0 |||(None, None) 16: 30 dBm uw power abs of raw data for CPMG 30dBm large cyc SW = 10.0, signal average |||(None, None) 17: 30 dBm uw power abs(t domain) comparison |||None 18: 30 dBm uw power raw data for echo 30dBm large cyc SW = 10.0 |||(None, None) 19: 30 dBm uw power abs of raw data for echo 30dBm large cyc SW = 10.0, signal average |||(None, None) 20: 34 dBm uw power raw data for CPMG 34dBm large cyc SW = 10.0 |||(None, None) 21: 34 dBm uw power abs of raw data for CPMG 34dBm large cyc SW = 10.0, signal average |||(None, None) 22: 34 dBm uw power abs(t domain) comparison |||None 23: 34 dBm uw power raw data for echo 34 dBm large cyc SW = 10.0 |||(None, None) 24: 34 dBm uw power abs of raw data for echo 34 dBm large cyc SW = 10.0, signal average |||(None, None) 25: 34 dBm uw power raw data for CPMG 34 dBm large cyc SW = 10.0 |||(None, None) 26: 34 dBm uw power abs of raw data for CPMG 34 dBm large cyc SW = 10.0, signal average |||(None, None) | .. code-block:: Python import numpy as np import pyspecdata as psd from pyspecProcScripts import lookup_table, select_pathway def echo_interleave(d, phcycdim): "interleave even and odd echoes coming from phcycdim" assert d.get_ft_prop(phcycdim) retval = d.shape retval.pop(phcycdim) retval = retval.alloc(dtype=np.complex128, format=None) retval["nEcho", 0::2] = d["ph1", +1]["nEcho", 0::2] retval["nEcho", 1::2] = d["ph1", -1]["nEcho", 1::2] retval.copy_axes(d).copy_props(d) return retval with psd.figlist_var() as fl: for ( thisfile, exp_type, nodename, manystep_cpmg, thislabel, thisbasename, ) in [ # {{{ Tested Controls ( "240704_13p5mM_TEMPOL_CPMG.h5", "ODNP_NMR_comp/CPMG", "CPMG_1", True, "CPMG no power large cyc SW = 10.0", "control", ), ( "240704_13p5mM_TEMPOL_echo.h5", "ODNP_NMR_comp/Echoes", "echo_1", False, "echo no power large cyc SW = 10.0", "control", ), ( "240704_13p5mM_TEMPOL_CPMG.h5", "ODNP_NMR_comp/CPMG", "CPMG_2", False, "CPMG no power simple cyc SW = 10.0", "control", ), # }}} # {{{ No power ( "240702_13p5mM_TEMPOL_CPMG.h5", "ODNP_NMR_comp/CPMG", "CPMG_19", True, "CPMG no power large cyc SW = 10.0", "no power", ), ( "240702_13p5mM_TEMPOL_echo.h5", "ODNP_NMR_comp/Echoes", "echo_12", False, "echo no power large cyc SW = 10.0", "no power", ), ( "240702_13p5mM_TEMPOL_pm_CPMG.h5", "ODNP_NMR_comp/CPMG", "CPMG_1", True, "CPMG no power simple cyc SW = 10.0", "no power", ), ( "240702_13p5mM_TEMPOL_pm_CPMG.h5", "ODNP_NMR_comp/CPMG", "CPMG_2", True, "CPMG no power large cyc SW = 10.0", "no power", ), ( "240702_13p5mM_TEMPOL_pm_echo.h5", "ODNP_NMR_comp/Echoes", "echo_2", False, "echo no power large cyc SW = 10.0", "no power", ), ( "240702_13p5mM_TEMPOL_pm_echo.h5", "ODNP_NMR_comp/Echoes", "echo_3", False, "echo no power large cyc SW = 10.0", "no power", ), # }}} # {{{ 30 dBm ( "240702_13p5mM_TEMPOL_pm_30dB_CPMG.h5", "ODNP_NMR_comp/CPMG", "CPMG_1", True, "CPMG 30dBm large cyc SW = 10.0", "30 dBm uw power", ), ( "240702_13p5mM_TEMPOL_pm_30dB_echo.h5", "ODNP_NMR_comp/Echoes", "echo_1", False, "echo 30dBm large cyc SW = 10.0", "30 dBm uw power", ), ( "240702_13p5mM_TEMPOL_pm_30dB_CPMG.h5", "ODNP_NMR_comp/CPMG", "CPMG_2", True, "CPMG 30dBm large cyc SW = 10.0", "30 dBm uw power", ), ( "240702_13p5mM_TEMPOL_pm_30dB_echo.h5", "ODNP_NMR_comp/Echoes", "echo_2", False, "echo 30dBm large cyc SW = 10.0", "30 dBm uw power", ), # }}} # {{{ 34 dBm ( "240702_13p5mM_TEMPOL_pm_34dB_CPMG.h5", "ODNP_NMR_comp/CPMG", "CPMG_1", True, "CPMG 34dBm large cyc SW = 10.0", "34 dBm uw power", ), ( "240702_13p5mM_TEMPOL_pm_34dB_echo.h5", "ODNP_NMR_comp/Echoes", "echo_1", False, "echo 34 dBm large cyc SW = 10.0", "34 dBm uw power", ), ( "240702_13p5mM_TEMPOL_pm_34dB_CPMG.h5", "ODNP_NMR_comp/CPMG", "CPMG_2", True, "CPMG 34 dBm large cyc SW = 10.0", "34 dBm uw power", ), ( "240702_13p5mM_TEMPOL_pm_34dB_echo.h5", "ODNP_NMR_comp/Echoes", "echo_2", False, "echo 34 dBm large cyc SW = 10.0", "34 dBm uw power", ), # }}} ]: fl.basename = thisbasename thisd = psd.find_file( thisfile, exp_type=exp_type, expno=nodename, lookup=lookup_table ) thisd.squeeze() fl.next("raw data for %s" % thislabel) fl.image(thisd, interpolation="auto") fl.next("abs of raw data for %s, signal average" % thislabel) forplot = thisd.C.sum("nScans").ift("t2").run(abs) if "nEcho" in forplot.dimlabels: forplot.smoosh(["nEcho", "t2"], r"nEcho $\otimes$ t2") fl.image(forplot, interpolation="auto") thisd.ift("t2") fl.next("abs(t domain) comparison") if manystep_cpmg: thisd = echo_interleave(thisd, "ph1") thisd.set_prop("coherence_pathway", {"ph2": -2, "ph_overall": -1}) thisd = select_pathway(thisd, thisd.get_prop("coherence_pathway")) if "nEcho" in thisd.dimlabels: thisd.smoosh(["nEcho", "t2"], "t2") acq = thisd.get_prop("acq_params") echo_time = 1e-6 * 2 * (acq["tau_us"] + acq["p90_us"]) thisd["t2"] = (thisd["t2"]["nEcho"]) * echo_time + thisd["t2"][ "t2" ] if "nScans" in thisd.dimlabels: thisd.mean("nScans") fl.plot(abs(thisd), "o", label=thislabel) .. rst-class:: sphx-glr-timing **Total running time of the script:** (1 minutes 7.534 seconds) .. _sphx_glr_download_auto_examples_compare_CPMG_echo.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: compare_CPMG_echo.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: compare_CPMG_echo.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_