{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "# Polarized Radiative Transfer Calculation with HR\n", "\n", "In this example we perform a full polarized radiative transfer calculation using the HR model. " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import sasktran as sk\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "from sasktran.geometry import VerticalImage\n", "\n", "tanalts_km = np.arange(10, 50, 1)\n", "\n", "# First recreate our geometry and atmosphere classes\n", "geometry = VerticalImage()\n", "geometry.from_sza_saa(sza=60, saa=60, lat=0, lon=0, tanalts_km=tanalts_km, mjd=54372, locallook=0,\n", " satalt_km=600, refalt_km=20)\n", "\n", "atmosphere = sk.Atmosphere()\n", "\n", "atmosphere['ozone'] = sk.Species(sk.O3OSIRISRes(), sk.Labow())\n", "atmosphere['air'] = sk.Species(sk.Rayleigh(), sk.MSIS90())\n", "\n", "# And now make the engine\n", "engine = sk.EngineHR(geometry=geometry, atmosphere=atmosphere)\n", "\n", "# Choose some wavelengths to do the calculation at\n", "engine.wavelengths = [340, 600]\n", "engine.polarization = 'vector'\n", "\n", "# And do the calculation\n", "radiance = engine.calculate_radiance(full_stokes_vector=True, output_format='xarray')\n", "\n", "plt.plot(np.sqrt((radiance.Q.T**2 + radiance.U.T**2 + radiance.V.T**2)) / radiance.I.T * 100, tanalts_km)\n", "plt.xlabel('Degree of Polarization [%]')\n", "plt.ylabel('Altitude [km]')\n", "\n", "plt.legend(['340 nm', '600 nm'])\n", "\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "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.7" } }, "nbformat": 4, "nbformat_minor": 1 }