API Summary#

metadata#

The metadata module provides higher-level information on all aspects of pywatershed.

meta

The metadata module.

Control#

Control(start_time, end_time, time_step[, ...])

Control manages global time and options, and provides metadata.

Parameters#

Parameter classes.

Parameters([dims, coords, data_vars, ...])

Parameter base class

parameters.PrmsParameters([dims, coords, ...])

A parameter class with methods for native PRMS files.

parameters.StarfitParameters(dims, coords, ...)

Starfit parameter class.

adapter#

The adapter module adapts various inputs to a common interface for pywatershed inputs.

adapter_factory(var[, variable_name, ...])

A function to return the appropriate subclass of Adapter

Adapter(variable)

Adapter base class for getting data from a variety of sources.

AdapterNetcdf(fname, variable, control[, ...])

Adapter subclass for a NetCDF file

Atmosphere#

Atmospheric process models.

PRMSSolarGeometry(control, discretization, ...)

PRMS solar geometry.

PRMSAtmosphere(control, discretization, ...)

PRMS atmospheric boundary layer model.

PRMSAtmosphereTranspFrost(control, ...[, ...])

PRMS atmospheric boundary layer model with a frost transpiration model.

Hydrology#

Hydrologic model components.

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

PRMS canopy class.

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

PRMS snow pack.

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

PRMS surface runoff.

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

PRMS surface runoff with agricultural infiltration.

PRMSRunoffNoDprst(control, discretization, ...)

PRMS surface runoff without depression storage.

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

PRMS soil zone.

PRMSSoilzoneAg(control, discretization, ...)

PRMS soil zone with agricultural area (no observed ET iteration).

PRMSSoilzoneAgObsET(control, discretization, ...)

PRMS soil zone with agricultural area and iterative AET matching.

PRMSSoilzoneNoDprst(control, discretization, ...)

PRMS soil zone.

PRMSGroundwater(control, discretization, ...)

PRMS groundwater reservoir.

PRMSGroundwaterNoDprst(control, ...[, ...])

PRMS groundwater reservoir.

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

PRMS channel flow (muskingum_mann).

PRMSHydraulicGeometryFull(control, ...[, ...])

PRMS hydraulic geometry.

PRMSHydraulicGeometryWidthOnly(control, ...)

PRMS hydraulic geometry with default depth parameters.

PRMSStreamTempHumidityCBH(control, ...[, ...])

PRMS stream temperature with time-varying humidity input.

PRMSStreamTemp(control, discretization, ...)

PRMS stream temperature with monthly segment humidity parameter.

PRMSStreamShadeConstant(parameters[, ...])

Constant shade parameters by season.

PRMSStreamShadeDynamic(parameters[, ...])

Dynamic shade computation from topography and vegetation.

Starfit(control, discretization, parameters, ...)

starfit: Storage Targets And Release Function Inference Tool

FlowGraph#

FlowGraph base classes and subclasses. See FlowGraph for an overview of this functionality.

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

FlowGraph manages and computes FlowNodes given by FlowNodeMakers.

FlowNode(control)

The FlowNode base class.

FlowNodeMaker([discretization, parameters])

FlowNodeMaker instantiates FlowNodes with their data.

PassThroughFlowNode(control)

A FlowNode instance that gives what it takes and dosent store.

PassThroughFlowNodeMaker()

A FlowNodeMaker of PassThroughFlowNodes.

ObsInFlowNode(control, node_obs_data)

A FlowNode that takes inflows but returns observed/specified flows.

ObsInFlowNodeMaker(parameters, obs_data)

A FlowNodeMaker for ObsInFlowNode.

SourceSinkFlowNode(control, flow_min, ...[, ...])

A FlowNode that adds or removes flow above some minimum flow parameter.

SourceSinkFlowNodeMaker(parameters, ...[, ...])

A FlowNodeMaker for SourceSinkFlowNode.

StarfitFlowNode(control, grand_id, ...[, ...])

STARFIT FlowNode: Storage Targets And Release Function Inference Tool

StarfitFlowNodeMaker(discretization, parameters)

STARFIT FlowNodeMaker: Storage Targets And Release Function Inference Tool.

StarfitSourceSinkFlowNode(control, grand_id, ...)

A StarfitFlowNode where sinks and sources interact with storage.

StarfitSourceSinkFlowNodeMaker(...[, ...])

STARFIT SourceSink FlowNodeMaker: STARFIT with diversions on storage.

PRMSChannelFlowNode(control, tsi, ts, c0, c1, c2)

A FlowNode for the Muskingum-Mann method of PRMSChannel

PRMSChannelFlowNodeMaker(discretization, ...)

A FlowNodeMaker for PRMSChannelFlowNodes.

prms_channel_flow_graph_to_model_dict(...[, ...])

Add nodes to a PRMSChannel-based FlowGraph within a Model's model_dict.

prms_channel_flow_graph_postprocess(control, ...)

Add nodes to a PRMSChannel-based FlowGraph to run from known inputs.

prms_segment_lateral_inflow_components_to_netcdf(...)

Write to NetCDf the components of lateral flow on PRMS segments.

HruSegmentFlowAdapter(parameters, sroff_vol, ...)

Adapt volumetric flows from HRUs to lateral inflows on PRMS segments.

HruNodeFlowExchange(control, discretization, ...)

Process to map PRMS HRU outflows to lateral inflows on nodes.

Model#

The Model class.

Model(process_list_or_model_dict[, control, ...])

Build a model in pywatershed.

Output#

The Output class.

Output(control, model[, ...])

Output collection and statistical analysis for models.

Base Classes#

Base classes for the modeling system.

base.Accessor()

A base class for dict access on self.

base.DatasetDict([dims, coords, data_vars, ...])

DatasetDict: a data model following NetCDF-like conventions

base.Budget(control, inputs, outputs, ...[, ...])

Budget class for mass and energy conservation.

base.Process(control, discretization, parameters)

Base class for physical process representation.

base.ConservativeProcess(control, ...[, ...])

Base class for representation of conservative physical processes.

Analysis#

analysis.HRUComparisonPanel(shapefile_path, ...)

Interactive comparison tool for HRU-based model outputs.

analysis.compare_hru_runs(shapefile_path, ...)

Convenience function to quickly create and display an HRU comparison app.

analysis.ModelGraph(model[, show_params, ...])

Visualize a pywatershed Model as a directed graph.

analysis.ProcessPlot(gis_dir[, ...])

analysis.time_stats

Time series statistical functions for pywatershed analysis.

Utils#

ControlVariables(control_dict)

PRMS control file class

MmrToMf6Dfw([control_file, control, ...])

PRMS Muskingum-Mann Routing (MMR) to MF6 Diffusive Wave (DFW).

utils.cbh_file_to_netcdf(input_file, ...[, ...])

Convert PRMS native CBH files to NetCDF format for pywatershed

utils.DomainSubset(full_control_file, ...[, ...])

Subset a domain.

utils.netcdf_utils.subset_netcdf_file(...[, ...])

Subset a netcdf file on to coordinate or dimension values.

utils.netcdf_utils.subset_xr(ds[, ...])

Subset an xarray Dataset or DataArray on to coord or dim values.