Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xarray adds fill value when outputting to NetCDF #173

Open
ellesmith88 opened this issue May 26, 2021 · 0 comments
Open

xarray adds fill value when outputting to NetCDF #173

ellesmith88 opened this issue May 26, 2021 · 0 comments

Comments

@ellesmith88
Copy link
Collaborator

Description

xarray adds _FillValue when outputting to NetCDF. See this example for lat

Before working with xarray:

double lat(lat) ;
                lat:bounds = "lat_bnds" ;
                lat:units = "degrees_north" ;
                lat:axis = "Y" ;
                lat:long_name = "latitude" ;
                lat:standard_name = "latitude" ;

After working with xarray:

double lat(lat) ;
                lat:_FillValue = NaN ;
                lat:bounds = "lat_bnds" ;
                lat:units = "degrees_north" ;
                lat:axis = "Y" ;
                lat:long_name = "latitude" ;
                lat:standard_name = "latitude" ;

By setting ds.lat.encoding['_FillValue'] = None before outputting to NetCDF, the lat:_FillValue = NaN ; can be removed. This is happening with the NetCDF files we are generating with roocs. CF conventions say that coordinate variables cannot have missing values, so we don't want this added _FillValue in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant