.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/tutorial_quickcontrol.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_tutorial_quickcontrol.py: Importing and processing data from QuickControl. ================================================ .. GENERATED FROM PYTHON SOURCE LINES 7-10 Quickcontrol is a software from Phasetech to control and record data from time-resolved measurements. The software saves the data in a folder containing several files .. GENERATED FROM PYTHON SOURCE LINES 10-16 .. code-block:: Python import numpy as np from skultrafast.quickcontrol import QC2DSpec from skultrafast import plot_helpers from skultrafast.data_io import get_twodim_dataset .. GENERATED FROM PYTHON SOURCE LINES 17-19 The following line returns a path to a folder containing the sample data. If necessary, it will try downloading the data from the internet. .. GENERATED FROM PYTHON SOURCE LINES 19-22 .. code-block:: Python p = get_twodim_dataset() .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/skultrafast/envs/latest/lib/python3.11/site-packages/pooch/downloaders.py:1037: UserWarning: The Figshare DOI '10.6084/m9.figshare.25745715' doesn't specify which version of the repository should be used. Figshare will point to the latest version available. warnings.warn( .. GENERATED FROM PYTHON SOURCE LINES 23-25 Lets look at the content of the folder. For measurements with quickcontrol, we are looking for `.info` files which contain all necessary information. .. GENERATED FROM PYTHON SOURCE LINES 25-45 .. code-block:: Python infos = list(p.glob('*.info')) infos # There are two `.info`-files the directory. The first, index 319, contains the # transient 1D-data and the second (320) the transient 2D-data. Here in this # tutorial, we will work with the 2D data. Therefore we select the second file # and open it by instancing an `QC2DSpec`-class. Given the info-file, the class # collects all necessary data from the folder. It is also responsible to turn # the saved data, which are still inferogramms, into 2D-spectra. This process # also includes some preprocessing. Below we we apply 2 times upsampling of pump # axis and use 10 pixel left and right to estimate and subtract an background # before taking the FFT. For apodization, we are use the default hamming window. plot_helpers.enable_style() data2d_info_path = list(p.glob('*#320.info'))[0] qc_file = QC2DSpec(data2d_info_path, upsampling=4, probe_filter=1) .. GENERATED FROM PYTHON SOURCE LINES 46-50 To create a dataset to work with form the raw data, we call the `make_ds` method. The method returns a dict of `TwoDim` objects to work with, containing parallel (`para`), perpendicular (`perp`) and isotropic (`iso`) datasets. We select the isotropic dataset. .. GENERATED FROM PYTHON SOURCE LINES 50-56 .. code-block:: Python ds_all = qc_file.make_ds() ds_iso = ds_all['iso'] ds_iso.background_correction((2100, 2200), deg=1) ds_iso.pump_wn *= 2162.5 / 2159.35 # correct pump calibration .. GENERATED FROM PYTHON SOURCE LINES 57-60 One method to check if the polarization is correct is to plot 1D-spectra at a early delay. The parallel spectrum should have a stronger signal. The following plot shows the 1D-spectra at 0.5 ps delay. .. GENERATED FROM PYTHON SOURCE LINES 60-64 .. code-block:: Python ds_all['para'].integrate_pump().plot.spec(0.5, add_legend=True) ds_all['perp'].integrate_pump().plot.spec(0.5, add_legend=True) .. image-sg:: /auto_examples/images/sphx_glr_tutorial_quickcontrol_001.png :alt: tutorial quickcontrol :srcset: /auto_examples/images/sphx_glr_tutorial_quickcontrol_001.png, /auto_examples/images/sphx_glr_tutorial_quickcontrol_001_1_50x.png 1.50x, /auto_examples/images/sphx_glr_tutorial_quickcontrol_001_2_00x.png 2.00x :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none [] .. GENERATED FROM PYTHON SOURCE LINES 65-67 .. code-block:: Python ds_iso.spec2d = ds_iso.spec2d.astype(np.float16) ds_iso.save_numpy("2D_example.npz") .. GENERATED FROM PYTHON SOURCE LINES 68-70 .. code-block:: Python ds2 = ds_iso.copy() ds2.spec2d = ds_iso.spec2d.astype(np.float16) .. GENERATED FROM PYTHON SOURCE LINES 71-73 .. code-block:: Python ds2.select_range((2100, 2200), (2100, 2200)).plot.contour(0.1) ds_iso.select_range((2100, 2200), (2100, 2200)).plot.contour(0.1) .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/images/sphx_glr_tutorial_quickcontrol_002.png :alt: tutorial quickcontrol :srcset: /auto_examples/images/sphx_glr_tutorial_quickcontrol_002.png, /auto_examples/images/sphx_glr_tutorial_quickcontrol_002_1_50x.png 1.50x, /auto_examples/images/sphx_glr_tutorial_quickcontrol_002_2_00x.png 2.00x :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/images/sphx_glr_tutorial_quickcontrol_003.png :alt: tutorial quickcontrol :srcset: /auto_examples/images/sphx_glr_tutorial_quickcontrol_003.png, /auto_examples/images/sphx_glr_tutorial_quickcontrol_003_1_50x.png 1.50x, /auto_examples/images/sphx_glr_tutorial_quickcontrol_003_2_00x.png 2.00x :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none {'fig':
, 'axs': array([], dtype=object), 0: {'ax': , 'contourf': , 'contour': , 'diag_line': , 'title': Text(0.05, 0.95, '100 fs')}} .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 13.647 seconds) .. _sphx_glr_download_auto_examples_tutorial_quickcontrol.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: tutorial_quickcontrol.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: tutorial_quickcontrol.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: tutorial_quickcontrol.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_