pywatershed.Starfit#

class pywatershed.Starfit(control, discretization, parameters, lake_inflow, budget_type=None, verbose=False, load_n_time_batches=1)[source]#

starfit: Storage Targets And Release Function Inference Tool

Sean W.D. Turner, Jennie Clarice Steyaert, Laura Condon, Nathalie Voisin, Water storage and release policies for all large reservoirs of conterminous United States, Journal of Hydrology, Volume 603, Part A, 2021, 126843, ISSN 0022-1694, https://doi.org/10.1016/j.jhydrol.2021.126843.

IMMM-SFA/starfit

Adapted from STARFIT implementation in the MOSART-WM model: IMMM-SFA/mosartwmpy

Noah Knowles (USGS) and James McCreight (UCAR/USGS)

Parameters:
  • control (Control) – a Control object

  • discretization (Parameters) – a discretization of class Parameters

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

  • lake_inflow (Union[str, Path, ndarray, Adapter]) – Daily lake inflow

  • budget_type (Optional[Literal[None, 'warn', 'error']]) – one of [None, “warn”, “error”]

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

  • load_n_time_batches (int) – not-implemented

__init__(control, discretization, parameters, lake_inflow, budget_type=None, verbose=False, load_n_time_batches=1)[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()

Finalizes the Process, including output methods.

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_mass_budget_terms()

Get a dictionary of variable names for mass budget terms.

get_parameters()

Get a tuple of parameter names for this Process.

get_restart_variables()

Get 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, ...)

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.

mass_budget_terms

A dictionary of variable names for the mass budget terms.

parameters

A tuple of parameter names.

restart_variables

A tuple of restart variable names.

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,parameters, and mass_budget_terms for this Process.

property dimensions: tuple#

A tuple of parameter names.

finalize()#

Finalizes the Process, including output methods. :rtype: None :returns: None

static get_dimensions()[source]#

Get a tuple of dimension names for this Process.

Return type:

dict

static get_init_values()[source]#

Get a dictionary of initialization values for each public variable.

Return type:

dict

static get_inputs()[source]#

Get a tuple of input variable names for this Process.

Return type:

tuple

static get_mass_budget_terms()[source]#

Get a dictionary of variable names for mass budget terms.

static get_parameters()[source]#

Get a tuple of parameter names for this Process.

Return type:

tuple

static get_restart_variables()#

Get a list of restart varible names.

Return type:

list

classmethod 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, budget_args=None, output_vars=None)#

Initialize NetCDF output.

Parameters:
  • output_dir – base directory path or NetCDF file path if separate_files is True

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

  • output_vars – list of variable names to outuput.

Returns:

None

property inputs: tuple#

A tuple of input variable names.

property mass_budget_terms: dict#

A dictionary of variable names for the mass budget terms.

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: tuple#

A tuple of restart variable names.

set_input_to_adapter(input_variable_name, adapter)#
property variables: tuple#

A tuple of public variable names.