pywatershed.PRMSSnow#
- class pywatershed.PRMSSnow(control, discretization, parameters, orad_hru, soltab_horad_potsw, swrad, hru_intcpevap, hru_ppt, potet, pptmix, prmx, tavgc, tmaxc, tminc, net_ppt, net_rain, net_snow, transp_on, budget_type=None, calc_method=None, verbose=None)[source]#
PRMS snow pack.
A snow representation from PRMS.
Implementation based on PRMS 5.2.1 with theoretical documentation given in the PRMS-IV documentation:
- Parameters:
control (
Control
) – a Control objectdiscretization (
Parameters
) – a discretization of class Parametersparameters (
Parameters
) – a parameter object of class Parametersorad_hru (
Union
[str
,Path
,ndarray
,Adapter
]) – Solar radiation on a horizontal surface for each HRUsoltab_horad_potsw (
Union
[str
,Path
,ndarray
,Adapter
]) – Potential solar radiation on a horizontal plane for each Julian Day for eachswrad (
Union
[str
,Path
,ndarray
,Adapter
]) – Shortwave radiation distributed to each HRUhru_intcpevap (
Union
[str
,Path
,ndarray
,Adapter
]) – HRU area-weighted average evaporation from the canopy for each HRUhru_ppt (
Union
[str
,Path
,ndarray
,Adapter
]) – Precipitation distributed to each HRUpotet (
Union
[str
,Path
,ndarray
,Adapter
]) – Potential ET for each HRUpptmix (
Union
[str
,Path
,ndarray
,Adapter
]) – Flag to indicate if precipitation is a mixture of rain and snow for each HRUprmx (
Union
[str
,Path
,ndarray
,Adapter
]) – Fraction of rain in a mixed precipitation event for each HRUtavgc (
Union
[str
,Path
,ndarray
,Adapter
]) – Average air temperature distributed to each HRUtmaxc (
Union
[str
,Path
,ndarray
,Adapter
]) – Maximum air temperature distributed to each HRUtminc (
Union
[str
,Path
,ndarray
,Adapter
]) – Minimum air temperature distributed to each HRUnet_ppt (
Union
[str
,Path
,ndarray
,Adapter
]) – Precipitation (rain and/or snow) that falls through the canopy for each HRUnet_rain (
Union
[str
,Path
,ndarray
,Adapter
]) – Rain that falls through canopy for each HRUnet_snow (
Union
[str
,Path
,ndarray
,Adapter
]) – Snow that falls through canopy for each HRUtransp_on (
Union
[str
,Path
,ndarray
,Adapter
]) – Flag indicating whether transpiration is occurring (0=no;1=yes)budget_type (
Optional
[Literal
[None
,'warn'
,'error'
]]) – one of [None, “warn”, “error”]calc_method (
Optional
[Literal
['numba'
,'numpy'
]]) – one of [“fortran”, “numba”, “numpy”]. None defaults to “numba”.
- __init__(control, discretization, parameters, orad_hru, soltab_horad_potsw, swrad, hru_intcpevap, hru_ppt, potet, pptmix, prmx, tavgc, tmaxc, tminc, net_ppt, net_rain, net_snow, transp_on, budget_type=None, calc_method=None, verbose=None)[source]#
Methods
__init__
(control, discretization, ...[, ...])advance
()Advance the Process in time.
calculate
(time_length, **kwargs)Calculate Process terms for a time step
A dictionary description of this Process.
finalize
()Finalizes the Process, including output methods.
Get a tuple of dimension names for this Process.
Get a dictionary of initialization values for each public variable.
Get a tuple of input variable names for this Process.
Get a dictionary of variable names for mass budget terms.
Get a tuple of parameter names for this Process.
Get a list of restart varible names.
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
A tuple of parameter names.
A dictionary of initial values for each public variable.
A tuple of input variable names.
A dictionary of variable names for the mass budget terms.
A tuple of parameter names.
A tuple of restart variable names.
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:
- Returns:
None
- classmethod description()#
A dictionary description of this Process.
- Return type:
- Returns:
All metadata for all variables in inputs, variables,parameters, and mass_budget_terms for this Process.
- static get_init_values()[source]#
Get a dictionary of initialization values for each public variable.
- Return type:
- classmethod get_variables()#
Get a tuple of (public) variable names for this Process.
- Return type:
- 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
- output_to_csv(pth)#
Save each output variable to separate csv file in specified path
- set_input_to_adapter(input_variable_name, adapter)#