Rough Emission¶
This worked example shows how to use roughness to compute a radiated emission spectrum from a rough surface.
Setup¶
Make sure to install the roughness package and download the default lookup tables before running this example. See the getting started page for more information.
Imports¶
The roughness package provides a RoughnessThermalModel class that can be used to compute emission spectra from rough surfaces. The xarray package is used to store and manipulate the lookup tables.
from roughness import RoughnessThermalModel
# Create a model instance
rtm = RoughnessThermalModel()
rtm
RoughnessThermalModel(shadow_lookup='/home/runner/work/roughness/roughness/data/default_lookup.nc', temperature_lookup='/home/runner/work/roughness/roughness/data/temp_lookup_moon.nc')
Custom Lookup Tables¶
The default lookup tables have been developed and tested for the Moon. However, roughness allows users to generate custom lookup tables for any body with a custom thermal model.
The shadow_lookup table is a lookup table of probabilities that a given surface facet is in shadow. It is generated using a raytracing algorithm applied to a self-affine fractal rough surface with a default Hurst exponent chosen for lunar applications. The default surface should function for most rough planetary surfaces, but can be regenerated ysing the roughness.make_los_table module as described in shadow_tables.
The temperature_lookup table is a lookup table of surface temperatures for each surface facet. Any thermal model can be used to generate this table and it can have arbitrary dimensionality, the only requirement is that the output is an xarray.Dataset with a data variable tsurf and contains at least the theta and az coordinates, corresponding to surface facet slope and azimuth.
The default temperature table used in roughness was developed for the Moon using KRC (krc.mars.asu.edu) and is body-specific due to the unique thermal environment of each planetary body. Below is the temperature Dataset with coordinates relevant to predicting surface temperatures on the Moon. See temperature_tables for more details.
rtm.temperature_ds
<xarray.Dataset>
Dimensions: (albedo: 6, lat: 18, theta: 19, ls: 10, tloc: 37, az: 19)
Coordinates:
* albedo (albedo) float64 0.05 0.085 0.12 0.155 0.19 0.225
* lat (lat) float64 -85.0 -75.0 -65.0 -55.0 -45.0 ... 55.0 65.0 75.0 85.0
* theta (theta) float64 0.0 5.0 10.0 15.0 20.0 ... 70.0 75.0 80.0 85.0 90.0
* ls (ls) float64 0.0 40.0 80.0 120.0 160.0 ... 240.0 280.0 320.0 360.0
* tloc (tloc) float64 0.0 0.6667 1.333 2.0 2.667 ... 22.0 22.67 23.33 24.0
* az (az) float64 0.0 20.0 40.0 60.0 80.0 ... 300.0 320.0 340.0 360.0
Data variables:
tsurf (albedo, lat, ls, az, theta, tloc) float32 ...The roughness thermal model interpolates between the pre-computed shadowing and lookup tables to compute the emitted radiance for a given geometry and local conditions. The desired parameters are passed to the emission method of the RoughnessThermalModel object, which returns an xarray object containing the emitted radiance for each wavelength and roughness value. The emission method requires the following parameters:
geometry: A tuple containing the solar incidence angle, solar azimuth, spacecraft emission angle, and spacecraft azimuth, all in units of degrees. Azimuths are computed clockwise from North.wavelengths: An array of wavelengths in units of microns where emission will be computed.rms: The RMS roughness in units of degrees.tparams: A dictionary containing the parameters required to interpolate the temperature lookup table. The required parameters are all coordinates ofrtm.temperature_dsexcept for facetthetaandaz. Printrtm.required_tparamsto check which parameters are needed.kwargs: Additional keyword arguments are passed toroughness.emission.rough_emission_lookupto fine tune the emission run. See emission for more details.
rtm.required_tparams
{'albedo', 'lat', 'ls', 'tloc'}
Predicting emission¶
We can now use the roughness model to predict the emission from a surface with a given roughness. We'll use an RMS value of 25 degrees and pick a point near the equator. We use a helper function to compute the local time at the chosen point.
import numpy as np
from roughness import helpers as rh
# Set parameters
rms = 15
wls = np.linspace(0.45, 100, 1000)
sun_theta, sun_az = 30, 90
sc_theta, sc_az = 60, 90
lat = 0 # Latitude [degrees]
ls = 0 # Solar longitude (L_s) [degrees]
albedo = 0.12 # Directional hemispherical (thermal) albedo
# Compute tloc and set tparams
tloc = rh.inc_to_tloc(sun_theta, sun_az, lat)
tparams = {'albedo': albedo, 'lat': lat, 'ls': ls, 'tloc': tloc}
# Compute rough emission
emission = rtm.emission(sun_theta, sun_az, sc_theta, sc_az, wls, rms, tparams)
emission.plot()
[<matplotlib.lines.Line2D at 0x7f30f680df40>]
Plotting brightness tempertures¶
from roughness import emission as re
# Convert emitted radiance to brightness temperature
btemp = re.btempw(wls, re.mrad2cmrad(emission))
btemp.name = "Brightness Temperature [K]"
# Plot
btemp.plot()
[<matplotlib.lines.Line2D at 0x7f30f6644c70>]