Skip to main content

All Questions

Tagged with
2 votes
1 answer
2k views

Xarray Dataset to raster - ValueError: failed to prevent overwriting existing key grid_mapping in attrs

I have a netcdf file located here http://thredds.northwestknowledge.net:8080/thredds/catalog/TERRACLIMATE_ALL/data/catalog.html?dataset=TERRACLIMATE_ALL_SCAN/data/TerraClimate_tmin_1958.nc. I am ...
Stefano Potter's user avatar
1 vote
0 answers
241 views

Is there a rioxarray version of xarray pad

I have a geocoded raster that I'd like to pad with NaNs to 64 x 64 pixels. I've tested rioxarray.DataArray.pad_box(), which does work, but it's a bit complex to calculate new bounding box corners that ...
user8188435's user avatar
1 vote
2 answers
1k views

rio.write_crs() leaves empty crs

I have a dataset ds which looks like this: <xarray.Dataset> Dimensions: (time: 42, long: 1383, lat: 586) Coordinates: * time (time) datetime64[ns] 1979-01-01 1980-01-01 ... 2020-...
Stefano Potter's user avatar
1 vote
1 answer
224 views

Exporting NetCDF file in MODIS sinusoidal grid with xarray

I have 18 TIFF files in the MODIS sinusoidal grid I would like to convert to one file in NetCDF format. I have converted the tifs to an xarray xarray.core.dataset.Dataset format called stacked. At ...
Stefano Potter's user avatar
1 vote
1 answer
1k views

How to visualize a NetCDF Dataset

Suppose I have a rather large NetCDF file that I open as a dataset using xarray. import xarray nc_in = r"....\D_P_WGS84_comp.nc" nc_ds = xarray.open_dataset(nc_in) It is composed of ...
gwydion93's user avatar
  • 1,913
5 votes
1 answer
6k views

Adding compression to a NetCDF file using xarray

I have a raster that I am trying to compress and convert to a NetCDF format with compression level = 9 using the xarray package. I assume that the compression is added using the encoding parameter as ...
gwydion93's user avatar
  • 1,913