pywatershed.PRMSHydraulicGeometryWidthOnly#

class pywatershed.PRMSHydraulicGeometryWidthOnly(control, discretization, parameters, seg_outflow, input_aliases=None, verbose=False)[source]#

PRMS hydraulic geometry with default depth parameters.

This subclass uses PRMS default values for depth_alpha and depth_m when those parameters are not provided in the parameter file. This matches the PRMS 5.2.1 behavior where missing parameters fall back to defaults.

Default values from strmflow_character.f90: - depth_alpha = 0.27 (range: 0.12 - 0.63 meters) - depth_m = 0.39 (range: 0.38 - 0.40)

Width parameters (width_alpha, width_m) are still required.

Parameters:
  • control (Control) – a Control object

  • discretization (Parameters) – a discretization of class Parameters

  • parameters (Parameters) – a parameter object of class Parameters

  • seg_outflow (Union[str, Path, ndarray, Adapter, PrmsDynamicParameter]) – Streamflow leaving each segment (cfs)

  • verbose (bool) – Print extra information or not?

__init__(control, discretization, parameters, seg_outflow, input_aliases=None, verbose=False)[source]#

Methods

__init__(control, discretization, ...[, ...])

advance()

Advance the Process in time.

calculate(time_length, **kwargs)

Calculate Process terms for a time step

description()

A dictionary description of this Process.

finalize()

Finalize the Process, output methods, and close input adapters.

get_dimensions()

Get a tuple of dimension names for this Process.

get_init_values()

Get a dictionary of initialization values for each public variable.

get_inputs()

Get a tuple of input variable names for this Process.

get_parameters()

Get required parameters (only width, depth uses defaults).

get_restart_variables()

A list of restart varible names.

get_variables()

Get a tuple of (public) variable names for this Process.

initialize_netcdf([output_dir, ...])

Initialize NetCDF output.

output()

Output data to previously initialized output types.

output_to_csv(pth)

Save each output variable to separate csv file in specified path

set_input_to_adapter(input_variable_name, ...)

Set input variables to adapter.current and manage the adapter.

Attributes

dimensions

A tuple of parameter names.

init_values

A dictionary of initial values for each public variable.

inputs

A tuple of input variable names.

parameters

A tuple of parameter names.

restart_variables

previous.

variables

A tuple of public variable names.

advance()#

Advance the Process in time.

Returns:

None

calculate(time_length, **kwargs)#

Calculate Process terms for a time step

Parameters:

simulation_time – current simulation time

Return type:

None

Returns:

None

classmethod description()#

A dictionary description of this Process.

Return type:

dict

Returns:

All metadata for all variables in inputs, variables, and parameters.

property dimensions: tuple#

A tuple of parameter names.

finalize()#

Finalize the Process, output methods, and close input adapters.

Return type:

None

Returns:

None

static get_dimensions()#

Get a tuple of dimension names for this Process.

Return type:

tuple

static get_init_values()#

Get a dictionary of initialization values for each public variable.

Return type:

dict

static get_inputs()#

Get a tuple of input variable names for this Process.

Return type:

tuple

static get_parameters()[source]#

Get required parameters (only width, depth uses defaults).

Return type:

tuple

static get_restart_variables()#

A list of restart varible names.

Return type:

list

static get_variables()#

Get a tuple of (public) variable names for this Process.

Return type:

tuple

property init_values: dict#

A dictionary of initial values for each public variable.

initialize_netcdf(output_dir=None, separate_files=None, output_vars=None, extra_coords=None, addtl_output_vars=None, **kwargs)#

Initialize NetCDF output.

Parameters:
  • output_dir ([<class ‘str’>, <class ‘pathlib.Path’>]) – base directory path or NetCDF file path if separate_files is True

  • separate_files (bool) – boolean indicating if storage component output variables should be written to a separate file for each variable

  • output_vars (list) – list of variable names to output.

Return type:

None

Returns:

None

property inputs: tuple#

A tuple of input variable names.

output()#

Output data to previously initialized output types. :rtype: None :returns: None

output_to_csv(pth)#

Save each output variable to separate csv file in specified path

property parameters: tuple#

A tuple of parameter names.

property restart_variables: dict#

previous.

Type:

A dict of restart variable names mapping current

set_input_to_adapter(input_variable_name, adapter)#

Set input variables to adapter.current and manage the adapter.

TODO: make this private?

Parameters:
  • input_variable_name (str) – key of input variable

  • adapter (Adapter) – the Adapter for the input.

property variables: tuple#

A tuple of public variable names.