-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
using the Psurge v2.9 regression method for filling in Rmax in OFCL a…
…dvisories (#96) * adding complete method for rmax forecast regression without smoothing or limiting * reformatting back to black * adding the upper and lower bounds for RMW forecast * changing upper bound to be larger of 120.0 nmi or rmw0 * changing sorting of advisories by index to avoid out of order isotach_radius * adding 3-pt rolling mean for the rmax forecasts * finalizing the smoothing which interpolates to 12-hr intervals where required and then computes a 24-hr moving mean * preserving 34-kt isotach for lead times > 72-hrs if Vmax still above 34-kt * adding changes to the forecasts where the isotachs are correctly ordered and filling in RMW using regression technique from NHC * adding changes to the OFCL deck for RMW regression * ensuring presence of rads * initialize rads * Update test configuration * Remove python 3.12 from test matrix * Quick-test on lowser supported python * Try test without multiworker * Fixing python version for quicktest * Use py3.10 instead of min for coverage test * adding RMW regression coefficients into const.py and making a test for the retrieval function * switching to keep 50-kt radius as well as 34-kt * modified OFCL RMW forecast tests preserving the 50-kt isotach as well as 34-kt --------- Co-authored-by: SorooshMani-NOAA <[email protected]>
- Loading branch information
1 parent
e9e1ae2
commit ee51dd1
Showing
10 changed files
with
6,021 additions
and
5,897 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from numpy import isnan, array, argwhere | ||
|
||
# Regression coefficients for the Rmax forecast | ||
# ref: Penny et al. (2023). https://doi.org/10.1175/WAF-D-22-0209.1 | ||
fhrs = [12, 24, 36, 48, 72, 96, 120] | ||
RMW_regression_coefs = { | ||
3: [ # a0 #a1 #a2 #a3 #a4 #a5 #a6 | ||
[3.1894, 0.3524, 0.1208, -0.1091, 0.5862, -0.8070, 0.0057], | ||
[4.4373, 0.1473, 0.1045, -0.1112, 0.7566, -1.0689, 0.0061], | ||
[4.9447, 0.0784, 0.1168, -0.1448, 0.8246, -1.1709, 0.0059], | ||
[5.1818, 0.0549, 0.1335, -0.2345, 0.8972, -1.2038, 0.0063], | ||
], | ||
2: [ # a0 #a1 #a2 #a3 #a5 #a6 | ||
[3.1131, 0.3680, 0.1589, 0.4710, -0.9111, 0.0068], | ||
[4.1567, 0.1834, 0.2085, 0.5873, -1.1841, 0.0073], | ||
[4.6694, 0.1062, 0.2330, 0.6295, -1.3122, 0.0074], | ||
[4.9434, 0.0459, 0.3027, 0.5828, -1.3675, 0.0079], | ||
[4.7906, 0.0157, 0.3953, 0.5321, -1.3617, 0.0067], | ||
], | ||
1: [ # a0 #a1 #a2 #a5 #a6 | ||
[2.6272, 0.4230, 0.6320, -0.9117, 0.0064], | ||
[3.6525, 0.2142, 0.8222, -1.2158, 0.0082], | ||
[4.2822, 0.0884, 0.9059, -1.3656, 0.0091], | ||
[4.7700, -0.0042, 0.9225, -1.4349, 0.0102], | ||
[4.7307, -0.0365, 0.9153, -1.3882, 0.0086], | ||
], | ||
0: [ # a0 #a1 #a5 #a6 | ||
[2.1633, 0.6360, -0.3314, 0.0154], | ||
[3.7884, 0.3953, -0.5738, 0.0219], | ||
[5.0213, 0.1999, -0.7481, 0.0276], | ||
[5.8092, 0.0615, -0.8508, 0.0318], | ||
[6.3321, -0.0362, -0.9079, 0.0343], | ||
[6.6181, 0.0041, -0.9599, 0.0295], | ||
[6.7073, -0.0028, -0.9478, 0.0257], | ||
], | ||
} | ||
|
||
|
||
def get_RMW_regression_coefs(fcst_hr, radii_values): | ||
num_radii_available = (~isnan(radii_values)).sum() | ||
coefs_by_radii_available = array(RMW_regression_coefs[num_radii_available]) | ||
fcst_index = argwhere(fhrs == fcst_hr) | ||
if fcst_index.size == 0 or fcst_index > coefs_by_radii_available.shape[0] - 1: | ||
return coefs_by_radii_available[-1].flatten() | ||
else: | ||
return coefs_by_radii_available[fcst_index].flatten() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.