
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "auto_examples/UV/ellmans.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_auto_examples_UV_ellmans.py>`
        to download the full example code

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_auto_examples_UV_ellmans.py:


Manipulation of UV-Vis data
===========================

After you've looked at the simple UV-Vis example, this one shows how you can
manipulate UV-Vis data.

.. GENERATED FROM PYTHON SOURCE LINES 8-71



.. rst-class:: sphx-glr-horizontal


    *

      .. image-sg:: /auto_examples/UV/images/sphx_glr_ellmans_001.png
         :alt: UV data
         :srcset: /auto_examples/UV/images/sphx_glr_ellmans_001.png, /auto_examples/UV/images/sphx_glr_ellmans_001_2_00x.png 2.00x
         :class: sphx-glr-multi-img

    *

      .. image-sg:: /auto_examples/UV/images/sphx_glr_ellmans_002.png
         :alt: subtract
         :srcset: /auto_examples/UV/images/sphx_glr_ellmans_002.png, /auto_examples/UV/images/sphx_glr_ellmans_002_2_00x.png 2.00x
         :class: sphx-glr-multi-img

    *

      .. image-sg:: /auto_examples/UV/images/sphx_glr_ellmans_003.png
         :alt: kinetics data
         :srcset: /auto_examples/UV/images/sphx_glr_ellmans_003.png, /auto_examples/UV/images/sphx_glr_ellmans_003_2_00x.png 2.00x
         :class: sphx-glr-multi-img


.. rst-class:: sphx-glr-script-out

 .. code-block:: none

    the experiments present in this file are: dict_keys(['rxn buffer w_o', 'rxn buffer with', 'TCM w_o', 'TCMI36C w_o', 'rxn buff w_ellman', 'elution buff w_ellman', 'TCM w_ellman', 'TCMI36C_w_ellman'])
    now I'm going to try a DSW file
    the experiments present in this file are: dict_keys(['protein_1', 'protein_2', 'protein_3', 'protein_4', 'protein_5', 'protein_6', 'protein_7', 'protein_8', 'protein_9'])
    1: UV data |||pm
    2: subtract |||pm
    3: kinetics data |||pm







|

.. code-block:: Python


    from itertools import cycle
    import matplotlib.pyplot as plt
    import pyspecdata as psd

    # {{{ changeable parameters
    color_cycle = cycle(
        [
            "#1f77b4",
            "#ff7f0e",
            "#2ca02c",
            "#d62728",
            "#9467bd",
            "#8c564b",
            "#e377c2",
            "#7f7f7f",
            "#bcbd22",
            "#17becf",
        ]
    )
    # }}}
    # init_logging('debug')
    data = psd.find_file(
        "200703_Ellman_before_SL.DSW",
        exp_type="UV_Vis/Ellmans_Assay",
        zenodo="21041480",
    )
    print("the experiments present in this file are:", data.keys())
    with psd.figlist_var() as fl:
        fl.next("UV data")
        for k, thisspectrum in data.items():
            fl.plot(thisspectrum, alpha=0.5, label=k)
        plt.ylabel(thisspectrum.get_units())
        plt.ylim((-0.05, 1))
        fl.next("subtract")
        for k, d in {
            "TCM": data["TCM w_ellman"] - data["TCM w_o"],
            "136C": data["TCMI36C_w_ellman"] - data["TCMI36C w_o"],
        }.items():
            thiscolor = next(color_cycle)
            fl.plot(d, alpha=0.5, color=thiscolor, label=k)
            fl.plot(
                d - data["rxn buff w_ellman"],
                ":",
                alpha=0.5,
                color=thiscolor,
                label="%s, subtracted" % k,
            )
        plt.ylabel(d.get_units())
        psd.gridandtick(plt.gca())
        print("now I'm going to try a DSW file")
        data = psd.find_file(
            "Ras_Stability4",
            exp_type="UV_Vis/Ras_stability/200803_RT",
            zenodo="21041480",
        )
        print("the experiments present in this file are:", data.keys())
        fl.next("kinetics data")
        for k, thisspectrum in data.items():
            fl.plot(thisspectrum, alpha=0.5, label=k)
        plt.ylabel(thisspectrum.get_units())
        plt.ylim((-0.05, 1))
        psd.gridandtick(plt.gca())


.. rst-class:: sphx-glr-timing

   **Total running time of the script:** (0 minutes 2.650 seconds)


.. _sphx_glr_download_auto_examples_UV_ellmans.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: ellmans.ipynb <ellmans.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: ellmans.py <ellmans.py>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
