NWSRFS Wrapper Module

class nwsrfs_py.nwsrfs.RSnwElevPars(year, month, day, hour, taelev, talr, pxtemp, aetbl_index, aetbl_values, forcings_mat)[source]

Bases: object

Container for all inputs required to run the NWSRFS RSNWELEV model via F2PY bindings.

This class supports vectorized execution across multiple zones and timesteps simultaneously. Both aetbl_index and aeble_value columns must be ascending order. Input arrays should adhere to the following shape conventions:

Dimensions:

  • T: Number of timesteps.

  • Z: Number of zones.

  • E: Number of area elevation curve rows.

Array Shapes:

  • Time Arrays (e.g., year): Shape (T,)

  • Temperature Forcings (e.g., forcings_mat): Shape (T, Z)

  • Scalar Parameters (e.g., pxtemp): Shape (Z,)

  • Area-Elevation Table Index (e.g., aetbl_index): Shape (E,)

  • Area-Elevation Table Values (e.g., aetbl_values): Shape (E,Z)

Parameters:
  • year (ndarray) – Array of years for each timestep (units: time).

  • month (ndarray) – Array of months corresponding to each timestep (units: time).

  • day (ndarray) – Array of days for each timestep (units: time).

  • hour (ndarray) – Array of hours corresponding to each timestep (units: time).

  • taelev (ndarray) – Elevation associated with the forcings_mat time series (units: m).

  • talr (ndarray) – Lapse rate during precipitation periods (units: degc/100m).

  • pxtemp (ndarray) – Rain/snow threshold temperature (units: degc).

  • aetbl_index (ndarray) – Area-elevation table index array (units: fraction 0-1).

  • aetbl_values (ndarray) – Area-elevation table values array(units: m).

  • forcings_mat (ndarray) – Air temperature array for each timestep (units: degc).

validate()[source]

Checks that all inputs meet shape, type, and value constraints.

class nwsrfs_py.nwsrfs.ChanlossPars(year, month, day, hour, periods, factors, cl_type, min_flow, qin)[source]

Bases: object

Container for all inputs required to run the NWSRFS CHANLOSS model via F2PY bindings.

This class supports vectorized execution across multiple CHANLOSS periods and timesteps simultaneously. Input arrays should adhere to the following shape conventions:

Dimensions:

  • T: Number of timesteps.

  • C: Number of CHANLOSS periods.

Array Shapes:

  • Time Arrays and Streamflow (e.g., year, qin): Shape (T,)

  • CHANLOSS Factors (e.g., factors): Shape (C,)

  • CHANLOSS Periods (e.g., periods): Shape (C,2)

Parameters:
  • year (ndarray) – Array of years for each timestep (units: time).

  • month (ndarray) – Array of months corresponding to each timestep (units: time).

  • day (ndarray) – Array of days for each timestep (units: time).

  • hour (ndarray) – Array of hours for each timestep (units: time).

  • factors (ndarray) – Adjustment for each period. For cl_type=1, a dimensionless multiplier applied to qin (0.8 retains 80% of the flow). For cl_type=2, a flow amount subtracted from qin (units: cfs).

  • periods (ndarray) – Inclusive beginning and ending months for each factor, with integer values from 1 to 12. A beginning month greater than the ending month spans the year boundary (units: month).

  • cl_type (Number) – Adjustment mode: 1 (varp) multiplies streamflow by the interpolated factor; 2 (varc) subtracts the interpolated factor.

  • min_flow (Number) – Minimum required qin flow for CHANLOSS to be applied (units: cfs).

  • qin (ndarray) – Lower bound on adjusted streamflow (units: cfs). Output is also bounded below by 0 cfs.

validate()[source]

Checks that all inputs meet shape, type, and value constraints.

class nwsrfs_py.nwsrfs.ConsusePars(year, month, day, area, irr_eff, min_flow, rf_accum_rate, rf_decay_rate, pet_adj, peadj_m, pet, qin)[source]

Bases: object

Container for all inputs required to run the NWSRFS CONS_USE model via F2PY bindings.

This class supports vectorized all timesteps simultaneously. Only a single CONS_USE zone can be ran at a time.

