{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Compare with experiment\n", "\n", "For any help, refer to [RADIS documentation](https://radis.readthedocs.io) \n", "\n", "In particular, see: [calc_spectrum](https://radis.readthedocs.io/en/latest/source/radis.lbl.calc.html#radis.lbl.calc.calc_spectrum), [Spectrum](https://radis.readthedocs.io/en/latest/source/radis.spectrum.spectrum.html#radis.spectrum.spectrum.Spectrum), [plot_diff](https://radis.readthedocs.io/en/latest/source/radis.spectrum.compare.html#radis.spectrum.compare.plot_diff) \n", "\n", "---" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# We use widget \n", "%matplotlib widget\n", "from radis import calc_spectrum, Spectrum, plot_diff\n", "from astropy import units as u\n", "\n", "# A first example. \n", "s = calc_spectrum(1900 / u.cm, 2300 / u.cm,\n", " molecule='CO',\n", " isotope='1,2,3',\n", " pressure=1.01325 * u.bar,\n", " Tgas=700 * u.K,\n", " mole_fraction=0.1,\n", " path_length=1 * u.cm,\n", " verbose=False\n", " )\n", "s.apply_slit(1, 'nm')\n", "s.plot('transmittance')\n", "# Update, or add your code below\n", "# ... " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Import an experimental spectrum : \n", "s_exp = Spectrum.from_txt('my_experiment.txt', 'transmittance', unit='', waveunit='nm') # or import with numpy and use Spectrum.from_array()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plot_diff(s_exp, s)" ] } ], "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.6.11" } }, "nbformat": 4, "nbformat_minor": 4 }