{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Basic Radiative Transfer Calculation\n",
"\n",
"In this example we will calculate radiances from 340 nm to 700 nm in 1 nm steps using SASKTRAN-Disco. The geometry will be configured to be TEMPO looking at the ARG office on June 2 2017 at 3:14 PM and the atmosphere will be configured to consider Rayleigh scattering, O3, and NO2."
]
},
{
"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 sasktran.disco.interface as do\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First we need to configure our sk.Geometry object. This object specifies the\n",
"line of sight vectors as well as the solar position (based on mean mjd)."
]
},
{
"cell_type": "code",
"execution_count": null,
"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": "markdown",
"metadata": {},
"source": [
"Next we need to configure our sk.Atmosphere object. This object specifies all\n",
"atmospheric and surface properties to the engine."
]
},
{
"cell_type": "code",
"execution_count": null,
"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": "markdown",
"metadata": {},
"source": [
"We are now ready to perform the radiance calculation. Note that the engine can\n",
"be default constructed (with properties set after construction), or the\n",
"properties can be passed to the constructor."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"wavelengths = np.linspace(340,700, 361)\n",
"engine = do.EngineDO(geometry=geometry, atmosphere=atmosphere, wavelengths=wavelengths)\n",
"rad = engine.calculate_radiance()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"# 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",
"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": 2
}