converting float to byte in netcdf file
问题 I have a large netcdf file with a standard float field which consists of only 0.0 or 1.0. I would like to convert it to a byte type from the command line to save some space and also make it easier to read in the array to a byte type in fortran. I tried to use ncap ncap -s 'fire=byte(fire)' CAMS_2003-2017_frp_mask2_africa_zip.nc test.nc but it just seems to zero all the fields. I was using zip_6 netcdf4 compression on the source file, I'm not sure if that complicates matters? UPDATE: I found