-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in the autoregridding of masking regions. #1163
Comments
I tested this by running Grid-Stat to compare a GFS file to itself on NCEP Grid 4 with masks defined by "NAO.poly" and "NAO_mask.nc" (on Grid 104). I ran met-7.0 and met-8.1: setenv VERSION 7.0 // or 8.1 met-7.0 with NAO poly = 4610 pairs I checked the NetCDF matched pairs files and found that they are identical. The NAO_poly output includes only the northern Atlantic data. But the NOA mask data includes that AND all points of Grid 4 outside of Grid 104. So this symptom of the bug exists in both met-7.0 and met-8.1. |
This bug was introduced when switching to boolean MaskPlane objects instead of floating point DataPlane objects. In the DataPlane::mask_plane() member function, we fail to check for bad data. So values of -9999 are stored as a boolean value of TRUE, when they should be FALSE. The reason that the NetCDF matched pairs file has so many points turned on for the NAO mask is found in the met_regrid_generic() function, which fails to initialize the output to bad data values. We could easily do that, but I worry about unintended consequences because this code is called by many, many MET tools... |
The one line change in DataPlane::mask_plane() to check for bad data values fixed both of the issues listed above. The number of matched pairs now matches met-7.0. In addition, the NetCDF matched pairs output is now correctly limited to the NAO region. The MaskPlane object must be used different than the DataPlane object was in met-7.0. Committed fix in both the develop and master_v8.1 branches. |
This issue was raised via met-help:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=91026
Mallory found that the behavior of Grid-Stat changed from met-7.0 to met-8.0 (and still persists in met-8.1). Use the NetCDF output gen_vx_mask on Grid 104 for the NAO. Then run Grid-Stat with auto-regridding of masks and see that the number of matched pairs differ. In met-7.0 the NA points are excluded and in met-8.0 they are included (met-8.0 and met-8.1).
In met-7.0, the auto-regridding of NAO results in 4805 pairs on Grid 4, but in met-8.1, it results in 209032 pairs!
The text was updated successfully, but these errors were encountered: