Flow Normalization¶
Daily concentration/flux estimation and flow normalization: interpolates surfaces onto the daily record and averages over the historical discharge distribution.
wrtds.flow_norm
¶
Daily estimation and flow normalization for WRTDS.
estimate_daily(daily, surfaces, surface_index)
¶
Interpolate concentration and flux from the surfaces grid for each day.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
daily
|
Populated daily DataFrame (must have |
required | |
surfaces
|
3-D surfaces array |
required | |
surface_index
|
Grid parameters from :func: |
required |
Returns:
| Type | Description |
|---|---|
|
Daily DataFrame with added columns: |
Source code in wrtds/flow_norm.py
bin_qs(daily)
¶
Group historical log-discharge values by day-of-year.
Leap-day handling: Feb 29 (day 60 in leap years) is merged into Feb 28 (day 59) so that every bin key is in 1..365.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
daily
|
Populated daily DataFrame (must have |
required |
Returns:
| Type | Description |
|---|---|
|
Dict mapping |
Source code in wrtds/flow_norm.py
flow_normalize(daily, surfaces, surface_index, q_bins)
¶
Compute flow-normalised concentration and flux for each day.
For every day t, the model's predicted concentration is averaged across the full historical discharge distribution for that calendar day, removing the effect of year-to-year flow variability.
Uses a single vectorised interpolation call for performance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
daily
|
Populated daily DataFrame (must have |
required | |
surfaces
|
3-D surfaces array. |
required | |
surface_index
|
Grid parameters dict. |
required | |
q_bins
|
Output of :func: |
required |
Returns:
| Type | Description |
|---|---|
|
Daily DataFrame with added columns: |
Source code in wrtds/flow_norm.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |