pywatershed.PRMSStreamShadeDynamic#

class pywatershed.PRMSStreamShadeDynamic(parameters, discretization=None)[source]#

Dynamic shade computation from topography and vegetation.

Computes shade dynamically based on topographic and vegetation parameters using solar geometry calculations. This is the default PRMS behavior when stream_temp_shade_flag = 0.

Requires 13 parameters describing topography and vegetation characteristics for each stream segment.

The compute() method returns a tuple of (shades, svis) where:

shades: Array of shade fractions (0-1) for all segments svis: Array of vegetation shade index

__init__(parameters, discretization=None)#

Initialize shade computer.

Parameters:
  • parameters (Parameters) – Parameters object containing shade parameters

  • discretization (Parameters) – Optional discretization parameters

Methods

__init__(parameters[, discretization])

Initialize shade computer.

compute(seg_idx, declination, summer_flag, ...)

Compute shade using shday algorithm.

compute_all(declination, summer_flag, ...)

Compute shade for all segments at once (vectorized).

get_parameters()

Get required topography and vegetation parameters.

compute(seg_idx, declination, summer_flag, seg_flow_width)[source]#

Compute shade using shday algorithm.

Parameters:
  • seg_idx (int) – Segment index (0-based)

  • declination (float) – Solar declination (radians)

  • summer_flag (int) – 1 for summer, 0 for winter

  • seg_flow_width (float) – Flow width for the segment (meters)

Return type:

tuple[float, float]

Returns:

Tuple of (shade, svi) where – shade: Shade fraction (0-1) svi: Vegetation shade index

compute_all(declination, summer_flag, seg_flow_widths)[source]#

Compute shade for all segments at once (vectorized).

Parameters:
  • declination (float) – Solar declination (radians)

  • summer_flag (int) – 1 for summer, 0 for winter

  • seg_flow_widths (ndarray) – Flow widths for all segments (meters)

Return type:

tuple[ndarray, ndarray]

Returns:

Tuple of (shades, svis) where – shades: Array of shade fractions (0-1) for all segments svis: Array of vegetation shade indices for all segments

static get_parameters()[source]#

Get required topography and vegetation parameters.

Return type:

tuple