Input arrays should adhere to the following shape conventions:

Dimensions:

  • T: Number of timesteps.

Array Shapes:

  • Time Arrays, Streamflow, and PET (e.g., year, qin): Shape (T,)

  • **PE Adjust Table ** (peadj_m): Shape (12,)

Parameters:
  • year (ndarray) – Array of years for each timestep (units: time).

  • month (ndarray) – Array of months corresponding to each timestep (units: time).

  • day (ndarray) – Array of days for each timestep (units: time).

  • area (Number) – Area of CONS_USE zone (units: km**2).

  • irr_eff (Number) – Irrigation efficiency (units: fraction 0-1).

  • min_flow (Number) – Minimum flow (units: cfs).

  • rf_accum_rate (Number) – Return flow accumulation rate (units: fraction 0-1).

  • rf_decay_rate (Number) – Fraction of return flow storage released to the channel each day (units: NA).

  • pet_adj (Number) – Potential evaporation (PET) adjustment factor (units: NA).

  • peadj_m (ndarray) – Monthly pe adjust table (units: NA).

  • pet (ndarray) – Daily potential evapotranspiration depth for each timestep (units: mm per day), before applying pet_adj and peadj_m.

  • qin (ndarray) – Input daily average streamflow to adjust for CONS_USE (units: cfs).

validate()[source]

Checks that all inputs meet shape, type, and value constraints.

class nwsrfs_py.nwsrfs.FAPars(year, month, day, hour, pars, area, alat, limits, forcings=None, peadj_m=None, climo=None)[source]

Bases: object

Container for all inputs required to apply monthly climatological forcing adjustments (FA) to either MAP, MAT, PTPS, or PET. FA parameters and limits are shared across zones. This dataclass is designed to be generic to all four forcing types. The units for limits, forcings, and climo depend on the forcing type being processed:

  • map (Precipitation): mm

  • mat (Temperature): deg C

  • ptps (Precip Typing): fraction (0-1)

  • pet (Potential Evap): mm

Climatologies and adjustment limits use monthly totals in mm for MAP and PET, monthly mean temperature in degrees Celsius for MAT, and monthly mean fractions for PTPS. Climatology is area weighted across zones. All four climatologies must be supplied together or omitted together.

pet is calculated from adjusted MAT using the Hargreaves–Samani method and zone latitude. Pass forcings=None for PET and supply peadj_m to convert adjusted PET to evaporation demand.

This class supports vectorized execution across multiple zones and timesteps simultaneously. Input arrays should adhere to the following shape conventions:

Dimensions:

  • T: Number of timesteps.

  • Z: Number of zones.

  • N_pars: Number of fa parameters (4).

Array Shapes:

  • Time Arrays (e.g., year): Shape (T,)

  • Forcings (e.g., forcings): Shape (T, Z)

  • Scalar Parameters (e.g., alat): Shape (Z,)

  • Vector Parameters (e.g., pars): Shape (N_pars, ) - Axis 0 corresponds to the ordered parameter list.

  • Climo Parameter (e.g., climo): Shape (12, ) - A value for each month (Jan-Dec)

  • limits: Shape (12, 2), with lower bounds in column 0 and upper bounds in column 1.

  • peadj_m: Shape (12, Z), with months January–December along axis 0.

