Calculating Weighting Functions with Disco

In this example we calculate weighting functions for ozone using SASKTRAN-Disco. Refer to SASKTRAN-Disco’s documentation page for more documentation.

[1]:
%matplotlib inline

import numpy as np
import sasktran as sk
import matplotlib.pyplot as plt
[2]:
# Setup the sk.Geometry
geometry = sk.NadirGeometry()

tempo = sk.Geodetic()
tempo.from_lat_lon_alt(0, -100, 35786000)

geometry.from_lat_lon(lats=52.131638, lons=-106.633873, elevations=0,
    mjd=57906.843, observer=tempo
)

# Setup the sk.Atmosphere
atmosphere = sk.Atmosphere()
atmosphere['rayleigh'] = sk.Species(sk.Rayleigh(), sk.MSIS90())
atmosphere['o3'] = sk.Species(sk.O3OSIRISRes(), sk.Labow())
atmosphere['no2'] = sk.Species(sk.NO2OSIRISRes(), sk.Pratmo())
atmosphere.brdf = sk.Kokhanovsky()

# Construct the engine
engine = sk.EngineDO(geometry=geometry, atmosphere=atmosphere, wavelengths=[330])
[10]:
""" Configure weighting function calculations.
"""
atmosphere.wf_species = 'o3'

""" OPTIONAL settings.

wfaltitudes: Altitudes at which weighting functions are calculated.
wfwidths: Half the width of the perturbations.
wfform: Selects output form; 0 is dI/dn.

"""
wf_altitudes = np.arange(500, 60001, 500) # 500 m to 60 km in 500 m  steps
engine.options['wfaltitudes'] = wf_altitudes
engine.options['wfwidths'] = np.ones_like(wf_altitudes) * 500 # 500 m above and below wfaltitudes
engine.options['wfform'] = 0 # dI/dn
[11]:
rad, wf = engine.calculate_radiance()

# Plot weighting function
plt.figure()
plt.ylabel('Altitude [m]')
plt.xlabel('dI/dn')
plt.plot(wf[0,:,:].T,engine.options['wfaltitudes'])
plt.show()
../../_images/examples_disco_basic_wfcalc_4_0.png