I am using a very big netcdf map file in python, and looking to "pull out" and save one variable in it (I don't need the rest). The orignal file is too large to open alone, I get the error "ValueError: array is too big; arr.size * arr.dtype.itemsize is larger than the maximum possible size." have to do this because the file is otherwise too big to use on my system.
I used:
ds2= netCDF4.Dataset("2020_original_Map.1.1.nc").variables['lccs_class']
This gets me the correct data in a size I can read, but then ds2 is <class 'netCDF4._netCDF4.Variable'>. I have tried all of the usual ways to save this as a netcdf, but none of them are working. Does anyone know how I save ds2 as it's own nc file, or another way to pull out 'llcs class' and save it separately? How can I make a new nc file and pass this variable into it?