Parameters:
  • year (ndarray) – Array of years for each timestep (units: time).

  • month (ndarray) – Array of months corresponding to each timestep (units: time).

  • day (ndarray) – Array of days for each timestep (units: time).

  • hour (ndarray) – Array of hours corresponding to each timestep (units: time).

  • pars (ndarray) –

    Contains the forcing adjustment parameters (ordered array).

    1. scale: Multiplication factor to apply directly to the forcing for map, pet, and ptps. For mat this parameter is an additive shift (units: NA).

    2. p_redist: The percentage of the climatological forcing to redistribute (units: fraction 0-1).

    3. std: Controls the weighting factor on how the p_redist is partitioned out to each climatological month based on ranking (units: NA).

    4. shift: Shift the climatological values by x numbers of days in the positive or negative (units: days)

  • area (ndarray) – Array of each zone’s area (units: km**2).

  • alat (ndarray) – Array of each zone’s centroid latitude (units: decimal degrees).

  • limits (ndarray) – Contains the forcing adjustment upper and lower limits for each of the 12 months. Units vary by forcing type (see above).

  • forcings (ndarray | None) – Input forcings to adjust using pars and limits. None must be passed for pet. Units vary by forcing type (see above).

  • peadj_m (ndarray | None) – Input required for PET forcing adjustment. Contains potential evaporation adjustment factors [pet -> etd] for each of the 12 months [Not required for other forcing types] (units: NA).

  • climo (ndarray | None) – Optional input to provide the monthly climatology which will be used the limits parameter to establish allowable adjustments. Otherwise climatology will be calculated with forcings inputs. Units vary by forcing type (see above).

validate()[source]

Checks that all inputs meet shape, type, and value constraints.

class nwsrfs_py.nwsrfs.GammaUhPars(dt_hours, area, shape, scale=None, toc=None)[source]

Bases: object

Container for all inputs required to create a gamma UNIT-HG models via F2PY bindings. Multiple gamma unit hydrograph parameter sets can be ran simultaneously.

This class supports vectorized execution across multiple zones. Input arrays should adhere to the following shape conventions:

Dimensions:

  • Z: Number of zones.

Array Shapes:

  • Parameters (e.g., shape): Shape (Z,)

Parameters:
  • dt_hours (Number) – Finite, positive scalar timestep in hours. (units: hours)

  • area (ndarray) – Array of each zone’s area. (units: km**2)

  • shape (ndarray) – Dimensionless gamma shape parameter for each zone. (units: NA)

  • scale (ndarray | None) – Gamma scale parameter for each zone. If scale is None, toc parameter must be provided. (units: NA)

  • toc (ndarray | None) – Target truncated hydrograph duration for each zone . If toc is None, the scale parameter must be provided. (units: hours)

validate()[source]

Checks that all inputs meet shape, type, and value constraints.

class nwsrfs_py.nwsrfs.LagkPars(year, month, day, hour, tbl_lageq_a, tbl_lageq_b, tbl_lageq_c, tbl_lageq_d, tbl_keq_a, tbl_keq_b, tbl_keq_c, tbl_keq_d, tbl_lagmax, tbl_lagmin, tbl_kmax, tbl_kmin, tbl_qmax, tbl_qmin, init_co, init_qin, init_qout, init_stor, qin)[source]

Bases: object

Container for all inputs required to run the NWSRFS Lag-K model via F2PY bindings.

This class supports vectorized execution across multiple upstream reaches and timesteps simultaneously. Input arrays should adhere to the following shape conventions:

Dimensions:

  • T: Number of timesteps.

  • R: Number of upstream reaches.

Array Shapes:

  • Time Arrays (e.g., year): Shape (T,)

  • Upstream Reach (e.g., qin): Shape (T, R)

  • Scalar Parameters (e.g., tbl_keq_c): Shape (R,)

Lag/K Table Equation:

Lag/K_table=a*(Q-d)**2+b*Q+c

Parameters:
  • year (ndarray) – Array of years for each timestep (units: time).

  • month (ndarray) – Array of months corresponding to each timestep (units: time).

  • day (ndarray) – Array of days for each timestep (units: time).

  • hour (ndarray) – Array of hours corresponding to each timestep (units: time).

  • tbl_lageq_a (ndarray) – Parameter used to calculate the lag table (units: NA).

  • tbl_lageq_b (ndarray) – Parameter used to calculate the lag table (units: NA).

  • tbl_lageq_c (ndarray) – Parameter used to calculate the lag table (units: NA).

  • tbl_lageq_d (ndarray) – Parameter used to calculate the lag table (units: NA).

  • tbl_keq_a (ndarray) – Parameter used to calculate the k table (units: NA).

  • tbl_keq_b (ndarray) – Parameter used to calculate the k table (units: NA).

  • tbl_keq_c (ndarray) – Parameter used to calculate the k table (units: NA).

  • tbl_keq_d (ndarray) – Parameter used to calculate the k table (units: NA).

  • tbl_lagmax (ndarray) – max lag value for lag table (units: hours).

  • tbl_lagmin (ndarray) – min lag value for lag table (units: hours).

  • tbl_kmax (ndarray) – max k value for k table (units: hours).

  • tbl_kmin (ndarray) – min k value for k table (units: hours).

  • tbl_qmax (ndarray) – max q value for both lag and k table (units: cfs).

  • tbl_qmin (ndarray) – min q value for both lag and k table (units: cfs).

  • init_co (ndarray) – Initial carry over (units: cfs).

  • init_qin (ndarray) – Initial inflow (units: cfs).

  • init_qout (ndarray) – Initial outflow (units: cfs).

  • init_stor (ndarray) – Initial storage (units: cfs).

  • qin (ndarray) – Input streamflows to route. (units: cfs).

