{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Creating a Convolved Optical Property\n", "\n", "In this example we make a new optical property at 1 nm resolution based upon the ozone DBM cross sections which are natively at ~0.01 nm resolution." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import sasktran as sk\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "# High resolution wavelength grid\n", "wavel_nm = np.arange(300, 330, 0.01)\n", "\n", "# Used for temperature/pressure\n", "background_atmosphere = sk.MSIS90()\n", "\n", "# High resolution ozone cross sections\n", "hires = sk.O3DBM()\n", "\n", "# Low resolution cross sections at 1 nm resolution\n", "convolved = sk.OpticalPropertyConvolved(hires, psf_wavelength=wavel_nm, psf=1)\n", "\n", "# Pull out the absorption cross section at 20 km for both optical properties\n", "hires_xsec = hires.calculate_cross_sections(background_atmosphere, latitude=0,\n", " longitude=0, altitude=20000, wavelengths=wavel_nm, mjd=54732)\n", "\n", "lowres_xsec = convolved.calculate_cross_sections(background_atmosphere, latitude=0,\n", " longitude=0, altitude=20000, wavelengths=wavel_nm, mjd=54732)\n", "\n", "plt.plot(wavel_nm, hires_xsec.absorption)\n", "plt.plot(wavel_nm, lowres_xsec.absorption)\n", "plt.yscale('log')\n", "plt.xlabel('Wavelength [nm]')\n", "plt.ylabel('Cross Section [cm$^2$]')\n", "\n", "plt.legend(['Original', 'Convolved'])\n", "plt.show()" ] } ], "metadata": { "kernelspec": { "display_name": "Python [default]", "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.2" } }, "nbformat": 4, "nbformat_minor": 2 }