Encoding for streamflow from single NetCDF file from S3

In [1]:
import xarray as xr
import fsspec
In [2]:
url = 's3://noaa-nwm-retrospective-2-1-pds/model_output/2020/202001011100.CHRTOUT_DOMAIN1.comp'
In [3]:
fs = fsspec.filesystem('s3', anon=True)
ds = xr.open_dataset(fs.open(url), drop_variables='reference_time', chunks={})
In [4]:
ds.streamflow.encoding
Out[4]:
{'chunksizes': (2776738,),
 'fletcher32': False,
 'shuffle': False,
 'zlib': True,
 'complevel': 2,
 'source': '<File-like object S3FileSystem, noaa-nwm-retrospective-2-1-pds/model_output/2020/202001011100.CHRTOUT_DOMAIN1.comp>',
 'original_shape': (2776738,),
 'dtype': dtype('int32'),
 'missing_value': array([-999900], dtype=int32),
 '_FillValue': array([-999900], dtype=int32),
 'scale_factor': array([0.01], dtype=float32),
 'add_offset': array([0.], dtype=float32),
 'coordinates': 'latitude longitude'}
In [5]:
ds.to_netcdf('roundtrip.nc', mode='w')
In [6]:
xr.open_dataset('roundtrip.nc').streamflow.encoding
Out[6]:
{'zlib': True,
 'shuffle': False,
 'complevel': 2,
 'fletcher32': False,
 'contiguous': False,
 'chunksizes': (2776738,),
 'source': '/home/shared/users/rsignell/notebooks/NWM/roundtrip.nc',
 'original_shape': (2776738,),
 'dtype': dtype('int32'),
 'missing_value': -999900,
 '_FillValue': -999900,
 'scale_factor': 0.01,
 'add_offset': 0.0,
 'coordinates': 'latitude longitude'}