validate()[source]

Checks that all inputs meet shape, type, and value constraints.

class nwsrfs_py.nwsrfs.SacSnowPars(year, month, day, hour, alat, elev, sac_pars, snow_pars, init_swe, pxadj, peadj, forcings_map, forcings_mat, forcings_ptps, forcings_etd)[source]

Bases: object

Container for all inputs required to run the NWSRFS SAC-SMA and SNOW-17 models via F2PY bindings.

This class supports vectorized execution across multiple zones and timesteps simultaneously. Input arrays should adhere to the following shape conventions:

Dimensions:

  • T: Number of timesteps.

  • Z: Number of zones.

  • N_pars: Number of parameters (varies by model).

Array Shapes:

  • Time Arrays (e.g., year): Shape (T,)

  • Forcings (e.g., forcings_map): Shape (T, Z)

  • Scalar Parameters (e.g., alat): Shape (Z,)

  • Vector Parameters (e.g., sac_pars, snow_pars): Shape (N_pars, Z) - Axis 0 corresponds to the ordered parameter list.
    • For SAC-SMA: N_pars = 17

    • For SNOW-17: N_pars = 13

ADC Table Equation:

swe/ai = a * AESC**b+(1-a)*AESC**c

Parameters:
  • year (ndarray) – Array of years for each timestep (units: time).

  • month (ndarray) – Array of months corresponding to each timestep (units: time).

  • day (ndarray) – Array of days for each timestep (units: time).

  • hour (ndarray) – Array of hours corresponding to each timestep (units: time).

  • alat (ndarray) – array of each zone’s centroid latitude (units: decimal degrees).

  • elev (ndarray) – array of each zone’s centroid elevation (units: m).

  • sac_pars (ndarray) –

    SAC-SMA model parameters (ordered array).

    1. uztwm: Upper zone tension water capacity (units: mm).

    2. uzfwm: Upper zone free water capacity (units: mm).

    3. lztwm: Lower zone tension water capacity (units: mm).

    4. lzfpm: Lower zone primary free water capacity (units: mm).

    5. lzfsm: Lower zone supplemental free water capacity (units: mm).

    6. adimp: Fraction of additional impervious area (units: fraction 0-1).

    7. uzk: Upper zone free water storage depletion coefficient (units: NA).

    8. lzpk: Lower zone primary free water storage depletion coefficient (units: NA).

    9. lzsk: Lower zone supplemental free water storage depletion coefficient (units: NA).

    10. zperc: Maximum percolation rate multiplier (units: NA).

    11. rexp: Exponent for the percolation equation (units: NA).

    12. pctim: Minimum impervious area (units: fraction 0-1).

    13. pfree: Fraction of percolated water which always goes directly to lower zone free water storages (units: fraction 0-1).

    14. riva: Fraction of riparian vegetation area (units: fraction 0-1).

    15. side: Fraction of non-channel baseflow (deep groundwater recharge) to channel baseflow (units: fraction 0-1).

    16. rserv: Fraction of lower zone free water which cannot be transferred to lztw (units: fraction 0-1).

    17. efc: fraction of effective forest cover (units: fraction 0-1).

  • snow_pars (ndarray) –

    SNOW-17 model parameters (ordered array).

    1. scf: Snowfall correction factor (units: NA).

    2. mfmax: Maximum non-rain melt factor per time step (units: mm/degc).

    3. mfmin: Minimum non-rain melt factor per time step (units: mm/degc).

    4. uadj: Average wind function per time step (units: mm/mb).

    5. si: SWE threshold above which there is always 100% snow cover (units: mm).

    6. nmf: Maximum negative melt factor per time step (units: mm/degc).

    7. tipm: Antecedent snow temperature index parameter (units: fraction 0-1).

    8. mbase: Base temperature for non-rain melt factor (units: degc).

    9. plwhc: Maximum amount of liquid water held against gravity drainage (units: fraction 0-1).

    10. daygm: Daily melt at the snow-soil interface (units: mm).

    11. adc_a: Parameter used to calculate the areal depletion curve parameter (units: NA).

    12. adc_b: Parameter used to calculate the areal depletion curve parameter (units: NA).

    13. adc_c: Parameter used to calculate the areal depletion curve parameter (units: NA).

  • init_swe (ndarray) – Initial snow water equivalent values (units: NA).

  • pxadj (ndarray) – Precipitation adjustment factor (units: NA).

  • peadj (ndarray) – Evapotranspiration adjustment factor (units: NA).

  • forcings_map (ndarray) – Precipitation array for each timestep (units: mm).

  • forcings_mat (ndarray) – Air temperature array for each timestep (units: degc).

  • forcings_ptps (ndarray) – Fraction of precipitation as snow array for each timestep (units: fraction 0-1).

  • forcings_etd (ndarray) – Evaporation demand array for each timestep (units: mm).

