.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/proc_Ep.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_proc_Ep.py: Process Enhancement experiment ==================================================== Opens .h5 results file, uses rough_table_of_integrals() to roughly process dataset including generating a table of integrals .. GENERATED FROM PYTHON SOURCE LINES 7-66 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/images/sphx_glr_proc_Ep_001.png :alt: autoslicing! :srcset: /auto_examples/images/sphx_glr_proc_Ep_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_proc_Ep_002.png :alt: , extract signal pathway, check phase variation along indirect, FID sliced, phased, and aligned, table of integrals :srcset: /auto_examples/images/sphx_glr_proc_Ep_002.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_proc_Ep_003.png :alt: power terms :srcset: /auto_examples/images/sphx_glr_proc_Ep_003.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_proc_Ep_004.png :alt: check covariance test :srcset: /auto_examples/images/sphx_glr_proc_Ep_004.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_proc_Ep_005.png :alt: normalized $E(p(t))$ :srcset: /auto_examples/images/sphx_glr_proc_Ep_005.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_proc_Ep_006.png :alt: power log :srcset: /auto_examples/images/sphx_glr_proc_Ep_006.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_proc_Ep_007.png :alt: normalized $E(p)$ :srcset: /auto_examples/images/sphx_glr_proc_Ep_007.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!!! /home/jmfranck/git_repos/pyspecdata/pyspecdata/core.py:8693: RuntimeWarning: invalid value encountered in sqrt return np.sqrt(arg) 1: autoslicing! 2: Raw Data with averaged scans 3: power terms |||ms 4: check covariance test 5: normalized $E(p(t))$ |||s 6: power log 7: normalized $E(p)$ |||mW | .. code-block:: Python import pyspecProcScripts as prscr import pyspecdata as psd import datetime import matplotlib.pyplot as plt plt.rcParams["image.aspect"] = "auto" # needed for sphinx gallery # sphinx_gallery_thumbnail_number = 2 plt.rcParams.update({ "errorbar.capsize": 2, "figure.facecolor": (1.0, 1.0, 1.0, 0.0), # clear "axes.facecolor": (1.0, 1.0, 1.0, 0.9), # 90% transparent white "savefig.facecolor": (1.0, 1.0, 1.0, 0.0), # clear "savefig.bbox": "tight", "savefig.dpi": 300, "figure.figsize": (6, 5), }) with psd.figlist_var() as fl: thisfile, exptype, nodename = ( "240924_13p5mM_TEMPOL_ODNP_1.h5", "ODNP_NMR_comp/ODNP", "ODNP", ) s = psd.find_file( thisfile, exp_type=exptype, expno=nodename, lookup=prscr.lookup_table, ) orig_axis = s["indirect"] # let's save this so we # can pass it to the log s["indirect"] = ( s["indirect"]["start_times"] - s["indirect"]["start_times"][0] ) s.set_units("indirect", "s") s, _ = prscr.rough_table_of_integrals(s, fl=fl) assert psd.det_unit_prefactor(s.get_units("indirect")) == 0 s.set_error(s["indirect", 0].item() * 0.01) # We are not calculating the # errors in rough table of # integrals, so just make up a # reasonable sized random # number so that I can see the # relative errors! s /= s["indirect", 0:1] fl.next("normalized $E(p(t))$") s["indirect"] -= s["indirect"][0] fl.plot(s, "o") # {{{ this is just matplotlib time formatting ax = plt.gca() ax.xaxis.set_major_formatter( plt.FuncFormatter(lambda x, _: str(datetime.timedelta(seconds=x))) ) # }}} s["indirect"] = orig_axis s = prscr.convert_to_power(s, thisfile, exptype, fl=fl) fl.next("normalized $E(p)$") fl.plot(s, "o") .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 5.166 seconds) .. _sphx_glr_download_auto_examples_proc_Ep.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: proc_Ep.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: proc_Ep.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_