.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/proc_square_refl.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_square_refl.py: Process a square wave reflection ================================ Processes a square wave reflection in order to calculate the Q of a NMR probe. Optional to show the phasing and real on top of the fitted square wave reflection. .. GENERATED FROM PYTHON SOURCE LINES 10-39 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/images/sphx_glr_proc_square_refl_001.png :alt: hairpin probe show the frequency distribution :srcset: /auto_examples/images/sphx_glr_proc_square_refl_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_proc_square_refl_002.png :alt: hairpin probe after slice and mix down freq domain :srcset: /auto_examples/images/sphx_glr_proc_square_refl_002.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_proc_square_refl_003.png :alt: analytic signal :srcset: /auto_examples/images/sphx_glr_proc_square_refl_003.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_proc_square_refl_004.png :alt: blips, blips :srcset: /auto_examples/images/sphx_glr_proc_square_refl_004.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_proc_square_refl_005.png :alt: solenoid probe show the frequency distribution :srcset: /auto_examples/images/sphx_glr_proc_square_refl_005.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_proc_square_refl_006.png :alt: solenoid probe after slice and mix down freq domain :srcset: /auto_examples/images/sphx_glr_proc_square_refl_006.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none ---------- logging output to /home/jmfranck/pyspecdata.0.log ---------- --> proc_square_refl.py(25):pyspecdata.core 2024-10-26 15:42:07,466 INFO: processing dataset hairpin probe You didn't set units for ch before saving the data!!! You didn't set units for t before saving the data!!! logarithmic --> analyze_square_refl.py(123):pyspecdata.core analyze_square_refl 2024-10-26 15:42:08,068 INFO: frq: 14889966.915265452 --> analyze_square_refl.py(153):pyspecdata.core analyze_square_refl 2024-10-26 15:42:08,257 INFO: the amplitude is 0.5041899787959184 {R, A} {\bf Warning:} You have no error associated with your plot, and I want to flag this for now /home/jmfranck/git_repos/pyspecdata/pyspecdata/core.py:8646: Warning: You have no error associated with your plot, and I want to flag this for now warnings.warn( --> analyze_square_refl.py(225):pyspecdata.core analyze_square_refl 2024-10-26 15:42:08,581 INFO: output: {'A': 0.6191578695480574, 'C': 0.0007775310076085551, 'R': 8731153.71929354} --> analyze_square_refl.py(226):pyspecdata.core analyze_square_refl 2024-10-26 15:42:08,584 INFO: latex: $f(t)=0.62 e^{- 8.73\times 10^{6} t} + 0.00$ /home/jmfranck/git_repos/pyspecdata/pyspecdata/core.py:9192: RuntimeWarning: invalid value encountered in sqrt return np.sqrt(arg) --> analyze_square_refl.py(240):pyspecdata.core analyze_square_refl 2024-10-26 15:42:08,595 INFO: -11728.316475972004 --> proc_square_refl.py(25):pyspecdata.core 2024-10-26 15:42:08,810 INFO: processing dataset solenoid probe You didn't set units for ch before saving the data!!! You didn't set units for t before saving the data!!! logarithmic --> analyze_square_refl.py(123):pyspecdata.core analyze_square_refl 2024-10-26 15:42:09,201 INFO: frq: 14889553.824459042 --> analyze_square_refl.py(153):pyspecdata.core analyze_square_refl 2024-10-26 15:42:09,295 INFO: the amplitude is 0.5013108588730282 {R, A} {\bf Warning:} You have no error associated with your plot, and I want to flag this for now --> analyze_square_refl.py(225):pyspecdata.core analyze_square_refl 2024-10-26 15:42:09,614 INFO: output: {'A': 0.5118213811859424, 'C': 0.0021007698742564924, 'R': 3969130.4825602476} --> analyze_square_refl.py(226):pyspecdata.core analyze_square_refl 2024-10-26 15:42:09,617 INFO: latex: $f(t)=0.51 e^{- 3.97\times 10^{6} t} + 0.00$ --> analyze_square_refl.py(240):pyspecdata.core analyze_square_refl 2024-10-26 15:42:09,636 INFO: 22313.576370994408 1: hairpin probe show the frequency distribution |||MHz 2: hairpin probe after slice and mix down freq domain |||('MHz', None) 3: analytic signal |||μs 4: blips |||ns 5: solenoid probe show the frequency distribution |||MHz 6: solenoid probe after slice and mix down freq domain |||('MHz', None) | .. code-block:: Python from pylab import * from pyspecdata import * from pyspecProcScripts.third_level.analyze_square_refl import ( analyze_square_refl, ) from pyspecProcScripts import * init_logging(level="debug") rcParams["image.aspect"] = "auto" # sphinx_gallery_thumbnail_number = 3 with fl_mod() as fl: for filename, expno, dataset_name in [ ("210125_sqwv_cap_probe_1", "capture1", "hairpin probe"), ("210111_sqwv_sol_probe_1", "capture1", "solenoid probe"), ]: logger.info(strm("processing dataset", dataset_name)) d = find_file( filename, exp_type="ODNP_NMR_comp/test_equipment", expno=expno ) d.set_units("t", "s").name("Amplitude").set_units("V") d.setaxis("ch", r_[1, 2]) d.set_units("t", "s") analyze_square_refl( d, label=dataset_name, fl=fl, show_analytic_signal_phase=False, show_analytic_signal_real=False, ) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 12.261 seconds) .. _sphx_glr_download_auto_examples_proc_square_refl.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: proc_square_refl.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: proc_square_refl.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_