validate()[source]

Checks that all inputs meet shape, type, and value constraints.

class nwsrfs_py.nwsrfs.GammaUh(pars_dataclass, validate=True)[source]

Bases: object

Class to generate Gamma UNIT-HG and route flows via F2PY bindings.

Parameters:
  • pars_dataclass (GammaUhPars) – Dataclass which contains all inputs needed for gamma UNIT-HG calculations.

  • validate (bool) – Validate GammaUhPars dataclass inputs are correct format/type. Default: True.

gammauh_pars

Dataclass which contains all inputs needed for gamma UNIT-HG calculations.

Type:

GammaUhPars

Warning

Unit hydrographs are limited to 1,000 ordinates. Hydrographs that extend beyond this limit are truncated and normalized over the retained ordinates, which can alter their timing and shape.

return_sf(tci, return_inst=True)[source]

Return a timeseries of streamflow for each zone.

Parameters:
  • tci (SACSnowTCI (DataFrame)) – Custom type alias for total channel inflow from SacSnow (units: mm).

  • return_inst (bool) – Specifies to return instantaneous streamflow, rather than period mean flow. Default: True.

Returns:

A DataFrame containing streamflow with a column for each zone (units: cfs).

Return type:

pd.DataFrame

return_uh(tstep)[source]

Return unit hydrograph ordinates for each zone (units: cfs/in).

Parameters:

tstep (int) – Specifies timestep of unit hydrograph (units: hours). Fractional hours are not supported and will be rounded.

Returns:

A DataFrame containing unit hydrograph (uh) with a column for each zone (units: cfs/in). Trailing zero ordinates are omitted; leading zeros are preserved. Shorter zone hydrographs are padded with NaN.

Return type:

pd.DataFrame

property uh: DataFrame

Generates a unit hydrograph as a DataFrame at a timestep specified by the dt_hours attribute (units - cfs/in).

class nwsrfs_py.nwsrfs.SacSnow(pars_dataclass, validate=True)[source]

Bases: object

Class to run the NWSRFS SAC-SMA and SNOW-17 models via F2PY bindings. Multiple SAC-SMA and SNOW-17 parameter sets can be run simultaneously.

Parameters:
  • pars_dataclass (SacSnowPars) – Dataclass which contains all inputs to run SAC-SMA and SNOW-17.

  • validate (bool) – Validate SacSnowPars dataclass inputs are correct format/type. Default: True.

sacsnow_pars

