{ "cells": [ { "cell_type": "markdown", "id": "e451ae3f", "metadata": {}, "source": [ "# Multiple Species Weighting Function Calculations\n", "\n", "One of the most useful features of SK-DO is that it can compute weighting functions with respect to any number of input atmospheric species as well as surface reflectance." ] }, { "cell_type": "code", "execution_count": null, "id": "8b61b190", "metadata": {}, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": null, "id": "e58580cd", "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": "markdown", "id": "c68e4f4b", "metadata": {}, "source": [ "Start by setting up the geometry, use a SZA of 60 degrees with a pure nadir viewing geometry. Set up the atmosphere to contain rayleigh scattering, ozone and NO2 absorption, and a Lambertian surface" ] }, { "cell_type": "code", "execution_count": null, "id": "3a6db2b0", "metadata": {}, "outputs": [], "source": [ "geometry = sk.NadirGeometry()\n", "geometry.from_zeniths_and_azimuth_difference(60, 0, 0)\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": "markdown", "id": "e7f9fad3", "metadata": {}, "source": [ "Next we set the weighting function calculation to calculate with respect to all three species in the atmosphere as well as the surface" ] }, { "cell_type": "code", "execution_count": null, "id": "d2df49f1", "metadata": {}, "outputs": [], "source": [ "atmosphere.wf_species = ['rayleigh', 'o3', 'no2', 'brdf']" ] }, { "cell_type": "markdown", "id": "2d72093c", "metadata": {}, "source": [ "Run the calculation and print the results" ] }, { "cell_type": "code", "execution_count": null, "id": "09fe4932", "metadata": {}, "outputs": [], "source": [ "wavelengths = np.linspace(340,700, 361)\n", "engine = do.EngineDO(geometry=geometry, atmosphere=atmosphere, wavelengths=wavelengths)\n", "rad = engine.calculate_radiance()\n", "print(rad)" ] }, { "cell_type": "markdown", "id": "7963dd78", "metadata": {}, "source": [ "In the resulting dataset we have weighting functions for the three species as a function of altitude, and the weighting function for the surface that is not a function of altitude." ] } ], "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 }