I need to modify a very large geoTif file (over 200GB), however when I save it my code crashes as it loads the file in memory. The code looks like this.
import xarray as xr
# open the file
ds = xr.open_rasterio('file.tif')
# modify here
.....
# this part uses too much memory and gives me the problem
ds.rio.to_raster('output.tif')
Is there any way to save the file as a tif, without loading it all in memory?