3
votes

I have downloaded monthly mean wind speed of terraclimate data for 20 years (2000-2019) which have NetCDF format, but unfortunately, each year has a single NetCDF file, and I want to merge them all to have a single wind speed which is from 2000 to 2019. So, I am using xarray in python to join these NETCDF files, and this is my code:

import xarray as xr

import glob

ds = xr.open_mfdataset("C:\Users\Nazanin\Desktop\other\nc\*.nc")

ds.to_netcdf('Final.nc')

but it gives me this error:

Exception has occurred: ValueError

Variable 'ws' has conflicting _FillValue (32768) and missing_value (-32768). Cannot encode data.

  File "C:\Users\Nazanin\Desktop\other\nc\nc.py", line 4, in <module>

    ds.to_netcdf('Final.nc')

Could anybody help me to fix this problem?

Have a look ad ds.ws.encoding. Try overwriting it with an empty dict ds.ws.encoding = {}.mathause