ClimateGlobalChange/tempestextremes

Support for snapshots with partial field of missing values in NodeFileCompose?

Closed this issue · 2 comments

For regional models e.g., WRF, there could be issues where a feature is near the lateral boundary. NFC seems it could be susceptible to this issue.

Here is an example of a V850 snapshot using WRF where the cyclone is near the southern boundary of a CONUS domain.

Screenshot 2023-03-28 at 10 02 11 AM

Quickly grepping the existing code, NFC creates a xy (using default SimpleGrid) mesh and then fills each point in the mesh with the nearest node in the raw data.

Suggested solution (feel free to improve upon): only fill each cell (node?) in the SimpleGrid with a cell (node?) value from the raw data if the distance between SimpleGrid cell and the raw cell is <= some userdefined threshold (probably the resolution of the data plus like 50% for fuzz?).

Pseudocode:

if gc_dist(SimpleGridNode_latlon - nearestRawNode_latlon) > allow_thresh_deg
  SimpleGridNode_val == NaN (or some _FillValue)
else
  SimpleGridNode_val == nearestRawNode_val

Setting allow_thresh_deg to some large value recovers the current behavior. The only thing that could be a bit tricky is calculating the mean which would need to account for the number of valid cells in each point on SimpleGrid since any points can have _FillValues.

Snapshot in ncview might look something like this?

Screenshot 2023-03-28 at 10 02 11 AM

@zarzycki can you verify this has been fixed?

The snapshot behavior seems to be working well in all of our tests w/ default params. Our averaging seems OK when using --regional --missingdata although that's not rigorously tested.