Unexpectedly high RMSE from grid_stat for wind fields vs temperature fields #3252
-
|
Verifying some GRIB model output with First, the forecast fields are shape So, I suppose that in my I did a manual RMSE calculation in the Python REPL with The But the I'm guessing there's something fundamental that I'm ignorant of here. Any ideas? Again, I'm happy to provide a reproducer if it would be helpful. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 2 replies
-
|
Thank you for your question, And I think we should dive a bit deeper into the problem you're experiencing. In order to do that, we will need to be able to recreate the issue on our systems. Given that you have already benchmarked some data, please provide those same datasets, along with the configuration set up and any relevant commands to run the setup that is producing these unexpected RMSE values, and we can starting digging into where the problem might be. Here is a link on how to submit data to us. Additionally, please be aware that several of our troubleshooting engineers are on leave this week, which may result in a slower response to this issue. But rest assured we will look into this and get back to you with updates or additional questions if we have any. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @j-opatz. The file is too large for either of the suggested methods, but please try this link. I was able to download it in a Chrome Incognito window, so I think it should be freely downloadable. After expanding the |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Hi Paul, I wanted to provide a second update on this, as the lead MET programmer has had some time to examine your test data and draw some conclusions. Note that in his tests he used the P500 values, rather than the P800 values you and I had been examining. However, the conclusion he arrived at is valid for all U and V components. He ran wgrib2 to extract UGRD and VGRD at P500, and then did the same but added When those outputs were complete, he ran both through Grid-Stat and looked at the difference fields in the netCDF output. What he saw seems to provide an explanation for why the RMSE from MET is different than the RMSE directly from the grib2 files using cfgrib and Xarray: when MET reads UGRD and VGRD from GRIB1 or GRIB2 files, it automatically checks the metadata and, if needed, rotates the winds from grid-relative to earth-relative. This rotation is NOT applied if the metadata does not indicate a grid-relative or earth-relative setting. So while you would see this log message at You would NOT see that message for your observation fields. This difference between forecast rotation and observation non-rotation is the most likely culprit for why I was seeing differences between the Regrid-Data-Plane field values for the HRRR data and the HRRR netCDF output from cfgrib. And as you can assume, these field value differences will definitely affect the statistical output like RMSE. Unfortunately, there's not many options at the moment to get around this wind component rotation issue in MET. The best method would be to utilize Python Embedding to pass in your forecast HRRR files to Grid-Stat, avoiding any rotations. This should provide the more realistic comparison (and smaller RMSE). However, I do have good news; there's an existing MET issue that seeks to expand on support for wind direction, including an ability to toggle the usage of wind rotation between grid- and earth-relative. I've made a note of this Discussion in that issue, so when work resumes on it we can ensure this situation can be addressed. Please let me know if there are any additional questions or issues on this topic. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @j-opatz for this careful analysis! I'm going to look again at the data, but am I correctly understanding that the forecast (not obs) GRIB data in this case is providing metadata indicating either grid-relative or earth-relative orientation and that, based on that, MET is performing a rotation? And is the issue that the metadata is incorrect, and that a solution might be to correct it? Or maybe a solution would be to remove this piece of metadata? I am in contact with the producers of the forecast GRIB data, so could work with them on correcting the GRIB data at generation time if that's the root cause of the issue here. If correcting the forecast GRIB data is not a solution, would extracting the grid from the forecast GRIB and writing it as netCDF and having MET work from the netCDF potentially also solve the problem? Running |
Beta Was this translation helpful? Give feedback.
-
|
I'm looking at the data with ecCodes' consulting GRIB docs, and if I'm reading the bits in the right direction (bit 1 on the left, bit 8 on the right), and seeing bit 5 as
i.e. grid-relative. If so, it seems that -- if the metadata isn't lying -- both grids are oriented the same way, so is MET rotating only the forecast grid and not the obs grid? You mentioned the
Does that only mean that no message is logged for rotated observation fields, or that rotation is not performed for observation fields? Also, in re:
The bit has to be 1 (grid-relative) or 0 (earth-relative) so one or the other is indicated -- unless this section is optional and simply omitted for some grids. I guess there's no difference between grid-relative and earth-relative for lat/lon grids. In any case, for this grid type, not indicating grid-relative vs earth-relative in order to prevent MET from doing rotation might not be an option. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for doing a bit of digging on your end, I think there's a few things that we can clear up, and some that I will need to defer to @JohnHalleyGotway for interpretation of the logic MET is using. I can confirm that when I ran the UGRD data through Grid-Stat, only the forecast has the rotational correction applied; the observation field does not. The log statements will only be printed when an action triggering them occurs, so I was seeing for the forecast's UGRD (so it was applying a rotation), but that log message did NOT appear for the observation's UGRD, so it is not being rotated. So any resulting comparison is not logically sound. The reason for this inconsistent rotation logic is due to the contents of your observation file: you only have the UGRD component, so MET does not apply the rotational logic. When both the U and V components are available in a GRIB1 or GRIB2 formatted file, it applies the rotational correction. John HG will need to provide an answer as to why both components are necessary inside the file. All of this actually provides a few non-Python solutions for the time being: you could make sure that both the forecast and observation files have the same number of U and V components. So in the case where both the forecast and observation files have U and V components, MET should rotate both fields; if they only have the U components, MET should not apply any rotation logic. Again, run the Grid-Stat tool at You could also use netCDF inputs rather than GRIB2 format; MET does not apply any rotational logic to wind components inside netCDF files due to their non-standard formatting. |
Beta Was this translation helpful? Give feedback.
-
|
Very interesting that the behavior depends on whether both
This seems like the best immediate fix for my use case. I'll start looking into that. |
Beta Was this translation helpful? Give feedback.
-
|
I think I see now why |
Beta Was this translation helpful? Give feedback.


Thank you for doing a bit of digging on your end,
I think there's a few things that we can clear up, and some that I will need to defer to @JohnHalleyGotway for interpretation of the logic MET is using.
I can confirm that when I ran the UGRD data through Grid-Stat, only the forecast has the rotational correction applied; the observation field does not. The log statements will only be printed when an action triggering them occurs, so I was seeing
for the forecast's UGRD (so it was applying a rotation), but that log message did NOT appear for the observation's UGRD, so it is not being rotated. So any resulting …