Replaces the two ImplicitCoords for dims with one AffineIndex, so
the grid and its CRS are carried, selected and compared as one thing.
Examples
v <- Variable(dims = c("lon", "lat"), data = matrix(1:12, 4, 3))
da <- DataArray(variable = v, coords = list(
lon = ImplicitCoord(dimension = "lon", n = 4L, offset = 100.5, step = 1),
lat = ImplicitCoord(dimension = "lat", n = 3L, offset = -40.5, step = -1)
))
set_affine_index(da, c("lon", "lat"), crs = "EPSG:4326")
#> <DataArray> '(unnamed)'
#> Dimensions: (lon: 4, lat: 3)
#> Coordinates:
#> * lon,lat (lon, lat) affine 4 x 3, res 1, -1, crs EPSG:4326
#> dtype: integer (48 B)