.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/epr_overlay2.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_epr_overlay2.py: Another EPR Alignment ===================== Please do see the other EPR alignment example. However, this EPR alignment represents a more challenging case b/c: - We are extracting 1D slices from a 2D dataset - The spectra are somewhat more dissimilar, and so require progressive alignment against an average .. GENERATED FROM PYTHON SOURCE LINES 15-55 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/images/sphx_glr_epr_overlay2_001.png :alt: Raw :srcset: /auto_examples/images/sphx_glr_epr_overlay2_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_epr_overlay2_002.png :alt: correlation :srcset: /auto_examples/images/sphx_glr_epr_overlay2_002.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_epr_overlay2_003.png :alt: find center :srcset: /auto_examples/images/sphx_glr_epr_overlay2_003.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_epr_overlay2_004.png :alt: before centering -- ift :srcset: /auto_examples/images/sphx_glr_epr_overlay2_004.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_epr_overlay2_005.png :alt: after centering -- ift :srcset: /auto_examples/images/sphx_glr_epr_overlay2_005.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_epr_overlay2_006.png :alt: aligned, autoscaled :srcset: /auto_examples/images/sphx_glr_epr_overlay2_006.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_epr_overlay2_007.png :alt: epr overlay2 :srcset: /auto_examples/images/sphx_glr_epr_overlay2_007.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_epr_overlay2_008.png :alt: normalized after alignment :srcset: /auto_examples/images/sphx_glr_epr_overlay2_008.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none 1: Raw |||mT 2: correlation |||mT 3: find center |||mT 4: before centering -- ift |||kcyc · (T)$^{-1}$ 5: after centering -- ift |||kcyc · (T)$^{-1}$ 6: aligned, autoscaled |||mT 7: centered spectra 8: normalized after alignment |||mT /home/jmfranck/git_repos/pyspecdata/pyspecdata/figlist.py:782: 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 pyspecdata import find_file, figlist_var from pyspecProcScripts import align_esr import matplotlib.pyplot as plt d = {} d["250130 data: initial sample at 293K"] = find_file( "250130_20mM_TSO4_W20_Isooct_run1.DSC", exp_type="francklab_esr/romana" ) # cooling d["240220 data: initial sample at 293K"] = find_file( "240220_TempoSO4_W20_run1.DSC", exp_type="francklab_esr/romana" ) # cooling d["250206: Before cooling bath"] = find_file( "250206_20mM_TSO4_W20_C8.DSC", exp_type="francklab_esr/romana" ) # cooling for k, v in d.items(): if "250206" in k: d[k] = v.chunk_auto("harmonic", "harmonic")["harmonic", 0]["phase", 0] else: d[k] = v.chunk_auto("harmonic", "harmonic")["harmonic", 0]["phase", 0] d[k].reorder("Temperature").sort("Temperature") d[k] = d[k]["Temperature":293] with figlist_var() as fl: d = align_esr(d, fl=fl) fl.next("normalized after alignment") # If the data very dissimilar, the least-squares scaling doesn't # work as well. For these, it makes more sense to use a peak # normalization. for k, v in d.items(): extra_norm = abs(d[k].data.max() - d[k].data.min()) d[k] /= extra_norm d[k].set_prop("scaling", d[k].get_prop("scaling") * extra_norm) fl.plot( d[k], alpha=0.5, label=f"{k}\n÷ {d[k].get_prop('scaling'):#0.3g}", ) fl.adjust_spines("bottom") plt.ylabel("") plt.gca().set_yticks([]) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.817 seconds) .. _sphx_glr_download_auto_examples_epr_overlay2.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: epr_overlay2.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: epr_overlay2.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_