0

I thought it would be straight up, but I don't find a question like this one here.

I created a NetCDF out of a GeoTIFF, but it did not have coordinates or CRS.

I added it doing this:

coords = {
'time' : ['2023'],
'y': np.linspace(-90, 90, 1801)[::-1],
'x': np.linspace(-180, 180, 3600),}

b  = xr.DataArray(data, dims=('time', 'y', 'x'), name='test', coords=coords)
b.rio.write_crs("epsg:4326", inplace=True)

But it does not work. I tried inverting y also.

1 Answer 1

0

Actually the solution ended up inverting the data itself, doing:

np.flipud(data)

Not the answer you're looking for? Browse other questions tagged or ask your own question.