
.. 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-55



.. 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 |||nm
    2: subtract |||nm
    3: kinetics data |||nm







|

.. code-block:: Python

    from pylab import *
    from pyspecdata import *
    from itertools import cycle
    color_cycle = cycle(['#1f77b4', '#ff7f0e', '#2ca02c',
        '#d62728', '#9467bd', '#8c564b', '#e377c2',
        '#7f7f7f', '#bcbd22', '#17becf'])
    #init_logging('debug')
    data = find_file('200703_Ellman_before_SL.DSW',
        exp_type='UV_Vis/Ellmans_Assay')
    print("the experiments present in this file are:",data.keys())
    with figlist_var() as fl:
        fl.next("UV data")
        for k,thisspectrum in data.items():
            fl.plot(thisspectrum,
                    alpha=0.5,
                    label=k)
        ylabel(thisspectrum.get_units())
        ylim((-0.05,1))
        fl.next('subtract')
        subdata = {'TCM':data['TCM w_ellman'] - data['TCM w_o'],
                '136C':data['TCMI36C_w_ellman'] - data['TCMI36C w_o'],
                }
        for k,d in subdata.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)
        ylabel(d.get_units())
        gridandtick(gca())
        print("now I'm going to try a DSW file")
        data = find_file('Ras_Stability4',
                exp_type='UV_Vis/Ras_stability/200803_RT')
        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)
        ylabel(thisspectrum.get_units())
        ylim((-0.05,1))
        gridandtick(gca())


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

   **Total running time of the script:** (0 minutes 2.659 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>`_
