Controller

The controller module holds miscellaneous classes responsible for creating variables that control how DISORT runs.

class pyrt.controller.ComputationalParameters(n_layers, n_moments, n_streams, n_azimuth, n_polar, n_user_levels)[source]

A data structure for holding the size of computational parameters.

ComputationalParameters holds the number of model layers, streams, moments, and angles. It also performs basic checks that these values are plausible. Objects of this class are meant to be be used as inputs to other classes.

Parameters
  • n_layers (int) – The number of layers to use in the model.

  • n_moments (int) – The number of polynomial moments to use in the model. This number should be greater than or equal to n_streams.

  • n_streams (int) – The number of streams (i.e. the number of computational polar angles) to use in the model. This number should be even and at least 2.

  • n_azimuth (int) – The number of azimuthal angles where DISORT should return radiant quantities.

  • n_polar (int) – The number of user-specified polar angles where DISORT should return radiant quantities.

  • n_user_levels (int) – The number of user levels to use in the model.

Raises
  • TypeError – Raised if any of the inputs cannot be converted to an int.

  • ValueError – Raised if any of the inputs are not positive finite.

Return type

None

Warning

UserWarning

Raised if n_streams is not even or if n_streams is greater than n_moments.

property n_azimuth: int

Get the input number of azimuthal angles.

Notes

In DISORT, this variable is named MAXPHI (though in the disort package, this variable is optional).

property n_layers: int

Get the input number of layers.

Notes

In DISORT, this variable is named MAXCLY (though in the disort package, this variable is optional).

In problems without scattering, this variable is not used.

property n_moments: int

Get the input number of moments.

Notes

In DISORT, this variable is named MAXMOM (though in the disort package, this variable is optional).

property n_polar: int

Get the input number of user_specified polar angles.

Notes

In DISORT, this variable is named MAXUMU (though in the disort package, this variable is optional). Only used by DISORT if user_angles is set to True.

property n_streams: int

Get the input number of streams.

Notes

In DISORT, this variable is named MAXCMU (though in the disort package, this variable is optional). In general, the more streams used the more accurate DISORT’s computations will be.

property n_user_levels: int

Get the input number of user levels.

Notes

In DISORT, this variable is named MAXULV (though in the disort package, this variable is optional).

See also

UserLevel

class pyrt.controller.ModelBehavior(accuracy=0.0, delta_m_plus=True, do_pseudo_sphere=False, header='', print_variables=None, radius=6371.0)[source]

A data structure for holding the DISORT control variables.

ModelBehavior holds the control flags that dictate DISORT’s behavior. It also performs basic checks that the input control options are plausible.

Parameters
  • accuracy (float) – The convergence criterion for azimuthal (Fourier cosine) series. Will stop when the following occurs twice: largest term being added is less than ‘accuracy’ times total series sum (twice because there are cases where terms are anomalously small but azimuthal series has not converged). Should be between 0 and 0.01 to avoid risk of serious non-convergence. Has no effect on problems lacking a beam source, since azimuthal series has only one term in that case.

  • delta_m_plus (bool) – Denote whether to use the delta-M+ method of Lin et al. (2018).

  • do_pseudo_sphere (bool) – Denote whether to use a pseudo-spherical correction.

  • header (str) – Use a 127- (or less) character header for prints, embedded in the DISORT banner. Input headers greater than 127 characters will be truncated. Setting header='' will eliminate both the banner and the header, and this is the only way to do so (header is not controlled by any of the print_variables flags); header can be used to mark the progress of a calculation in which DISORT is called many times, while leaving all other printing turned off.

  • print_variables (list) –

    Make a list of variables that control what DISORT prints. The 5 booleans control whether each of the following is printed:

    1. Input variables (except PMOM)

    2. Fluxes

    3. Intensities at user levels and angles

    4. Planar transmissivity and planar albedo as a function of solar zenith angle (only used if incidence_beam_conditions is set to True)

    5. PMOM for each layer (but only if 1. == True and only for layers with scattering)

    Default is None, which makes [False, False, False, False, False].

  • radius (float) – The planetary radius. This is presumably only used if do_pseudo_sphere is set to True, although there is no documentation on this

Raises
  • TypeError – Raised if any inputs cannot be cast to the correct type.

  • ValueError – Raised if any inputs cannot be cast to the correct type or if print_variables does not have 5 elements.

Return type

None

Warning

UserWarning

Raised if accuracy is not between 0 and 0.01.

property accuracy: float

Get the input accuracy.

Notes

In DISORT, this variable is named ACCUR.

property delta_m_plus: bool

Get whether to use delta-M+ scaling.

Notes

In DISORT, this variable is named DELTAMPLUS.

property do_pseudo_sphere: bool

Get whether to perform a pseudo-spherical correction.

Notes

In DISORT, this variable is named DO_PSEUDO_SPHERE.

property header: str

Get the characters that will appear in the DISORT banner.

Notes

In DISORT, this variable is named HEADER.

property print_variables: list

Get the variables to print.

Notes

In DISORT, this variable is named PRNT.

property radius: float

Get the planetary radius.

Notes

In DISORT, this variable is named EARTH_RADIUS.