{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Specifying Aerosol" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import sasktran as sk" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "SASKTRAN supports Mie scattering aerosol particles. The core of this functionality is contained within the :py:class:`MieAerosol ` optical property. The :py:class:`MieAerosol ` class assumes a log-normal particle size distribution of stratospheric aerosols for a given species such as \"ice\", \"H2SO4\", or \"water\". To create the :py:class:`MieAerosol ` optical property we first have to specify the parameters of the log-normal particle size distribution as a function of altitude" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "particle_size_dist = sk.ClimatologyUserDefined(altitudes=[0, 100000],\n", " values={'SKCLIMATOLOGY_LOGNORMAL_MODEWIDTH': [1.6, 1.6],\n", " 'SKCLIMATOLOGY_LOGNORMAL_MODERADIUS_MICRONS': [0.08, 0.08]})" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "Here we have created a particle size distribution which is constant as a function of altitude, with a mode width of 1.6 and a mode radius of 0.08 microns. We can now create the optical property," ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "aerosol_optprop = sk.MieAerosol(particlesize_climatology=particle_size_dist, species='H2SO4')" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "And calculate the cross section as a function of wavelength. In our case the aerosol cross section should be the same independent of location/time, so we can include any parameters we want." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "wavel = np.linspace(300, 1000, 100)\n", "\n", "aerosol_xs = aerosol_optprop.calculate_cross_sections(sk.MSIS90(),\n", " latitude=0,\n", " longitude=0,\n", " mjd=54372,\n", " altitude=10000,\n", " wavelengths=wavel)\n", "\n", "plt.plot(aerosol_xs.wavelengths, aerosol_xs.total)\n", "plt.ylabel('Cross Section [/cm$^2$]')\n", "plt.xlabel('Wavelength [nm]');" ] }, { "cell_type": "markdown", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "To include aerosol in a radiative transfer calculation we also need to create a climatology. To create a user defined aerosol climatology we can do" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "aerosol_clim = sk.ClimatologyUserDefined(altitudes=[0, 100000],\n", " values={'SKCLIMATOLOGY_AEROSOL_CM3': [1, 1]})\n", "\n", "aerosol_species = sk.Species(aerosol_optprop, aerosol_clim)" ] }, { "cell_type": "markdown", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "Which creates a constant values aerosol climatology and the corresponding :py:class:`Species ` object. This object can then be added to SASKTRAN the same way as any other species." ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "GloSSAC Climatology\n", "-------------------\n", "For quick additions of a realistic stratospheric aerosol profile the easiest thing to use is the :py:class:`SpeciesAerosolGloSSAC ` object, which implements the GloSSAC climatology available here https://eosweb.larc.nasa.gov/project/glossac/glossac. " ] } ], "metadata": { "celltoolbar": "Raw Cell Format", "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": 2 }