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

Unable to write unsigned int8 variable in netcdf4 file (non-netcdf3 type) #65

Open
chaosphere2112 opened this issue Nov 22, 2016 · 1 comment
Assignees
Milestone

Comments

@chaosphere2112
Copy link
Contributor

It appears that something is going awry with writing netcdf4 data types. When I try to write a byte (uint8) variable to a file, I get the standard netcdf library error:
'cdunif: NetCDF: Attempting netcdf-4 operation on strict nc3 netcdf-4 file'

I'm wondering if this has any relationship with CDAT/cdat#406

If the write statement is dropped into a try Write: except Pass block it seems to write at the second attempt, placed after this try/except block.

The written file looks something like below:

      [durack1@oceanonly WOD13]$ ncdump -h WOD13_masks.nc
      netcdf WOD13_masks {
      dimensions:
              depth = 102 ;
              bound = 2 ;
              latitude = 180 ;
              longitude = 360 ;
      variables:
              float depth(depth) ;
                      depth:bounds = "bounds_depth" ;
              double bounds_depth(depth, bound) ;
              float latitude(latitude) ;
                      latitude:bounds = "bounds_latitude" ;
                      latitude:axis = "Y" ;
              double bounds_latitude(latitude, bound) ;
              float longitude(longitude) ;
                      longitude:bounds = "bounds_longitude" ;
                      longitude:axis = "X" ;
                      longitude:modulo = 360. ;
                      longitude:topology = "circular" ;
              double bounds_longitude(longitude, bound) ;
              byte basinmask(depth, latitude, longitude) ;
                      basinmask:missing_value = 125b ;

Migrated from: CDAT/cdat#481

@durack1 durack1 added this to the 3.0 milestone Apr 21, 2017
@doutriaux1 doutriaux1 modified the milestones: 3.0, 3.1 Mar 29, 2018
@durack1
Copy link
Member

durack1 commented Feb 12, 2019

@dnadeau4 I assume this issue is now resolved right? All the numpy standard types (https://www.numpy.org/devdocs/user/basics.types.html) are now write-able using cdms2?

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

4 participants