Conversation
…) and using regression with Vmax (instead of Vmax**2) when R34 is unknown
…ney and Knaff Pc fill method
|
@SorooshMani-NOAA @pvelissariou1 Takis, I made some changes and added this test to compare our filling results to yours for the Chavas et al. (2025) and Courtney and Knaff (2009) methods. What I found is:
Could you run this test ( |
|
@WPringle I just checked out your branch and ran the test, it fails for Chavas as well for me: > pytest -k pcfill
.
.
.
============================================ FAILURES ============================================
__________________________________________ test_pcfill ___________________________________________
def test_pcfill():
input_directory = INPUT_DIRECTORY / "test_pcfill"
output_directory = OUTPUT_DIRECTORY / "test_pcfill"
reference_directory = REFERENCE_DIRECTORY / "test_pcfill"
if not output_directory.exists():
output_directory.mkdir(parents=True, exist_ok=True)
for input_filename in input_directory.iterdir():
track_o = VortexTrack.from_file(input_directory / input_filename.name)
data = track_o.data.copy()
# Usee the chavas (2025) regression method to guess pressure
data["central_pressure"] = chavas_2025_Pc(data)
track_c = VortexTrack(data)
track_c.to_file(
output_directory / f"{input_filename.name[:-4]}_chavas.dat", overwrite=True
)
track_cr = VortexTrack.from_file(
reference_directory / f"{input_filename.name[:-4]}_chavas.dat"
)
diff = abs(track_c.data.central_pressure - track_cr.data.central_pressure)
> assert (
diff < 2
).all(), f"{input_filename.name[:-4]}_chavas.dat different to reference"
E AssertionError: barry2019-bdeck_chavas.dat different to reference
E assert np.False_
E + where np.False_ = all()
E + where all = 0 1.430000\n1 1.430000\n2 1.430000\n3 0.024655\n4 0.024655\n5 0.034500\n6 0.176303\n7 0.49438...30000\n30 1.430000\n31 1.430000\n3
2 1.430000\n33 1.430000\n34 1.430000\nName: central_pressure, dtype: float64 < 2.all
tests/test_pcfill.py:47: AssertionError
.
.
.
==================================== short test summary info =====================================
FAILED tests/test_pcfill.py::test_pcfill - AssertionError: barry2019-bdeck_chavas.dat different to reference
========================= 1 failed, 49 deselected, 12 warnings in 1.96s ==========================Do you see the same failure?! Locally my failure is from Barry, but it seems on CI the failure is from Irma for Chavas: I'm not sure if this is a order inconsistency or some other inconsistency to cause different failure storms. You don't get any Chavas failures at all on your local machine? |
|
@WPringle , William when you say that "For Chavas (and Courtney?) results they are the same (within 1 kt) of each other" how you compare the generated wind fields? |
|
@pvelissariou1 Sorry I mistype, I mean central pressures are within 1 hPa of each other. |
|
@pvelissariou1 @WPringle Yes, the tests should fail because the central pressures in the reference files (one provided by Takis) are not exactly the same. I just want to have the values double-checked to make sure ours is reasonable in the Courtney predictions where I see larger differences. Following that I will update tests to provide our own reference files |
|
@WPringle one quick question ... was the default method (before Chavas and CK) persistent value or was it persistent based on Holland formulation? I remember @pvelissariou1 had multiple Holland B methods in his tests. |
|
@pvelissariou1 this is the PR for the implementation https://github.com/oceanmodeling/StormEvents/pull/117/changes and these are the specific lines for the implementation of the equations: StormEvents/stormevents/nhc/track.py Lines 1259 to 1345 in 04bc119 |
|
@WPringle , @SorooshMani-NOAA : William the code for Courtney and Chavas functions is exactly what I have as well. No issue here. |
|
We will use Courtney+Knaff approach then. |
|
Thanks @pvelissariou1 sure we can use C-K. It's good news that the equations look fine. We still have to figure out what is causing our resulting filled track to be different from your filled tracks |
|
@SorooshMani-NOAA OK based on Takis's agreeing that code implementation is same, I'll update tests with new reference files and make this into full PR. |
I'm still concerned about differences between StormEvents track results with PaHM filled tracks. |
|
@SorooshMani-NOAA In what way? There are only two potential issues that can be addressed:
|
@pvelissariou1 In this case, could you send an example track with the |
Persistent based on Holland B method. This can only be applied to forecasts, so it can't actually be used to re-fill in deltaP in best track files. |
|
@WPringle the "the pc filling in PaHM available in your source code on github" is not yet available in PaHM/Github In PaHM, I don't write out storm's translation speed for the Holland model but I do write the speed for the GAHM model, go figure, need to fix this. PaHM's output sandy/GAHM intermediate (modified) track file is here: These files are produced anytime you run PaHM using the GAHM model. |
OK, we also use backward differences for speed which is why I am guessing we did get same results more or less for Chavas method. I think our method could be improved by just computing "gradients", which can be central differences except at the edges where forward and backward differences can be used. |
|
@WPringle I'm not as much involved in the details of what's going on like you and @pvelissariou1. If you believe the small differences are explainable but rounding errors, and since equations are calculated correctly, I'm fine with updating test refs and merging. Maybe let's test the central diff as well to see if it impacts anything, then update the refs and we'll merge the PR. Thank you! |
|
@WPringle are you using best tracks from @pvelissariou1 file set or are you getting new one online. Make sure we have the best track from the same file set if we're not for comparison. |
|
@SorooshMani-NOAA It uses tracks provided in |
|
@SorooshMani-NOAA Does the |
OK, my main concern was maybe we were using a different best track than Takis, since you uploaded the same best track there at least that's not the reason behind the difference. Did you say that you see larger than 1 or 2 hPa differences in soem cases? |
Let me try on my side as well. |
|
@WPringle the issue with that test seems to be due to the change in when we do -- a/stormevents/nhc/track.py
+++ b/stormevents/nhc/track.py
@@ -641,7 +641,7 @@ class VortexTrack:
)
# forward fill here first before integer replacement
- atcf["background_pressure"] = atcf["background_pressure"].ffill()
+# atcf["background_pressure"] = atcf["background_pressure"].ffill()
float_columns = atcf.select_dtypes(include=["float"]).columns
integer_na_value = -99999
for column in float_columns:
@@ -694,7 +694,7 @@ class VortexTrack:
atcf["isotach_radius_for_NWQ"].astype("string").str.pad(5)
)
- atcf["background_pressure"] = atcf["background_pressure"].astype(int)
+ atcf["background_pressure"] = atcf["background_pressure"].ffill().astype(int)
atcf["central_pressure"] = atcf["central_pressure"].astype(int)
press_cond_nobg = ~atcf["central_pressure"].isna() & (Here is the old (current reference files) vs new (without reverting like above) values: --- old_ref
+++ new_values
@@ -61,18 +61,18 @@ AL, 09, 2008090706, , BEST, 0, 211N, 716W, 115, 947, HU, 64, NEQ, 40,
AL, 09, 2008090712, , BEST, 0, 210N, 728W, 110, 947, HU, 34, NEQ, 140, 120, 100, 125, 1012, 200, 15, 140, 0, L, 0, , 265, 11, IKE, 26
AL, 09, 2008090712, , BEST, 0, 210N, 728W, 110, 947, HU, 50, NEQ, 90, 75, 50, 75, 1012, 200, 15, 140, 0, L, 0, , 265, 11, IKE, 26
AL, 09, 2008090712, , BEST, 0, 210N, 728W, 110, 947, HU, 64, NEQ, 50, 40, 30, 50, 1012, 200, 15, 140, 0, L, 0, , 265, 11, IKE, 26
-AL, 09, 2008090713, , BEST, 0, 210N, 732W, 110, 947, HU, 34, NEQ, 140, 120, 100, 125, 1013,,,,,,,, 270, 22,, 27
-AL, 09, 2008090713, , BEST, 0, 210N, 732W, 110, 947, HU, 50, NEQ, 90, 75, 50, 75, 1013,,,,,,,, 270, 22,, 27
-AL, 09, 2008090713, , BEST, 0, 210N, 732W, 110, 947, HU, 64, NEQ, 50, 40, 30, 50, 1013,,,,,,,, 270, 22,, 27
+AL, 09, 2008090713, , BEST, 0, 210N, 732W, 110, 947, HU, 34, NEQ, 140, 120, 100, 125, 1012,,,,,,,, 270, 22,, 27
+AL, 09, 2008090713, , BEST, 0, 210N, 732W, 110, 947, HU, 50, NEQ, 90, 75, 50, 75, 1012,,,,,,,, 270, 22,, 27
+AL, 09, 2008090713, , BEST, 0, 210N, 732W, 110, 947, HU, 64, NEQ, 50, 40, 30, 50, 1012,,,,,,,, 270, 22,, 27
AL, 09, 2008090718, , BEST, 0, 210N, 740W, 105, 946, HU, 34, NEQ, 145, 125, 100, 125, 1012, 200, 15, 130, 0, L, 0, , 270, 9, IKE, 28
AL, 09, 2008090718, , BEST, 0, 210N, 740W, 105, 946, HU, 50, NEQ, 90, 90, 50, 75, 1012, 200, 15, 130, 0, L, 0, , 270, 9, IKE, 28
AL, 09, 2008090718, , BEST, 0, 210N, 740W, 105, 946, HU, 64, NEQ, 50, 40, 30, 50, 1012, 200, 15, 130, 0, L, 0, , 270, 9, IKE, 28
AL, 09, 2008090800, , BEST, 0, 211N, 752W, 115, 945, HU, 34, NEQ, 150, 140, 100, 125, 1009, 200, 15, 130, 0, L, 0, , 275, 11, IKE, 29
AL, 09, 2008090800, , BEST, 0, 211N, 752W, 115, 945, HU, 50, NEQ, 90, 105, 50, 75, 1009, 200, 15, 130, 0, L, 0, , 275, 11, IKE, 29
AL, 09, 2008090800, , BEST, 0, 211N, 752W, 115, 945, HU, 64, NEQ, 50, 40, 30, 50, 1009, 200, 15, 130, 0, L, 0, , 275, 11, IKE, 29
-AL, 09, 2008090802, , BEST, 0, 211N, 757W, 115, 945, HU, 34, NEQ, 150, 140, 100, 125, 1013,,,,,,,, 270, 14,, 30
-AL, 09, 2008090802, , BEST, 0, 211N, 757W, 115, 945, HU, 50, NEQ, 90, 105, 50, 75, 1013,,,,,,,, 270, 14,, 30
-AL, 09, 2008090802, , BEST, 0, 211N, 757W, 115, 945, HU, 64, NEQ, 50, 40, 30, 50, 1013,,,,,,,, 270, 14,, 30
+AL, 09, 2008090802, , BEST, 0, 211N, 757W, 115, 945, HU, 34, NEQ, 150, 140, 100, 125, 1009,,,,,,,, 270, 14,, 30
+AL, 09, 2008090802, , BEST, 0, 211N, 757W, 115, 945, HU, 50, NEQ, 90, 105, 50, 75, 1009,,,,,,,, 270, 14,, 30
+AL, 09, 2008090802, , BEST, 0, 211N, 757W, 115, 945, HU, 64, NEQ, 50, 40, 30, 50, 1009,,,,,,,, 270, 14,, 30
AL, 09, 2008090806, , BEST, 0, 211N, 765W, 100, 950, HU, 34, NEQ, 155, 175, 100, 125, 1010, 200, 15, 120, 0, L, 0, , 270, 11, IKE, 31
AL, 09, 2008090806, , BEST, 0, 211N, 765W, 100, 950, HU, 50, NEQ, 90, 120, 50, 75, 1010, 200, 15, 120, 0, L, 0, , 270, 11, IKE, 31
AL, 09, 2008090806, , BEST, 0, 211N, 765W, 100, 950, HU, 64, NEQ, 50, 40, 30, 50, 1010, 200, 15, 120, 0, L, 0, , 270, 11, IKE, 31
@@ -91,9 +91,9 @@ AL, 09, 2008090906, , BEST, 0, 220N, 814W, 70, 965, HU, 64, NEQ, 30,
AL, 09, 2008090912, , BEST, 0, 224N, 824W, 70, 965, HU, 34, NEQ, 155, 155, 100, 170, 1008, 275, 15, 85, 0, L, 0, , 293, 10, IKE, 36
AL, 09, 2008090912, , BEST, 0, 224N, 824W, 70, 965, HU, 50, NEQ, 90, 75, 30, 90, 1008, 275, 15, 85, 0, L, 0, , 293, 10, IKE, 36
AL, 09, 2008090912, , BEST, 0, 224N, 824W, 70, 965, HU, 64, NEQ, 30, 0, 0, 30, 1008, 275, 15, 85, 0, L, 0, , 293, 10, IKE, 36
-AL, 09, 2008090914, , BEST, 0, 226N, 829W, 70, 965, HU, 34, NEQ, 155, 155, 100, 170, 1013,,,,,,,, 293, 15,, 37
-AL, 09, 2008090914, , BEST, 0, 226N, 829W, 70, 965, HU, 50, NEQ, 90, 75, 30, 90, 1013,,,,,,,, 293, 15,, 37
-AL, 09, 2008090914, , BEST, 0, 226N, 829W, 70, 965, HU, 64, NEQ, 30, 0, 0, 30, 1013,,,,,,,, 293, 15,, 37
+AL, 09, 2008090914, , BEST, 0, 226N, 829W, 70, 965, HU, 34, NEQ, 155, 155, 100, 170, 1008,,,,,,,, 293, 15,, 37
+AL, 09, 2008090914, , BEST, 0, 226N, 829W, 70, 965, HU, 50, NEQ, 90, 75, 30, 90, 1008,,,,,,,, 293, 15,, 37
+AL, 09, 2008090914, , BEST, 0, 226N, 829W, 70, 965, HU, 64, NEQ, 30, 0, 0, 30, 1008,,,,,,,, 293, 15,, 37
AL, 09, 2008090918, , BEST, 0, 227N, 833W, 65, 966, HU, 34, NEQ, 155, 150, 105, 170, 1008, 275, 15, 80, 0, L, 0, , 285, 6, IKE, 38
AL, 09, 2008090918, , BEST, 0, 227N, 833W, 65, 966, HU, 50, NEQ, 100, 75, 30, 90, 1008, 275, 15, 80, 0, L, 0, , 285, 6, IKE, 38
AL, 09, 2008090918, , BEST, 0, 227N, 833W, 65, 966, HU, 64, NEQ, 20, 0, 0, 30, 1008, 275, 15, 80, 0, L, 0, , 285, 6, IKE, 38
@@ -139,9 +139,9 @@ AL, 09, 2008091300, , BEST, 0, 283N, 940W, 95, 952, HU, 64, NEQ, 110,
AL, 09, 2008091306, , BEST, 0, 291N, 946W, 95, 951, HU, 34, NEQ, 225, 200, 125, 125, 1007, 325, 30, 115, 0, L, 0, , 327, 10, IKE, 52
AL, 09, 2008091306, , BEST, 0, 291N, 946W, 95, 951, HU, 50, NEQ, 150, 160, 80, 75, 1007, 325, 30, 115, 0, L, 0, , 327, 10, IKE, 52
AL, 09, 2008091306, , BEST, 0, 291N, 946W, 95, 951, HU, 64, NEQ, 110, 90, 55, 45, 1007, 325, 30, 115, 0, L, 0, , 327, 10, IKE, 52
-AL, 09, 2008091307, , BEST, 0, 293N, 947W, 95, 950, HU, 34, NEQ, 225, 200, 125, 125, 1013,,,,,,,, 336, 13,, 53
-AL, 09, 2008091307, , BEST, 0, 293N, 947W, 95, 950, HU, 50, NEQ, 150, 160, 80, 75, 1013,,,,,,,, 336, 13,, 53
-AL, 09, 2008091307, , BEST, 0, 293N, 947W, 95, 950, HU, 64, NEQ, 110, 90, 55, 45, 1013,,,,,,,, 336, 13,, 53
+AL, 09, 2008091307, , BEST, 0, 293N, 947W, 95, 950, HU, 34, NEQ, 225, 200, 125, 125, 1007,,,,,,,, 336, 13,, 53
+AL, 09, 2008091307, , BEST, 0, 293N, 947W, 95, 950, HU, 50, NEQ, 150, 160, 80, 75, 1007,,,,,,,, 336, 13,, 53 |
|
@SorooshMani-NOAA Thanks! I'll update the reference |
…und pressure filling fix
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #119 +/- ##
==========================================
+ Coverage 91.88% 92.02% +0.13%
==========================================
Files 19 20 +1
Lines 2170 2208 +38
==========================================
+ Hits 1994 2032 +38
Misses 176 176 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@SorooshMani-NOAA Seems like good for merging now |
|
So just to make sure we're on the same page, the issues addressed here was:
@WPringle can you confirm these two (or correct them) before I merge? |
|
@SorooshMani-NOAA I added the issues addressed at the top. |
Follow up to the implementation in #117
Fixes #118
Issues addressed:
courtney_knaffpressure filling method to ensureVsrmis no less than 25 kt.chavasrelation (instead of quadratic) for when R34 is not present. Correction to ensureVmaxis no less than 25 m/s. This matches Takis's results.