# Simultaneous Wavelength Mode with MC¶

In this example we perform a full radiative transfer calculation using the simultaneous wavelength mode of the MC model. Radiances at different wavelengths are calculated using common ray tracing, reducing computation time and greatly increasing correlation between wavelengths.

[1]:

%matplotlib inline

[2]:

import sasktran as sk
import matplotlib.pyplot as plt
import numpy as np

# First recreate our geometry and atmosphere classes
geometry = VerticalImage()
geometry.from_sza_saa(sza=60, saa=60, lat=0, lon=0, tanalts_km=[20], mjd=54372, locallook=0,
satalt_km=600, refalt_km=20)

atmosphere = sk.Atmosphere()
atmosphere['ozone'] = sk.Species(sk.O3OSIRISRes(), sk.Labow())
atmosphere['air'] = sk.Species(sk.Rayleigh(), sk.MSIS90())
atmosphere.brdf = 1.0

# And now make the engine
engine = sk.EngineMC(geometry=geometry, atmosphere=atmosphere)

engine.max_photons_per_los = 300   # cap the calculation at 300 rays per line of sight
engine.solar_table_type = 0        # calculate single scatter source terms on the fly; no cache
engine.debug_mode = 1234           # disable multi-threading, fix the rng seed for reproducibility

# Choose some wavelengths to do the calculation at
engine.wavelengths = np.arange(332, 337, 0.5)

# And do the calculation in simultaneous wavelength mode
engine.simultaneous_wavelength = True

# Repeat without simultaneous wavelength mode
engine.simultaneous_wavelength = False

[3]:

# calculate HR for reference
engine = sk.EngineHR(geometry=geometry, atmosphere=atmosphere)
engine.wavelengths = np.arange(332, 337, 0.5)

[4]:

wl = engine.wavelengths