Closed
Description
This is a strange and i'm not sure if I can make a MCVE. I'll try later.
The tutorial equations works fine so must be something else i'm doing
VAR = "air"
OUNIT = "degC"
ds = xr.tutorial.open_dataset("air_temperature")
ds["lat"].attrs["units"] = "degree"
ds["lon"].attrs["units"] = "degree"
ds = ds.pint.quantify({VAR: ds[VAR].attrs["units"]})
ds = ds.pint.to({VAR: OUNIT})
ds = ds.pint.dequantify(format="~P")
ds[VAR].isel(time=0).plot()
ds.to_netcdf("/tmp/tmp.nc")
ds = xr.open_dataset("/tmp/tmp.nc")
ds[VAR].isel(time=0).plot()
I'm trying to save a Dataset where I can converted the units.
I'm unable to see the converted units after loading straight after saving.
The code is something like the example above but with a few extra ETL steps.
Metadata
Metadata
Assignees
Labels
No labels