Python Configuration Classes
DisortFlags
flags = disortpp.DisortFlags()
All members are read/write attributes:
Attribute |
Type |
Description |
|---|---|---|
|
|
Return output at user-specified optical depths. |
|
|
Return intensities at user-specified polar angles. |
|
|
Boundary condition type ( |
|
|
Use Lambertian surface reflection. |
|
|
Include thermal emission. |
|
|
Pseudo-spherical beam geometry. |
|
|
Compute only fluxes (skip angular intensities). |
|
|
BRDF model for the surface. |
|
|
Buras & Emde intensity correction. |
|
|
Nakajima & Tanaka intensity correction. |
|
|
Use Delta-M+ scaling. |
|
|
Use the diffusion approximation as the lower boundary condition
(for stellar atmospheres). Sets
\(I(\mu) = B(T_\mathrm{bottom}) + \mu\,\mathrm{d}B/\mathrm{d}\tau\).
Requires |
|
|
Return Fourier expansion of intensity. |
BoundaryConditions
bc = disortpp.BoundaryConditions()
Attribute |
Type |
Description |
|---|---|---|
|
|
Incident parallel beam intensity. |
|
|
Cosine of beam polar angle. |
|
|
Azimuth angle of beam [deg]. |
|
|
Isotropic illumination at top. |
|
|
Isotropic illumination at bottom. |
|
|
Top boundary temperature [K]. |
|
|
Bottom boundary temperature [K]. |
|
|
Top boundary emissivity. |
|
|
Lambertian surface albedo. |
BRDF specifications
rpv = disortpp.RpvBrdfSpec() # rho0, k, theta, sigma, t1, t2, scale
ambrals = disortpp.AmbralsBrdfSpec() # iso, vol, geo
cox_munk = disortpp.CoxMunkBrdfSpec() # u10, pcl, xsal, refractive_index, do_shadow
hapke = disortpp.HapkeBrdfSpec() # b0, hh, w
brdf = disortpp.BrdfSpecification()
brdf.set_rpv(rpv)
brdf.set_ambrals(ambrals)
brdf.set_cox_munk(cox_munk)
brdf.set_hapke(hapke)
All BRDF struct members are accessible as read/write attributes. See the C++ BRDF documentation for details on each parameter.
DisortConfig
Main configuration class for the general solver.
# Construct with dimensions
cfg = disortpp.DisortConfig(num_layers, num_streams)
cfg = disortpp.DisortConfig(num_layers, num_streams, num_phase_func_moments)
# Or default-construct and set dimensions manually
cfg = disortpp.DisortConfig()
cfg.num_layers = 4
cfg.num_streams = 16
Nested structs (read/write):
cfg.flags–DisortFlagscfg.bc–BoundaryConditionscfg.brdf–BrdfSpecification
Dimension attributes:
num_layers,num_streams,num_phase_func_momentsnum_user_tau,num_user_mu,num_phinum_phase_func_angles
Physical parameters:
wavenumber_low,wavenumber_high(float)accuracy_fourier_series(float)bottom_radius(float)
Array attributes (set as Python lists after calling allocate()):
delta_tau– Layer optical depths.single_scat_albedo– Layer single-scattering albedos.phase_function_moments– Nested list of Legendre moments.temperature– Level temperatures.level_altitudes– Level altitudes.tau_user– User optical depths.mu_user– User polar angle cosines.phi_user– User azimuthal angles [deg].mu_phase_function– Scattering angle grid.phase_function– Tabulated phase function values.
Methods:
- cfg.nmom_nstr()
Returns
max(num_phase_func_moments, num_streams).
- cfg.allocate()
Allocate internal arrays. Call after setting all dimensions and flags.
- cfg.validate()
Validate the configuration. Raises
ValueErroron invalid input.
- cfg.set_henyey_greenstein(g, lc=-1)
Fill Henyey-Greenstein phase function moments (\(\chi_k = g^k\)). Set
lcto fill only a specific layer (0-based), or-1for all layers.
- cfg.set_isotropic(lc=-1)
Set isotropic scattering.
- cfg.set_rayleigh(lc=-1)
Set Rayleigh scattering.
- cfg.set_haze_garcia_siewert(lc=-1)
Set Haze-L phase function.
- cfg.set_cloud_garcia_siewert(lc=-1)
Set Cloud C.1 phase function.
- cfg.set_phase_function(type, g=0.0, lc=-1)
Set phase function by enum type.
DisortFluxConfig
Lightweight configuration for the flux-only solver.
cfg = disortpp.DisortFluxConfig(num_layers, num_streams)
All fields are flat attributes (no nested structs):
Dimensions: num_layers, num_streams, num_phase_func_moments
Flags: use_thermal_emission, use_spherical_beam,
use_delta_m_plus, use_diffusion_lower_bc
Boundary conditions: direct_beam_flux, direct_beam_mu,
isotropic_flux_top, isotropic_flux_bottom, temperature_top,
temperature_bottom, emissivity_top, surface_albedo
Physical parameters: wavenumber_low, wavenumber_high,
bottom_radius
Arrays: delta_tau, single_scat_albedo,
phase_function_moments, temperature, level_altitudes
Methods: Same as DisortConfig: nmom_nstr(), allocate(),
validate(), set_henyey_greenstein(), set_isotropic(),
set_rayleigh(), set_haze_garcia_siewert(),
set_cloud_garcia_siewert(), set_phase_function().