{ "cells": [ { "cell_type": "markdown", "id": "26eb3f5f", "metadata": {}, "source": [ "# Spherical Corrections\n", "\n", "SK-DO contains the ability to use spherical corrections for the line of sight. By default spherical corrections for the solar beam are always enabled. Here we repeat the basic radiative transfer calculation example using spherical viewing mode." ] }, { "cell_type": "code", "execution_count": null, "id": "e3e0b195", "metadata": {}, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": null, "id": "ce39d7c4", "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": "b09c6eab", "metadata": {}, "outputs": [], "source": [ "geometry = sk.NadirGeometry()\n", "\n", "# make the look vector from TEMPO to the ARG office\n", "tempo = sk.Geodetic()\n", "tempo.from_lat_lon_alt(0, -100, 35786000)\n", "geometry.from_lat_lon(\n", " lats=52.131638, \n", " lons=-106.633873,\n", " elevations=0,\n", " mjd=57906.843, \n", " observer=tempo\n", ")" ] }, { "cell_type": "code", "execution_count": null, "id": "63339e97", "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 = 0.3" ] }, { "cell_type": "code", "execution_count": null, "id": "54b09992", "metadata": {}, "outputs": [], "source": [ "wavelengths = np.linspace(340,700, 361)\n", "\n", "# Create a plane parallel model (default) and plot the results\n", "engine = do.EngineDO(geometry=geometry, atmosphere=atmosphere, wavelengths=wavelengths)\n", "engine.viewing_mode = 'plane_parallel'\n", "\n", "rad = engine.calculate_radiance()\n", "\n", "# Make plot\n", "plt.figure()\n", "plt.plot(rad['wavelength'], rad['radiance'])\n", "plt.xlabel('Wavelength [nm]')\n", "plt.ylabel('Sun Normalized Radiance [/ster]')\n", "\n", "\n", "# Create a spherical and plot the results\n", "engine = do.EngineDO(geometry=geometry, atmosphere=atmosphere, wavelengths=wavelengths)\n", "engine.viewing_mode = 'spherical'\n", "\n", "rad = engine.calculate_radiance()\n", "\n", "# Make plot\n", "plt.plot(rad['wavelength'], rad['radiance'])\n", "plt.xlabel('Wavelength [nm]')\n", "plt.ylabel('Sun Normalized Radiance [/ster]')\n", "\n", "plt.legend(['Plane Parallel', 'Spherical'])\n", "\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 }