Dataclass which contains all inputs to run SAC-SMA and SNOW-17.

Type:

SacSnowPars

property sacsnow_states: dict[str, DataFrame]

Returns a dictionary of DataFrames containing all model states with a column for each zone.

The dictionary keys are:

  • tci: Total channel inflow (units: mm).

  • map_pxadj: Precipitation after pxadj applied (units: mm).

  • etd_peadj: Evaporation demand after peadj, efc, and aesc adjustments applied (units: mm).

  • aet: Actual evapotranspiration (units: mm).

  • uztwc: Upper zone tension water contents (units: mm).

  • uzfwc: Upper zone free water contents (units: mm).

  • lztwc: Lower zone tension water contents (units: mm).

  • lzfsc: Lower zone free supplemental water contents (units: mm).

  • lzfpc: Lower zone free primary water contents (units: mm).

  • adimc: Additional impervious area water contents (units: mm).

  • roimp: Impervious runoff prior to riparian vegetation adjustment (units: mm).

  • sdro: Direct runoff prior to riparian vegetation adjustment (units: mm).

  • ssur: Surface runoff prior to riparian vegetation adjustment (units: mm).

  • sif: Interflow prior to riparian vegetation adjustment (units: mm).

  • bfs: Baseflow supplemental runoff prior to riparian vegetation adjustment (units: mm).

  • bfp: Baseflow primary runoff prior to riparian vegetation adjustment (units: mm).

  • swe: Snow water equivalent (units: mm).

  • aesc: Areal extent of snow cover (units: fraction 0-1).

  • neghs: Snowpack heat deficit (units: mm).

  • liqw: Liquid water held by snow against gravity drainage (units: mm).

  • raim: Total rain plus snowmelt (units: mm).

  • psfall: Precipitation falling as snow after scf adjustment has been applied (units: mm).

  • prain: Precipitation falling as rain (units: mm).

property sacsnow_tci: SACSnowTCI

Generates total channel inflow (tci) as a DataFrame with a column for each zone (units - mm).

class nwsrfs_py.nwsrfs.Lagk(pars_dataclass, validate=True)[source]

Bases: object

Class to run the NWSRFS Lag-K models via F2PY bindings. Multiple upstream routes can be run simultaneously.

Parameters:
  • pars_dataclass (LagkPars) – Dataclass which contains all inputs to run Lag-K.

  • validate (bool) – Validate LagkPars dataclass inputs are correct format/type. Default: True.

lagk_pars

Dataclass which contains all inputs to run Lag-K.

Type:

LagkPars

property lagk_route: DataFrame

Generates routed flows as a DataFrame with a column for each upstream reach (units - cfs).

property lagk_states: dict[str, DataFrame]

Generates a dictionary of DataFrames containing all model states with a column for each upstream reach.

The dictionary keys are:

  • routed: Routed flow with lag and k applied (units: cfs).

  • lag_time: Lag applied to upstream flow (units: hours).

  • k_inflow: upstreamflow with only lag applied (units: cfs).

  • k_storage: Attenuation storage (units: cfs).

class nwsrfs_py.nwsrfs.Chanloss(pars_dataclass, validate=True)[source]

Bases: object

Class to run the NWSRFS CHANLOSS model via F2PY bindings.

Parameters:
  • pars_dataclass (ChanlossPars) – Dataclass which contains all inputs to run CHANLOSS.

  • validate (bool) – Validate ChanlossPars dataclass inputs are correct format/type. Default: True.

chanloss_pars

Dataclass which contains all inputs to run CHANLOSS.

Type:

ChanlossPars

property chanloss_qadj: Series

Generates a Series of streamflow with CHANLOSS adjustments applied (units - cfs).

class nwsrfs_py.nwsrfs.FA(map_dataclass, mat_dataclass, ptps_dataclass, pet_dataclass, validate=True)[source]

Bases: object

Class to apply monthly climatological forcing adjustments (FA) to forcings via F2PY bindings.

Note

For subdaily records starting after midnight, initial PET and evaporation demand are backfilled from the first midnight’s values for each zone. This approximates the initial partial day using the following day’s values. If no midnight occurs in the record, the initial zero values are retained.

