.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/QESR_samesample.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_QESR_samesample.py: QESR of same sample =================== Here, we sit and acquire the same sample with different acquisition parameters, and make sure we get the same QESR. We do this b/c the data is not stored by XEPR in a way that we would expect. Note that some of these datasets are not great b/c we didn't capture enough of the baseline to either side (and we see here why this is a problem), and so the QESR doesn't do great. However, both with the single integral (absorption) plot and more precisely with the ESR alignment we conduct at the end, we see that we have properly scaled the spectra. Note this doesn't mean they are equal -- we are able to see subtle (or not so subtle) differences in the scaling because of overmodulation -- if the spectra are not overmodulated, they match in scaling to within a few percent. See the `QESR.py` example for information about setting your pyspecdata config so that this works correctly! .. GENERATED FROM PYTHON SOURCE LINES 26-73 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/images/sphx_glr_QESR_samesample_001.png :alt: Raw and unscaled :srcset: /auto_examples/images/sphx_glr_QESR_samesample_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_QESR_samesample_002.png :alt: zoomed-in baseline diagnostic showing only baseline (data and fit) :srcset: /auto_examples/images/sphx_glr_QESR_samesample_002.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_QESR_samesample_003.png :alt: abs mode: background subtracted, show baseline, $\left(\frac{dblint}{denom}\right)(calibration\ \rightarrow None)$ :srcset: /auto_examples/images/sphx_glr_QESR_samesample_003.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_QESR_samesample_004.png :alt: Raw :srcset: /auto_examples/images/sphx_glr_QESR_samesample_004.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_QESR_samesample_005.png :alt: correlation :srcset: /auto_examples/images/sphx_glr_QESR_samesample_005.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_QESR_samesample_006.png :alt: find center :srcset: /auto_examples/images/sphx_glr_QESR_samesample_006.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_QESR_samesample_007.png :alt: before centering -- ift :srcset: /auto_examples/images/sphx_glr_QESR_samesample_007.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_QESR_samesample_008.png :alt: after centering -- ift :srcset: /auto_examples/images/sphx_glr_QESR_samesample_008.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_QESR_samesample_009.png :alt: aligned, autoscaled :srcset: /auto_examples/images/sphx_glr_QESR_samesample_009.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_QESR_samesample_010.png :alt: This plot shows we know how to scale the amplitude correctly for a range of different experimental parameters :srcset: /auto_examples/images/sphx_glr_QESR_samesample_010.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none 122.54129577330296 µM 122.63159081503636 µM 121.01885133606305 µM 85.85711532617417 µM 103.46665273851991 µM 123.48150086226747 µM 1: Raw and unscaled |||kG 2: baseline diagnostic {'print_string': '\\par'} {'width': 0.9} 3: absorption, bg. no bl. |||G {'print_string': "\\textbf{\\texttt{array([-0.66800288, -0.65361027, -0.64696326, ..., -0.63123704,\n -0.6245511 , -0.62821853], dtype='>f8')\n\tdimlabels=['$B_0$']\n\taxes={`$B_0$':array([3446.35 , 3446.42431641, 3446.49863281, ..., 3522.22705119,\n 3522.30136759, 3522.375684 ])\n\t\t\t+/-None}\n}}\\par"} {'print_string': '\\par'} {'print_string': "\\textbf{\\texttt{array([-0.84621271, -0.84798547, -0.85663472, ..., -0.92580633,\n -0.93721423, -0.94834255], dtype='>f8')\n\tdimlabels=['$B_0$']\n\taxes={`$B_0$':array([3446.35 , 3446.42431641, 3446.49863281, ..., 3522.22705119,\n 3522.30136759, 3522.375684 ])\n\t\t\t+/-None}\n}}\\par"} {'print_string': '\\par'} {'print_string': "\\textbf{\\texttt{array([-0.65345155, -0.66422002, -0.668981 , ..., -0.66078097,\n -0.66666975, -0.68187683], dtype='>f8')\n\tdimlabels=['$B_0$']\n\taxes={`$B_0$':array([3446.35 , 3446.42431641, 3446.49863281, ..., 3522.22705119,\n 3522.30136759, 3522.375684 ])\n\t\t\t+/-None}\n}}\\par"} {'print_string': '\\par'} {'print_string': "\\textbf{\\texttt{array([-0.14620168, -0.15906198, -0.16895391, ..., -0.15180505,\n -0.15562279, -0.15686577], dtype='>f8')\n\tdimlabels=['$B_0$']\n\taxes={`$B_0$':array([3457.1 , 3457.15332031, 3457.20664063, ..., 3511.54003937,\n 3511.59335969, 3511.64668 ])\n\t\t\t+/-None}\n}}\\par"} {'print_string': '\\par'} {'print_string': "\\textbf{\\texttt{array([-0.15020269, -0.15608694, -0.16756175, ..., -0.16405414,\n -0.16407345, -0.15961655], dtype='>f8')\n\tdimlabels=['$B_0$']\n\taxes={`$B_0$':array([3457.1 , 3457.12666016, 3457.15332031, ..., 3511.62001969,\n 3511.64667984, 3511.67334 ])\n\t\t\t+/-None}\n}}\\par"} {'print_string': '\\par'} {'print_string': "\\textbf{\\texttt{array([-0.15980043, -0.15991529, -0.14795795, ..., -0.17369751,\n -0.16198296, -0.14956213], dtype='>f8')\n\tdimlabels=['$B_0$']\n\taxes={`$B_0$':array([3457.1 , 3457.12666016, 3457.15332031, ..., 3511.62001969,\n 3511.64667984, 3511.67334 ])\n\t\t\t+/-None}\n}}\\par"} {'print_string': '\\par'} 4: Raw |||mT 5: correlation |||mT 6: find center |||mT 7: before centering -- ift |||kcyc · (T)$^{-1}$ 8: after centering -- ift |||kcyc · (T)$^{-1}$ 9: aligned, autoscaled |||mT {'width': 0.98} 10: centered spectra \par \textbf{\texttt{array([-0.66800288, -0.65361027, -0.64696326, ..., -0.63123704, -0.6245511 , -0.62821853], dtype='>f8') dimlabels=['$B_0$'] axes={`$B_0$':array([3446.35 , 3446.42431641, 3446.49863281, ..., 3522.22705119, 3522.30136759, 3522.375684 ]) +/-None} }}\par \par \textbf{\texttt{array([-0.84621271, -0.84798547, -0.85663472, ..., -0.92580633, -0.93721423, -0.94834255], dtype='>f8') dimlabels=['$B_0$'] axes={`$B_0$':array([3446.35 , 3446.42431641, 3446.49863281, ..., 3522.22705119, 3522.30136759, 3522.375684 ]) +/-None} }}\par \par \textbf{\texttt{array([-0.65345155, -0.66422002, -0.668981 , ..., -0.66078097, -0.66666975, -0.68187683], dtype='>f8') dimlabels=['$B_0$'] axes={`$B_0$':array([3446.35 , 3446.42431641, 3446.49863281, ..., 3522.22705119, 3522.30136759, 3522.375684 ]) +/-None} }}\par \par \textbf{\texttt{array([-0.14620168, -0.15906198, -0.16895391, ..., -0.15180505, -0.15562279, -0.15686577], dtype='>f8') dimlabels=['$B_0$'] axes={`$B_0$':array([3457.1 , 3457.15332031, 3457.20664063, ..., 3511.54003937, 3511.59335969, 3511.64668 ]) +/-None} }}\par \par \textbf{\texttt{array([-0.15020269, -0.15608694, -0.16756175, ..., -0.16405414, -0.16407345, -0.15961655], dtype='>f8') dimlabels=['$B_0$'] axes={`$B_0$':array([3457.1 , 3457.12666016, 3457.15332031, ..., 3511.62001969, 3511.64667984, 3511.67334 ]) +/-None} }}\par \par \textbf{\texttt{array([-0.15980043, -0.15991529, -0.14795795, ..., -0.17369751, -0.16198296, -0.14956213], dtype='>f8') dimlabels=['$B_0$'] axes={`$B_0$':array([3457.1 , 3457.12666016, 3457.15332031, ..., 3511.62001969, 3511.64667984, 3511.67334 ]) +/-None} }}\par \par /home/jmfranck/git_repos/pyspecdata/pyspecdata/figlist.py:772: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect. plt.gcf().tight_layout() | .. code-block:: Python from matplotlib.pyplot import title, rcParams from pyspecdata import find_file, figlist_var from pyspecProcScripts import QESR, align_esr from collections import OrderedDict rcParams["image.aspect"] = "auto" # needed for sphinx gallery # sphinx_gallery_thumbnail_number = 9 fieldaxis = "$B_0$" plot_rescaled = False water_nddata = find_file("230511_water.DSC", exp_type="francklab_esr/romana")[ "harmonic", 0 ] d = OrderedDict() for file_searchstring, thislabel, exp_type in [ ("250321_OHT_control", "control", "francklab_esr/Warren"), ("250321_OHT_gaindown", "lower gain", "francklab_esr/Warren"), ("250321_OHT_moddown", "lower mod", "francklab_esr/Warren"), ( "250321_OHT_followmodrule", "lowest (good) mod", "francklab_esr/Warren", ), ("250321_OHT_morepoint", "more points", "francklab_esr/Warren"), ("250321_OHT_lowpower", "low power", "francklab_esr/Warren"), ]: d[thislabel] = find_file(file_searchstring, exp_type=exp_type).chunk_auto( "harmonic" )["harmonic", 0]["phase", 0] with figlist_var() as fl: fl.next("Raw and unscaled") for k, v in d.items(): fl.plot(v, label=k, alpha=0.7) for k, v in d.items(): c = QESR( v, label=k, fl=fl, ) print(f"{c:~P}") d = align_esr(d, fl=fl) title( "This plot shows we know how to scale the amplitude\n" "correctly for a range of different experimental parameters" ) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 4.881 seconds) .. _sphx_glr_download_auto_examples_QESR_samesample.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: QESR_samesample.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: QESR_samesample.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_