{ "cells": [ { "cell_type": "markdown", "id": "f7db948d", "metadata": {}, "source": [ "# Polarized Calculations\n", "\n", "SK-DO contains the ability to model the Stokes vector inside the Earth's atmosphere. Currently we assume that V=0, i.e., there is no circular polarization. Therefore only the I, Q, U components of the Stoke's vector are calculated. Every stokes component is fully linearized." ] }, { "cell_type": "code", "execution_count": null, "id": "54ccd126", "metadata": {}, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": null, "id": "4becaf42", "metadata": {}, "outputs": [], "source": [ "import sasktran as sk\n", "import sasktran.disco.interface as do\n", "import numpy as np\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": null, "id": "2cb2aaef", "metadata": {}, "outputs": [], "source": [ "geometry = sk.NadirGeometry()\n", "geometry.from_zeniths_and_azimuth_difference(80, 30, 45)\n", "\n", "atmosphere = sk.Atmosphere()\n", "\n", "# add our species\n", "atmosphere['rayleigh'] = sk.Species(sk.Rayleigh(), sk.MSIS90())\n", "atmosphere['o3'] = sk.Species(sk.O3OSIRISRes(), sk.Labow())\n", "atmosphere['no2'] = sk.Species(sk.NO2OSIRISRes(), sk.Pratmo())\n", "atmosphere.atmospheric_state = sk.MSIS90()\n", "\n", "# add our surface properties\n", "# setting to a scalar automatically sets the surface to be Lambertian\n", "atmosphere.brdf = 0.3" ] }, { "cell_type": "code", "execution_count": null, "id": "50aa1661", "metadata": {}, "outputs": [], "source": [ "atmosphere = sk.Atmosphere()\n", "\n", "# add our species\n", "atmosphere['rayleigh'] = sk.Species(sk.Rayleigh(), sk.MSIS90())\n", "atmosphere['o3'] = sk.Species(sk.O3OSIRISRes(), sk.Labow())\n", "atmosphere['no2'] = sk.Species(sk.NO2OSIRISRes(), sk.Pratmo())\n", "atmosphere.atmospheric_state = sk.MSIS90()\n", "\n", "# add our surface properties\n", "atmosphere.brdf = sk.Kokhanovsky()" ] }, { "cell_type": "code", "execution_count": null, "id": "eba441f7", "metadata": {}, "outputs": [], "source": [ "wavelengths = np.linspace(340,700, 361)\n", "engine = do.EngineDO(geometry=geometry, atmosphere=atmosphere, wavelengths=wavelengths)\n", "\n", "engine.num_stokes = 3\n", "engine.num_streams = 4\n", "\n", "rad = engine.calculate_radiance()\n", "print(rad)" ] }, { "cell_type": "code", "execution_count": null, "id": "7837dd1c", "metadata": {}, "outputs": [], "source": [ "# Make plot\n", "plt.figure()\n", "plt.plot(rad['wavelength'], rad['radiance'].isel(stokes=0))\n", "plt.plot(rad['wavelength'], rad['radiance'].isel(stokes=1))\n", "plt.plot(rad['wavelength'], rad['radiance'].isel(stokes=2))\n", "\n", "\n", "plt.xlabel('Wavelength [nm]')\n", "plt.ylabel('Sun Normalized Radiance [/ster]')\n", "\n", "plt.legend(['I', 'Q', 'U'])\n", "plt.show()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.8.13" } }, "nbformat": 4, "nbformat_minor": 5 }