Skip to main content

snap_regional_steps

Function snap_regional_steps 

Source
pub fn snap_regional_steps(grid: GridInfo) -> GridInfo
Available on crate feature encoder only.
Expand description

Give a regional grid the round step it was clearly published on — the port of snap_regional_steps in xuebuild/grid.py, which explains the rule; the two must agree to the bit.

The same GDAL habit that puts a global grid a hair off the globe puts a regional one a hair off its step: MRMS writes the last longitude of its 0.01° grid two millionths short, which GDAL turns into a 0.0099999997° step. A grid whose cells, at the nearest whole thousandth of a degree or, failing that, the nearest whole arc-minute (EFAS’s 1/60°), span its extent to within a thousandth of a cell is on that step, on both axes independently, and its first center is placed on the half-step grid (a grid whose edges are on whole steps has its centers half a step in) when it lies within the same tolerance. A step that is near neither passes through unchanged, as does a global grid.