Skip to content
Prev 8447 / 29559 Next

netCDF, raster(), and being memory-safe

r-sig-geo'ers:

Next in my barrage of questions -- what would be a memory-safe way of
dealing with netCDF files via raster()?  I understand that raster
loads the entire netCDF band/file into memory when using raster():

u_wind_rasters=stack(u_wind_file,zvar='uwnd')

or

v_wind_raster=raster(v_wind_file,zvar='vwnd',time=1)

where u_wind_file and v_wind_file are .nc files.

Would it make sense to pre-convert these to something "safer"?  Is
there a memory-safe way of converting these to some multi-band image
within R?

--j