Closed
Description
Is your feature request related to a problem? Please describe.
https://corteva.github.io/rioxarray/stable/getting_started/manage_information_loss.html
Original data:
rds.green.attrs, rds.green.encoding
({'nodata': 0, 'units': ('DN', 'DN')},
{'dtype': 'float64',
'grid_mapping': 'spatial_ref',
'scale_factor': 1.0,
'add_offset': 0.0,
'_FillValue': nan,
'source': 'netcdf:../../test/test_data/input/PLANET_SCOPE_3D.nc:green'})
with xarray.set_options(keep_attrs=True):
new_ds = rds.green + rds.green
new_ds.attrs, new_ds.encoding
{'nodata': 0, 'units': ('DN', 'DN')}, {}
Describe the solution you'd like
with xarray.set_options(keep_attrs=True, keep_encoding=True):
new_ds = rds.green + rds.green
new_ds.attrs, new_ds.encoding
({'nodata': 0, 'units': ('DN', 'DN')},
{'dtype': 'float64',
'grid_mapping': 'spatial_ref',
'scale_factor': 1.0,
'add_offset': 0.0,
'_FillValue': nan,
'source': 'netcdf:../../test/test_data/input/PLANET_SCOPE_3D.nc:green'})
Metadata
Metadata
Assignees
Labels
No labels