{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Analyzing Broadband Spectra with the `assignment` Module\n", "\n", "## Introduction\n", "\n", "In this notebook, we're going to work through how the core functionality of `PySpecTools` can be used to streamline and automate your spectral analysis. It's worth noting that `PySpecTools` and Python provide enough flexibility for you to adjust to your needs; whatever can't be done with `PySpecTools` natively could be automated with Python (e.g. `for` loops) and to a large extent `pandas` as well. In the latter case, particularly when you're analyzing the assignments, and looking to filter out certain molecules, etc. This may be left for a subsequent notebook as the focus of this notebook is to demonstrate how automated assignment is performed.\n", "\n", "The core functionality of assigning spectra revolves around the `pyspectools.spectra.assignment` module, and contains three main abstractions:\n", "\n", "1. `AssignmentSession`\n", " - This is your main interface: holds the spectral data, and allows you to interact (plot, assign, etc) with the data.\n", "2. `Transition`\n", " - Represents every type of spectral feature: every peak in an experiment, and every catalog entry.\n", "3. `LineList`\n", " - A collection of spectral features: the peaks in an experiment (which in themselves are `Transition` objects), and catalogs.\n", "\n", "We will demonstrate how these pieces come together by looking at some of our published data: this notebook was used to analyze the Benzene discharge experiments reported in these two papers: \n", "\n", "McCarthy, M. C.; Lee, K. L. K.; Carroll, P. B.; Porterfield, J. P.; Changala, P. B.; Thorpe, J. H.; Stanton, J. F. Exhaustive Product Analysis of Three Benzene Discharges by Microwave Spectroscopy. J. Phys. Chem. A 2020, 124 (25), 5170–5181. https://doi.org/10.1021/acs.jpca.0c02919.\n", "\n", "Lee, K. L. K.; McCarthy, M. Study of Benzene Fragmentation, Isomerization, and Growth Using Microwave Spectroscopy. J. Phys. Chem. Lett. 2019, 10 (10), 2408–2413. https://doi.org/10.1021/acs.jpclett.9b00586.\n", "\n", "The full dataset can also be found on our [Zenodo repository](https://zenodo.org/record/3827742); notebook \"4000\" most closely resembles this (this is a much more heavily marked up version).\n", "\n", "We should stress that, while this is mostly automated, it does not change the fact that spectral analysis is _very much an iterative process_. You will make modifications to the way you do your analysis, and many things you won't know until you've run it at least once. The point of having this notebook is so that it is reproducible and transparent: you can always modify the code and re-run the whole notebook with the latest analysis." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To begin the analysis, we will construct an `AssignmentSession` object using the class method, `AssignmentSession.from_ascii(...)`. This method will take your ASCII spectrum containing frequency and intensity information, and parse it using `pandas` and store it as a `DataFrame`. With all Python routines, you can call the function/method with a question mark at the end to pull up the documentation associated with that function/method:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from pyspectools.spectra.assignment import AssignmentSession, LineList" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this case, we're setting up the session based on the Benzene data, which is a tab-delimited text file with a header. We ignore the header with `skiprows=`, and provide our own column names with the `col_names` argument. Additionally, we're going to specify the composition we expect for the experiment with the `composition` kwarg: ideally we would only include `[\"C\", \"H\"]`, however we know there are atmospheric impurities like nitrogen and oxygen that get incorporated in the discharge products. This keyword _will affect Splatalogue assignments_, and exclude catalogs that contain irrelevant compositions like metal-bearing molecules." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "session = AssignmentSession.from_ascii(\n", " \"chirp_data/ft2632_hanning_620.txt\",\n", " experiment=4000,\n", " col_names=[\"Frequency\", \"Intensity\"],\n", " skiprows=1,\n", " composition=[\"C\", \"H\", \"N\", \"O\"],\n", " verbose=False\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can also adjust many of these settings after the fact, which are stored as attributes of the `Session` object within an `AssignmentSession`. For example, the `temperature` attribute will set an upper limit to the lower state energies of states assignable: we will ignore all features that are double this specified energy. This isn't the direct threshold, because it nominally corresponds to what your experimental temperature is, and depending on how prominent molecule is, you may see higher temperature transitions. Another useful thing to set is the maximum tolerance for uncertainty in catalog entries: we would like to reject assignments based on poorly predicted lines, which is set by the `max_uncertainty` attribute." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# temperature in K\n", "session.session.temperature = 10.\n", "\n", "# uncertainty in MHz\n", "session.session.max_uncertainty = 0.2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that frequency units are in MHz, and temperature in kelvin.\n", "\n", "The next step is to pre-process the spectrum. Our chirped-pulse data are collected using Kyle Crabtree's `blackchirp` program, and often we apply a window function to the data. If you are looking at raw FFT data, `PySpecTools` provides access to window functions defined in `scipy.signal`, which you can access in a syntax like this:\n", "\n", "```python\n", "session.apply_filter(\"hanning\")\n", "```\n", "\n", "The full list of filters can be found [in the SciPy documentation](https://docs.scipy.org/doc/scipy/reference/signal.windows.html#module-scipy.signal.windows).\n", "\n", "After pre-processing, we will perform peak detection and baseline correction. This is done using the `session.find_peaks` functionality, which automates several steps based on the keyword arguments. All of the analysis in `PySpecTools` is done preferably in units of signal-to-noise ratio (SNR), which is established by fitting a baseline (a _vector_, not scalar), and dividing the entire spectrum element-wise. SNR is definitely more meaningful than a raw voltage scale typically reported.\n", "\n", "In the default way of peak finding, we use the asymmetric least-squares (ALS) method to fit a baseline (`als=True`). Essentially this can be thought of as a penalized least-squares method, with additional parameters that define how quickly the baseline can respond (you don't want to over-subtract signal). These parameters can be accessed by providing `find_peaks` with keywords arguments ([see documentation](https://laserkelvin.github.io/PySpecTools/pyspectools.spectra.html#pyspectools.spectra.assignment.AssignmentSession.find_peaks)). The `sigma` keyword then specifies the minimum SNR value to use for peak finding; note that if `als=False`, `threshold` and `sigma` are equivalent. The former specifies the absolute intensity scale to use for peak finding." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# Returns a pandas DataFrame containing frequency/intensity of\n", "# every peak detected. This is also stored as an attribute;\n", "# `AssignmentSession.peaks`\n", "peaks = session.find_peaks(sigma=6, als=True)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
FrequencyPeak FrequenciesIntensity
count447.000000447.000000447.000000
mean12300.34757312300.34243128.373735
std3365.9058143365.90138841.156217
min6385.0750066385.0666676.002450
25%9542.6205459542.6666678.248862
50%12215.90253912215.91111114.821400
75%14753.08738714753.15555532.619844
max19845.17589119845.155556499.347482
\n", "
" ], "text/plain": [ " Frequency Peak Frequencies Intensity\n", "count 447.000000 447.000000 447.000000\n", "mean 12300.347573 12300.342431 28.373735\n", "std 3365.905814 3365.901388 41.156217\n", "min 6385.075006 6385.066667 6.002450\n", "25% 9542.620545 9542.666667 8.248862\n", "50% 12215.902539 12215.911111 14.821400\n", "75% 14753.087387 14753.155555 32.619844\n", "max 19845.175891 19845.155556 499.347482" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Use the `describe` method of a `DataFrame` to summarize the\n", "# peaks information\n", "peaks.describe()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In the cell below, we actually manually add some lines. Automated peak detection can never be perfect, especially with blended features. You can add frequency/intensity information by providing a list of 2-tuples as an argument to the `add_ulines` method:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "session.add_ulines(\n", " [\n", " (7483.911, 9.390),\n", " (8773.866, 12.523),\n", " (9200.000, 9.116),\n", " (9200.888, 9.442),\n", " (10258.311, 6.850),\n", " (10259.111, 6.948),\n", " (10262.044, 15.061),\n", " (10843.111, 9.215),\n", " (10928.266, 12.748),\n", " (10959.38, 14.302),\n", " (10978.93, 8.527),\n", " (10979.73, 7.273),\n", " (11454.844, 7.216),\n", " (11547.555, 7.485),\n", " (11548.000, 8.370),\n", " (11550.49, 7.134),\n", " (11561.51, 7.720),\n", " (11940.00, 6.039),\n", " (12476.444, 14.628),\n", " (12475.911, 13.628),\n", " (13558.40, 7.472),\n", " (13609.07, 6.087),\n", " (13751.378, 6.745),\n", " (13792.80, 9.937),\n", " (14839.64, 6.485),\n", " (14919.555, 17.971),\n", " (15248.177, 13.216),\n", " (15249.067, 15.414),\n", " (15557.60, 6.572),\n", " (16581.07, 7.550),\n", " (16706.76, 70.758),\n", " (16707.47, 49.851),\n", " (16710.67, 70.43661),\n", " (16711.47, 48.40109),\n", " (17115.02, 9.315)\n", " ]\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Running assignments\n", "\n", "With all the peaks found, we can start doing some assignments of the features! The main way this is done is by creating `LineList` objects, which are then fed to the `session.process_linelist` method as we shall see later.\n", "\n", "There are different types of `LineList` objects, depending on the source of data:\n", "\n", "1. `from_artifacts`\n", "2. `from_clock`\n", "2. `from_catalog`\n", "3. `from_pgopher`\n", "4. `from_dataframe`\n", "5. `from_lin`\n", "6. `from_splatalogue_query`\n", "7. `from_list`\n", "\n", "`from_artifacts` will create a specialized `LineList` that flags `Transitions` as non-molecular for book-keeping. `from_clock` is a special variant of this, where we have found that radio interference arising from arbitrary waveform generators often bleed into the resulting chirped-pulse spectrum, and exhaustively generates combinations/harmonics of the clock frequency as artifacts." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "artifacts = LineList.from_artifacts(\n", " [8000., 16000., 8125.,16250., 7065.7778, 7147.3778, 8574.9022]\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "With the `artifacts` variable/object, you can then pass it to the `process_linelist` method of our `AssignmentSession`, and it will automatically cross-correlate every unassigned (U-line) with entries contained in your `LineList`:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "1f60dd2939884e7398c9ed7b74889f04", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=7), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n" ] } ], "source": [ "session.process_linelist(linelist=artifacts)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For molecular assignments, you could of course repeat this process and manually create individual `LineList`s; in this example, we'll take an SPCAT catalog and generate the `LineList`:\n", "\n", "```python\n", "formaldehyde = LineList.from_catalog(name=\"formaldehyde\", formula=\"H2CO\", \"catalogs/h2co.cat\")\n", "```\n", "\n", "However, this is incredibly time consuming, and not pretty to look at (not to mention a nightmare to update). Instead, we recommend you set up a directory containing all of your catalogs, and create an input file that stores all of the metadata for the catalogs and \"batch\" process all of the catalogs. In the cell below, we automated the analysis of hydrocarbon molecules (separated oxygen- and nitrogen-bearing species) with a YAML file called `hydrocarbons_cat.yml`. YAML is a simple markup syntax that is both machine and human read/writeable. Below is a small excerpt of our file:\n", "\n", "```yaml\n", "ethynylbenzene,v23:\n", " formula: c8h6\n", " filepath: h_catalogs/phenylacetylene_v23.cat\n", "\n", "ethynylbenzene,2v23:\n", " formula: c8h6\n", " filepath: h_catalogs/phenylacetylene_2v23.cat\n", "\n", "ethynylbenzene,v16:\n", " formula: c8h6\n", " filepath: h_catalogs/phenylacetylene_v16.cat\n", "\n", "buta-1,3-diynylbenzene:\n", " formula: c10h6\n", " filepath: h_catalogs/phenyldiacetylene.cat\n", "\n", "hexa-1,3,5-triynylbenzene:\n", " formula: c12h6\n", " filepath: h_catalogs/phenyltriacetylene.cat\n", "```\n", "\n", "You can actually provide the `source` keyword as well, and include a BibTeX citekey. When it comes to automatic report generation, the citation will be automatically used to streamline LaTeX table generation.\n", "\n", "```\n", "molecule_name:\n", " formula: C12H6 # formula\n", " source: mccarthy_benzene_2020 # citekey\n", " filepath: catalog/molecule.cat # filepath to the SPCAT catalog\n", "```\n" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Line list for: cyclopropa-1,2-diene,gs Formula: c3h2, Number of entries: 80\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "05d29edb49c9469f8848c35e1917ec94", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=1), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: ethynylbenzene Formula: c8h6, Number of entries: 144\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "5ab9b524b4a346cf9d35e94243724585", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=45), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: umol-1850 Formula: cxhy, Number of entries: 150\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "bff89c71b74a4ce680a0fe21ef973b6e", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=115), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: ethynylbenzene,v23 Formula: c8h6, Number of entries: 374\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "6136dadfc7104d56a8ae970dac93fb08", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=81), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: ethynylbenzene,2v23 Formula: c8h6, Number of entries: 374\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "4a5ee7196e9a476bb123f2f04bb9dd28", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=75), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: ethynylbenzene,v16 Formula: c8h6, Number of entries: 374\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "de817f49db3b44b883922cd8d4c150f5", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=52), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: buta-1,3-diynylbenzene Formula: c10h6, Number of entries: 745\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "74af4902c2164e1b92d98950c89a81f3", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=201), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: hexa-1,3,5-triynylbenzene Formula: c12h6, Number of entries: 229\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "3f548535b9e34b0494e7dde87ae8a629", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=153), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: 5-ethylenecyclopenta-1,3-diene Formula: c6h6, Number of entries: 82\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d1264190efe74378aea42b94ad7b26f0", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=19), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: 1-ethynylcyclopenta-1,3-diene Formula: c7h6, Number of entries: 355\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "9e0c0f4312554573a55e495a7b1cc4c8", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=93), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: 2-ethynylcyclopenta-1,3-diene Formula: c7h6, Number of entries: 462\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "85ec196e67eb4d2f80d98af22a2a4e72", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=95), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclohexa-1,3-dien-5-yne Formula: c6h4, Number of entries: 187\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "ac0e0c201cee4ca19b09d2c406e4d028", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=43), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclohexa-1,3-dien-5-yne,2v16 Formula: c6h4, Number of entries: 77\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "8867ddabb41e4c22b48c00b643346910", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=25), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclohexa-1,3-dien-5-yne,v16 Formula: c6h4, Number of entries: 77\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "00b07a38d1dc4b489d2ffc5cc375fbe0", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=24), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclohexa-1,3-dien-5-yne,v15 Formula: c6h4, Number of entries: 77\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "b6048698b44f4810b60f825a1c00e26b", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=24), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: prop-1-yne Formula: c3h4, Number of entries: 4\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "ade02283b8b442ecba72c6eed9d1eb7f", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=1), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: prop-1-yne,1v9 Formula: c3h4, Number of entries: 4\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "aa0e02f77799472cbedcda60ef579f2a", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=1), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: prop-1-yne,1v10 Formula: c3h4, Number of entries: 4\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "6bea025f37d24eeeb5f5e74dfec092c5", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=1), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: prop-1-yne,2v10 Formula: c3h4, Number of entries: 4\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "0df578d198dd44808f2b3921e7de9f92", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=1), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: penta-1,3-diyne Formula: c5h4, Number of entries: 28\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "1a6c560cef1d466ea44dad779986f74c", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=9), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: penta-1,3-diyne,1v11 Formula: c5h4, Number of entries: 16\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "e5658d40421644cc9e68e80b6a5dd564", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=6), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: penta-1,3-diyne,1v12 Formula: c5h4, Number of entries: 16\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "75c88cd118b24d94983d155f55a5a065", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=6), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: penta-1,3-diyne,1v13 Formula: c5h4, Number of entries: 16\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "0d992f0679de42ed9288e51b60ac0ebd", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=6), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: penta-1,3-diyne,ve1 Formula: c5h4, Number of entries: 28\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "2e81ae9c9cdf46b0a81349b60c9b90db", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=9), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: hepta-1,3,5-triyne Formula: c7h4, Number of entries: 79\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "76630034d2f3423988b638dc6a4ba5db", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=24), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: (2Z)-hexa-1,3-dien-5-yne (anti) Formula: c6h6, Number of entries: 308\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "c4f3719244f6499985b69bd5717c75d3", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=72), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: (2E)-hexa-1,3-dien-5-yne (anti) Formula: c6h6, Number of entries: 155\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "8571b324b9c34ee7a211a81aa0593d3c", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=41), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: but-1-en-3-yne Formula: c4h4, Number of entries: 23\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "f5d10c7ad6a84fd988055fb6ebb8431b", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=6), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: hex-1-ene-3,5-diyne Formula: c6h4, Number of entries: 97\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "f0c0f5eeb08c4a1b82dce66da2d9efee", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=25), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: vinyl_triacetylene Formula: c8h4, Number of entries: 93\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "bff4b989bc7a4edc92478d71eefc0e8e", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=56), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: 5-ethenylidenecyclopenta-1,3-diene Formula: c7h6, Number of entries: 226\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "ecc0b7430883413586cf55146220a10e", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=37), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: 5-ethenylidenecyclopenta-1,3-diene,v22 Formula: c7h6, Number of entries: 202\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d053e5a9e25d432c87c3cc226defef4a", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=37), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopenta-1,3-diene Formula: c5h6, Number of entries: 88\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "5f73f334e6724e2c99dc75bfbc06cb3f", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=16), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: (Z)-3-penten-1-yne, A state Formula: c5h6, Number of entries: 172\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "1db7edbef46544e2b4bab28922db3e32", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=39), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: penta-1,2-dien-4-yne Formula: c5h4, Number of entries: 71\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "9fe530f545e54cdfa38015f07bc62267", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=12), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: hepta-1,2,3,4,5-pentaene-6-yne Formula: c7h4, Number of entries: 209\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "c303fa28682f4036891bca8060187106", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=60), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cis-hex-ene-diyene Formula: c6h4, Number of entries: 273\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a9f8930fa04c49ce9a52ae0f12075d22", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=63), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: hexa-1,2,3-trien-5-yne Formula: c6h4, Number of entries: 232\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "f7fbd46fb7474b438c8cec56c098c9de", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=34), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: hepta-1,2-dien-4,6-diyne Formula: c7h4, Number of entries: 271\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d9d174667f87402dae6b367438b7d81a", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=96), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa_1_yne_3_yl_radical Formula: c3h, Number of entries: 1119\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "4381583617fa46f5938cf8dc1f069a3b", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=55), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1-yne-3-yl_radical,ve1 Formula: c3h, Number of entries: 621\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d40f31bff2f84a969084e97785db41a9", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=27), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1-yne-3-yl_radical,ve2 Formula: c3h, Number of entries: 299\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "29520fdc395c405e98fa402410af4059", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=27), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1-yne-3-yl_radical,ve3 Formula: c3h, Number of entries: 301\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "002f5311f6ab4352ab746eea2800d335", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=27), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: buta-1,3-diynyl radical Formula: c4h, Number of entries: 102\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "00039e24c7844b9ebd9c4f2d1eecdf6f", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=9), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: 1,2,3,4-pentatetraene-1,1,5-trienyl radical Formula: c5h, Number of entries: 93\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "31f9b54b8f9f44d2ad967390a8d6c6cd", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=20), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: hexa-1,3,5-triynyl radical Formula: c6h, Number of entries: 176\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "619ac5da3a674697acc606c1262d4421", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=30), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: 1,2,3,4,5,6-heptahexaene-1,1,7-trienyl radical Formula: c7h, Number of entries: 154\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a0cc6a06cf5c44d0bb20610b23b8234e", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=42), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: propadienylidene Formula: c3h2, Number of entries: 10\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "37cc8b27e3374adca62950e28476de67", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=1, bar_style='info', max=1), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: butatrienylidene Formula: c4h2, Number of entries: 14\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "36418c5296854227b2b8d681e5d2c84d", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=4), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: pentatetraenylidene Formula: c5h2, Number of entries: 28\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "dff6ea70cea641d2a67c2f57928d22d6", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=9), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: 1-ethynyl-cycloprop-1-en-2-ylidene Formula: c5h2, Number of entries: 70\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "95fdc7e7cce04c349cfc81fd16f369ca", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=16), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: penta-1,2-dien-4-yne-1-ylidene Formula: c5h2, Number of entries: 92\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "4ca79c8597c24d6ca1cceb6f4255667b", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=16), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cylcohexadiene Formula: c6h8, Number of entries: 69\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "e687882568654240b5d9aa60ee33f924", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=28), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: (4Z)-hepta-1,2,4-trien-6-yne (anti) Formula: c7h6, Number of entries: 492\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "327d4c5cb024404bb77e9edb2b316029", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=113), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: (E)-3-penten-1-yne, A state Formula: c5h6, Number of entries: 87\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a2345828f63247a1a1e113682901dbdf", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=15), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n" ] } ], "source": [ "session.process_linelist_batch(yml_path=\"hydrocarbons_cat.yml\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We repreat the same procedure for a `.lin` file, which also follows SPFIT formatting. The `from_XXX` parser is chosen based on the extension of the referenced file." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Line list for: cyclopropa-1,2-diene,gs Formula: c3h2, Number of entries: 406\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "744a364ad20e487787858692a15d2b4b", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=2), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: umol-1850 Formula: cxhy, Number of entries: 24\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "34f1fdbfe33141c1b8d6633a53f11b4a", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=24), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1,2-diene (HC13CCH) Formula: c3h2, Number of entries: 6\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d88c8aeb78b149d0963640e5d1b9d3e0", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=6), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1,2-diene (H13CCCH) Formula: c3h2, Number of entries: 12\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "08a3189c3c1d40bfa1f552396b975b19", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=8), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1,2-diene,1v2 Formula: c3h2, Number of entries: 37\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "36244789387541d3981ddc3fce5a61ab", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=1), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1,2-diene,1v3 Formula: c3h2, Number of entries: 35\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "4918727d0366460685aff92efa7a2047", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=1), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1,2-diene,1v5 Formula: c3h2, Number of entries: 28\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "e240c3a611da4ad09b5e5bd3a23d4b92", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=1, bar_style='info', max=1), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1,2-diene,1v6 Formula: c3h2, Number of entries: 38\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "7ade7747cf284ad2ac4c97da1c129bb5", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=1), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1,2-diene,2v6 Formula: c3h2, Number of entries: 17\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "7f89c743605c4088b9d442518837cf65", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=2), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1,2-diene,3v6 Formula: c3h2, Number of entries: 5\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d17f0ab365e945eb973ece518c615661", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=2), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1,2-diene,4v6 Formula: c3h2, Number of entries: 2\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "33a5ca6a56e74443a61a198d3fc28985", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=1), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1,2-diene,1v5+1v6 Formula: c3h2, Number of entries: 2\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "5bc504df6d874feaab593962b735c85c", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=1), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1-yne-3-yl_radical,ve1 Formula: c3h, Number of entries: 22\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a66d316a00d3456c8cf8581fa588525d", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=11), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1-yne-3-yl_radical,ve2 Formula: c3h, Number of entries: 5\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "9013cb889ac443e8919b0748c5414ef5", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=2), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopropa-1-yne-3-yl_radical,ve3 Formula: c3h, Number of entries: 11\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "b0e20cd44dc24f368bb18605cd131687", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=11), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: penta-1,3-diyne,ve2 Formula: c5h4, Number of entries: 9\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "1401074b99024f98b4ca838954b485a1", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=5), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: penta-1,3-diyne,ve3 Formula: c5h4, Number of entries: 9\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "6ad5bcc802cb453eb0eb100154f3c2ab", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=5), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: ethynylbenzene Formula: c8h6, Number of entries: 58\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d30224c6833b4e1fbbbbec5f77032bf9", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=54), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: ethynylbenzene,v23 Formula: c8h6, Number of entries: 35\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "5a905e37cb42496f85872a2ab27e5739", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=28), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: ethynylbenzene,2v23 Formula: c8h6, Number of entries: 11\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "4dd9aedaab894963a7deae117766bb66", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=11), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: ethynylbenzene,v16 Formula: c8h6, Number of entries: 16\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "50e1cacecf4544698e878a734abacbcc", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=13), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: buta_1,3_diynylbenzene Formula: c10h6, Number of entries: 86\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "3567cc3889dc4c539e0aecf1f1e10596", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=78), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: hexa_1,3,5_triynylbenzene Formula: c12h6, Number of entries: 25\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "bfd6a70a93d443d299b35340b4a3627f", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=23), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: 5-ethylenecyclopenta-1,3-diene Formula: c6h6, Number of entries: 28\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "baaaff8778bd466d885cf2dc00bd208c", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=6), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: 1-ethynylcyclopenta-1,3-diene Formula: c7h6, Number of entries: 30\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "7ec126b9b56a42dabe1c733368548584", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=24), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: 2-ethynylcyclopenta-1,3-diene Formula: c7h6, Number of entries: 39\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "263ae0deafd546b2a195074eba68dfc8", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=34), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: hepta-1,3,5-triyne Formula: c7h4, Number of entries: 16\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "2307b719edce473babcac7923c226db2", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=1, bar_style='info', max=1), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: (2Z)-hexa-1,3-dien-5-yne (anti) Formula: c6h6, Number of entries: 29\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "feab45ce63a8410eab6627d6f6e2a1a3", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=26), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: (2E)-hexa-1,3-dien-5-yne (anti) Formula: c6h6, Number of entries: 32\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "bec32f3102744ce79713d25e8ca1e1c5", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=22), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: hex-1-ene-3,5-diyne Formula: c6h4, Number of entries: 22\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "e0be38f2351e424eb6b75f39b394e64b", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=14), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: 5-ethenylidenecyclopenta-1,3-diene Formula: c7h6, Number of entries: 26\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "b79d2a0f323542b09cb22488c95080f0", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=23), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: 5-ethenylidenecyclopenta-1,3-diene,v22 Formula: c7h6, Number of entries: 18\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "36be1dbe1eba42fd95569ea7c7d53176", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=10), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: cyclopenta-1,3-diene Formula: c5h6, Number of entries: 19\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "f96086b4597f441eadf9106482c95f9f", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=5), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: penta-1,2-dien-4-yne Formula: c5h4, Number of entries: 14\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "5a6732ac650e45fcb25db3276ef9c28c", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=8), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: hepta-1,2,3,4,5-pentaene-6-yne Formula: c7h4, Number of entries: 16\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "0e64d7e958cd451fbe4646a7d10bd96f", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=16), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: hexa-1,2,3-trien-5-yne Formula: c6h4, Number of entries: 23\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "86517069e7944b58ae949dd339bc0711", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=13), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: hepta-1,2-dien-4,6-diyne Formula: c7h4, Number of entries: 45\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "01728f1906a146f9a22e6fd7a63f5f58", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=35), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: 1-ethynyl-cycloprop-1-en-2-ylidene Formula: c5h2, Number of entries: 13\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "031b902d3b7b4d7aa3e7b672c708d9ab", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=10), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: penta-1,2-dien-4-yne-1-ylidene Formula: c5h2, Number of entries: 13\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "e19b613ef9a34c8cbfb97bfbd9056a81", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=8), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: (4Z)-hepta-1,2,4-trien-6-yne (anti) Formula: c7h6, Number of entries: 34\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "ebf907db755a47bf9e2f10d598b38054", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=24), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: l_ccch,ve Formula: c3h, Number of entries: 32\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "4bb692b171aa4eec8903cee46b6d9f9d", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=1, bar_style='info', max=1), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: prop-1-yne,ve1 Formula: c3h4, Number of entries: 9\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "6722eef76bb04cc3aecda6c03db82262", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=3), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: prop-1-yne,ve2 Formula: c3h4, Number of entries: 9\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "9c5ef194d6934d03b44a109316c2f159", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=3), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: (E)-3-penten-1-yne, A state Formula: c5h6, Number of entries: 20\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "4f50c76f0a964cf2811aff83f04aa8d6", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=8), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: (E)-3-penten-1-yne, E state Formula: c5h6, Number of entries: 18\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "6b746f0e95234e7f956c8ca16e2415f2", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=9), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: (Z)-3-penten-1-yne, A state Formula: c5h6, Number of entries: 13\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "5be57a70c5c24b17a4f14497015ecc06", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=6), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Line list for: (Z)-3-penten-1-yne, E state Formula: c5h6, Number of entries: 9\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "41f8746e96674667b75e93ead7f614a9", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=6), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n" ] } ], "source": [ "session.process_linelist_batch(yml_path=\"hydrocarbons_lin.yml\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Finishing the analysis\n", "\n", "This basically completes the assignment process! We just have a few more steps to take to save the analysis; a `Pickle` file is saved to disk, which is then used for all the subsequent analysis (e.g. line profile, statistics). The `session.finalize_assignments()` is currently not as final as it sounds: it just prompts all the report and table generation to happen, as well as export all of the identified and unidentified data into respective folders." ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "session.finalize_assignments()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The `save_session` function below then dumps the entire analysis into the folder `sessions/{experiment_ID}.pkl`, where `{experiment_ID}` is the number assigned to the experiment all the way at the beginning (`experiment=4000`)." ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [], "source": [ "session.save_session()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can then load this session back in in a separate notebook with `AssignmentSession.load_session(\"sessions/{experiment_ID}.pkl\")`" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "session = AssignmentSession.load_session(\"sessions/4000.pkl\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This loads in all of the information from before, including the results generated with `finalize_assignments()`. For example, the `identifications` attribute stores a `dict` which tracks each distinct species as keys, with the number of assigned lines as values:" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'buta-1,3-diynylbenzene': 51,\n", " 'umol-1999': 1,\n", " '2-ethynylcyclopenta-1,3-diene': 17,\n", " '5-ethenylidenecyclopenta-1,3-diene': 16,\n", " '1-ethynyl-cycloprop-1-en-2-ylidene': 6,\n", " '1-ethynylcyclopenta-1,3-diene': 18,\n", " '5-ethenylidenecyclopenta-1,3-diene,v22': 8,\n", " '(2Z)-hexa-1,3-dien-5-yne (anti)': 10,\n", " 'umol-1850': 5,\n", " '1,2,3,4-pentatetraene-1,1,5-trienyl radical': 9,\n", " 'hepta-1,2,3,4,5-pentaene-6-yne': 10,\n", " 'hepta-1,2-dien-4,6-diyne': 13,\n", " 'hexa-1,3,5-triynylbenzene': 3,\n", " 'ethynylbenzene': 19,\n", " 'ethynylbenzene,v23': 18,\n", " 'benzonitrile, v21': 7,\n", " 'hepta-1,3,5-triyne': 5,\n", " '1,2,3,4,5,6-heptahexaene-1,1,7-trienyl radical': 5,\n", " '2-phenylacetonitrile': 2,\n", " 'vinyl_triacetylene': 1,\n", " 'hex-1-ene-3,5-diyne': 10,\n", " 'cyclohexa-1,3-dien-5-yne': 4,\n", " 'cyclohexa-2,4-dien-1-one': 9,\n", " 'Artifact': 2,\n", " 'ethynylbenzene,v16': 6,\n", " 'ethynylbenzene,2v23': 5,\n", " 'penta-1,3-diyne': 3,\n", " 'penta-1,3-diyne,1v12': 6,\n", " 'penta-1,3-diyne,ve2': 3,\n", " '(2E)-hexa-1,3-dien-5-yne (anti)': 13,\n", " '(4Z)-hepta-1,2,4-trien-6-yne (anti)': 9,\n", " '(E)-pent-2-en-4-ynenitrile': 1,\n", " 'benzonitrile': 7,\n", " 'hexa-1,2,3-trien-5-yne': 3,\n", " 'butatrienylidene': 4,\n", " 'but-1-en-3-yne': 2,\n", " 'prop-2-ynenitrile': 2,\n", " 'hexa-4,5-dien-2-ynenitrile': 2,\n", " 'pentatetraenylidene': 6,\n", " 'prop-2-ynal': 2,\n", " 'prop-2-enenitrile': 2,\n", " 'buta-1,3-diynyl radical': 3,\n", " '3-phenylprop-2-ynenitrile': 1,\n", " '3-oxo-1,2-propadienylidene': 2,\n", " 'cyclohexa-2,5-dien-1-one': 11,\n", " 'penta-1,2-dien-4-yne': 6,\n", " 'cyclohexa-1,3-dien-5-yne,2v16': 2,\n", " 'cyanoprop-1,2-dien-1,3-diyl': 1,\n", " 'cyanoacetyl-cycloprop-1-ene-2,2-diyl': 1,\n", " 'penta-2,4-diynal': 3,\n", " 'penta-2,4-diynenitrile': 3,\n", " '5-ethylenecyclopenta-1,3-diene': 3,\n", " 'cyclopenta-2,4-dien-1-one': 2,\n", " 'penta-1,3-diyne,1v11': 2,\n", " 'penta-1,3-diyne,ve1': 1,\n", " 'penta-1,3-diyne,ve3': 1,\n", " 'penta-1,3-diyne,1v13': 1,\n", " '(Z)-3-penten-1-yne, A state': 1,\n", " '(Z)-3-penten-1-yne, E state': 1,\n", " 'cyclopenta-2,4-dien-1-one, ve1': 1,\n", " 'cis-hex-ene-diyene': 1,\n", " 'cylcohexadiene': 1,\n", " '(E)-3-penten-1-yne, A state': 1,\n", " 'buta-2,3-dien-1-imine (syn)': 1,\n", " 'cyclopenta-1,3-diene-1-carbonitrile': 1,\n", " 'cyclopenta-2,4-diene-1-carbonitrile': 1,\n", " 'benzonitrile, v12': 1,\n", " 'cyclopropa-1-yne-3-yl_radical,ve2': 2,\n", " 'cyclopropa_1_yne_3_yl_radical': 12,\n", " 'cyclopropa-1-yne-3-yl_radical,ve1': 4,\n", " 'cyclohexa-1,3-dien-5-yne,v15': 1,\n", " 'cyclohexa-1,3-dien-5-yne,v16': 1,\n", " 'cyclopropa-1-yne-3-yl_radical,ve3': 2,\n", " 'buta-2,3-dienenitrile': 1,\n", " 'cyclopropa-1,2-diene,4v6': 1,\n", " 'cyclopropa-1,2-diene,3v6': 1,\n", " 'but-3-enenitrile (cis)': 1,\n", " 'penta-1,2-dien-4-yne-1-ylidene': 2,\n", " 'cyclopropa-1,2-diene,2v6': 1,\n", " 'cyclopropa-1,2-diene (HC13CCH)': 1,\n", " 'prop-1-yne,ve1': 1,\n", " '(E)-but-2-enal (anti)': 1,\n", " 'prop-1-yne': 1,\n", " 'prop-1-yne,1v9': 1,\n", " 'cyclopropa-1,2-diene,1v5+1v6': 1,\n", " 'cyclopropa-1,2-diene,1v6': 1,\n", " 'penta-1,2-dien-1-one-3-yl radical': 1,\n", " 'cyclopropa-1,2-diene,1v3': 1,\n", " 'cyclopropa-1,2-diene,1v2': 1,\n", " 'cyclopropa-1,2-diene,gs': 1,\n", " 'cyclopropa-1,2-diene (H13CCCH)': 1,\n", " 'benzonitrile, v15': 1,\n", " '(2E)-2,4-pentadienal (syn)': 1,\n", " 'cyanopenta-2,4-diyne-2,2-diyl': 1,\n", " 'c3s': 1,\n", " 'hexa-1,3,5-triynyl radical': 4,\n", " 'prop-1-yne,ve2': 1}" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "session.identifications" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can also view all of the assignment information by accessing the `DataFrame` stored as the `table` attribute. Below, we also demonstrate how we can sort columns based on their values, for example looking at the transitions with the highest catalog uncertainty first." ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
namesmilesformulafrequencycatalog_frequencycatalog_intensitydeviationintensityuncertaintyS...lstate_energyinterferenceweightingsourcepublicvelocitydischargemagnetmultiplefinal
402-phenylacetonitrilec8h7n7946.9627287947.1695-5.34800.2067727.7657010.14090.0...6.2021False0.0CatalogTrue0.0FalseFalse[penta-2,4-diynal, 7,947.0717]False
385benzonitrile, v15c7h5n18425.93541218426.1108-5.66580.1753886.6282210.10650.0...3.9995False0.0CatalogTrue0.0FalseFalse[cyanoprop-1,2-dien-1,3-diyl, 18,426.1726, 3-p...False
353but-3-enenitrile (cis)c4h5n16331.42907516331.4637-5.34170.03462538.5243120.07720.0...10.8664False0.0CatalogTrue0.0FalseFalse[cyclohexa-2,4-dien-1-one, 16,331.4332, ethyny...False
126cyanoacetyl-cycloprop-1-ene-2,2-diylc6hn10379.89577610379.8652-3.6143-0.0305768.0865450.03440.0...1.7845False0.0CatalogTrue0.0FalseFalse[]True
179hexa-1,3,5-triynylbenzenec12h611803.74021611803.8139-3.82980.07368418.0365350.02790.0...5.7546False0.0CatalogTrue0.0FalseFalse[hexa-1,2,3-trien-5-yne, 11,803.7367, (Z)-but-...False
..................................................................
43cyclohexa-1,3-dien-5-ynec6h48073.1957898073.1768-2.7170-0.01898914.4874250.00000.0...0.8300False0.0CatalogTrue0.0FalseFalse[]True
39vinyl_triacetylenec8h47924.8485647924.8884-2.73700.0398367.0262080.00000.0...0.7930False0.0CatalogTrue0.0FalseFalse[]True
367prop-1-ynec3h417091.74475817091.7420-1.5739-0.002758140.7178500.00000.0...0.0000False0.0CatalogTrue0.0FalseFalse[]True
368prop-1-yne,1v9c3h417102.10311717102.0765-1.5722-0.02661731.4699870.00000.0...0.0000False0.0CatalogTrue0.0FalseFalse[benzonitrile, v15, 17,101.9416]True
314cyclopropa_1_yne_3_yl_radicalc3h14893.03475714893.0554-1.67900.020643123.7178080.00000.0...0.6391False0.0CatalogTrue0.0FalseFalse[]True
\n", "

428 rows × 28 columns

\n", "
" ], "text/plain": [ " name smiles formula frequency \\\n", "40 2-phenylacetonitrile c8h7n 7946.962728 \n", "385 benzonitrile, v15 c7h5n 18425.935412 \n", "353 but-3-enenitrile (cis) c4h5n 16331.429075 \n", "126 cyanoacetyl-cycloprop-1-ene-2,2-diyl c6hn 10379.895776 \n", "179 hexa-1,3,5-triynylbenzene c12h6 11803.740216 \n", ".. ... ... ... ... \n", "43 cyclohexa-1,3-dien-5-yne c6h4 8073.195789 \n", "39 vinyl_triacetylene c8h4 7924.848564 \n", "367 prop-1-yne c3h4 17091.744758 \n", "368 prop-1-yne,1v9 c3h4 17102.103117 \n", "314 cyclopropa_1_yne_3_yl_radical c3h 14893.034757 \n", "\n", " catalog_frequency catalog_intensity deviation intensity uncertainty \\\n", "40 7947.1695 -5.3480 0.206772 7.765701 0.1409 \n", "385 18426.1108 -5.6658 0.175388 6.628221 0.1065 \n", "353 16331.4637 -5.3417 0.034625 38.524312 0.0772 \n", "126 10379.8652 -3.6143 -0.030576 8.086545 0.0344 \n", "179 11803.8139 -3.8298 0.073684 18.036535 0.0279 \n", ".. ... ... ... ... ... \n", "43 8073.1768 -2.7170 -0.018989 14.487425 0.0000 \n", "39 7924.8884 -2.7370 0.039836 7.026208 0.0000 \n", "367 17091.7420 -1.5739 -0.002758 140.717850 0.0000 \n", "368 17102.0765 -1.5722 -0.026617 31.469987 0.0000 \n", "314 14893.0554 -1.6790 0.020643 123.717808 0.0000 \n", "\n", " S ... lstate_energy interference weighting source public \\\n", "40 0.0 ... 6.2021 False 0.0 Catalog True \n", "385 0.0 ... 3.9995 False 0.0 Catalog True \n", "353 0.0 ... 10.8664 False 0.0 Catalog True \n", "126 0.0 ... 1.7845 False 0.0 Catalog True \n", "179 0.0 ... 5.7546 False 0.0 Catalog True \n", ".. ... ... ... ... ... ... ... \n", "43 0.0 ... 0.8300 False 0.0 Catalog True \n", "39 0.0 ... 0.7930 False 0.0 Catalog True \n", "367 0.0 ... 0.0000 False 0.0 Catalog True \n", "368 0.0 ... 0.0000 False 0.0 Catalog True \n", "314 0.0 ... 0.6391 False 0.0 Catalog True \n", "\n", " velocity discharge magnet \\\n", "40 0.0 False False \n", "385 0.0 False False \n", "353 0.0 False False \n", "126 0.0 False False \n", "179 0.0 False False \n", ".. ... ... ... \n", "43 0.0 False False \n", "39 0.0 False False \n", "367 0.0 False False \n", "368 0.0 False False \n", "314 0.0 False False \n", "\n", " multiple final \n", "40 [penta-2,4-diynal, 7,947.0717] False \n", "385 [cyanoprop-1,2-dien-1,3-diyl, 18,426.1726, 3-p... False \n", "353 [cyclohexa-2,4-dien-1-one, 16,331.4332, ethyny... False \n", "126 [] True \n", "179 [hexa-1,2,3-trien-5-yne, 11,803.7367, (Z)-but-... False \n", ".. ... ... \n", "43 [] True \n", "39 [] True \n", "367 [] True \n", "368 [benzonitrile, v15, 17,101.9416] True \n", "314 [] True \n", "\n", "[428 rows x 28 columns]" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "session.table.sort_values([\"uncertainty\"], ascending=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "When it comes to making plots, we might also be interested in removing the features that have already been assigned from X/Y; the `clean_spectral_assignments()` function replaces regions of the spectrum that have been assigned with white noise, to make it look natural." ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [], "source": [ "session.clean_spectral_assignments()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can then plot the cleaned spectrum, where all of the assigned features are removed from the spectrum with `plot_assigned()`. This creates a `plotly` figure which is interactive!\n", "\n", "Note that the `plot_assigned()` function can be used at any point of notebook too; the latest spectrum with assignments overlaid will be shown." ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "61037225608946b7b67acf23b2c08cab", "version_major": 2, "version_minor": 0 }, "text/plain": [ "FigureWidget({\n", " 'data': [{'name': 'Experiment',\n", " 'opacity': 0.6,\n", " 'type': 'scatte…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "session.plot_assigned()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Conclusions\n", "\n", "This notebook completes the first analysis step, which is often the most tedious: assigning and keeping track of every spectral feature, and translating that into something that is publishable. We went through how a spectrum can be loaded and interfaced with the `AssignmentSession` class in `PySpecTools`, followed by peak finding. We then created `LineList` objects based on SPCAT catalogs, and fed them to the `AssignmentSession` to process, and showed that you could do this _en masse_. Finally, the results of the analysis are saved to disk, and generating an interactive report.\n", "\n", "In a future notebook, we'll take a look at what kind of things we can do with the saved `AssignmentSession`, for example chemical composition analysis, and making plots of the data for publication." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" } }, "nbformat": 4, "nbformat_minor": 4 }