Parameters:
  • map_dataclass (FAPars) – Dataclass containing inputs for precipitation adjustments.

  • mat_dataclass (FAPars) – Dataclass containing inputs for temperature adjustments.

  • ptps_dataclass (FAPars) – Dataclass containing inputs for precipitation typing adjustments.

  • pet_dataclass (FAPars) – Dataclass containing inputs for potential evaporation adjustments.

  • validate (bool) – Validate that map, mat, ptps, and pet FAPars dataclass inputs are correct format/type. Default: True.

fa_pars

Dictionary of dataclasses representing 'map', 'mat', 'ptps', and 'pet' parameters.

Type:

dict[str, FAPars]

property fa_factors: DataFrame

Generates a DataFrame of monthly adjustment factors (index 1-12).

The columns correspond to:

  • map_fac: Monthly precipitation adjustment factors (units: NA)

  • mat_fac: Monthly temperature adjustment shifts (units: degc)

  • pet_fac: Monthly potential evaporation adjustment factors (units: NA)

  • ptps_fac: Monthly precip-as-snow adjustment factors (units: NA)

property forcings: dict[str, DataFrame]

Generates a dictionary of adjusted forcings as DataFrames.

The dictionary keys are:

  • map_fa: Precipitation (units: mm)

  • mat_fa: Air temperature (units: degc)

  • ptps_fa: Fraction of precipitation as snow (units: fraction 0-1)

  • pet_fa: Potential evaporation (units: mm)

  • etd_fa: Evaporation demand (units: mm)

property forcings_climo: DataFrame

12-month climatology values as DataFrame (index 1-12).

The columns correspond to:

  • map_climo: Monthly precipitation climatology (units: mm/month total)

  • mat_climo: Monthly temperature climatology (units: degc monthly avg)

  • pet_climo: Monthly potential evaporation climatology (units: mm/month)

  • ptps_climo: Monthly precip-as-snow climatology (units: fraction 0-1 monthly avg)

class nwsrfs_py.nwsrfs.Consuse(pars_dataclass, validate=True)[source]

Bases: object

Runs the NWSRFS CONS_USE model via F2PY bindings. Only a single CONS_USE zone can be ran at a time. Timestep is daily average.

Parameters:
  • pars_dataclass (ConsusePars) – Dataclass which contains all inputs to run CONS_USE.

  • validate (bool) – Validate ConsusePars dataclass inputs are correct format/type. Default: True.

consuse_pars

Dataclass which contains all inputs to run CONS_USE.

Type:

ConsusePars

property consuse_qadj: Series

Generates a Series of daily mean streamflow with consumptive use adjustments applied (units - cfsd).

property consuse_states: DataFrame

Generates a DataFrame with a column for each CONS_USE model states.

The column states are:

  • qadj: Streamflow with all consumptive use adjustments applied (units: cfsd)

  • qdiv: Flow diverted for consumptive use (units: cfsd)

  • qrf_in: Return flow from irrigation area used as input to return flow storage (units:cfsd)

  • qrf_out: Return flow to channel from return flow storage (units: cfsd)

  • qol: Diverted flow other losses [eg transport, subsurface] (units: cfsd)

  • qcd: Crop flow demand (units: cfsd)

  • ce: Crop evapotranspiration demand (units: mm)

  • rfstor: Return flow storage depth at the start of each daily timestep, before that day’s return flow inflow and outflow (units: mm).

class nwsrfs_py.nwsrfs.RSnwElev(pars_dataclass, validate=True)[source]

Bases: object

Class to run the NWSRFS RSNWELEV model via F2PY bindings.

Parameters:
  • pars_dataclass (RSnwElevPars) – Dataclass which contains all inputs to run RSNWELEV.

  • validate (bool) – Validate RSnwElevPars dataclass inputs are correct format/type. Default: True.

rsnwelev_pars

Dataclass which contains all inputs to run RSNWELEV.

Type:

RSnwElevPars

property forcing_ptps: DataFrame

Generates ptps (precipitation typing) as a DataFrame with a column for each zone (units - fraction 0-1).