"string" attributes in output netCDF files

53 views
Skip to first unread message

Damien Irving

unread,
Apr 28, 2016, 2:04:14 AM4/28/16
to Iris
Hi,

I've been using iris.save() to write iris cubes out to netCDF. When I do an ncdump of the output files some of the attributes are designated as "string", e.g:

variables:
    double thetao(time, lev, j, i) ;
        thetao:_FillValue = 1.e+20 ;
        string thetao:standard_name = "sea_water_potential_temperature" ;
        string thetao:long_name = "Sea Water Potential Temperature" ;
        thetao:units = "K" ;
        thetao:coordinates = "lat lon" ;
    double time(time) ;
        time:axis = "T" ;
        time:bounds = "time_bnds" ;
        time:units = "days since 0001-01-01" ;
        string time:standard_name = "time" ;
        string time:long_name = "time" ;
        string time:calendar = "proleptic_gregorian" ;

Iris seems to have no problem with these attributes (i.e. I can read the netCDF file with iris), but other applications (e.g. cdo) sometimes do.

Does anyone know how to stop this behaviour?


Regards,
Damien


Stephan Hoyer

unread,
Apr 28, 2016, 2:54:22 AM4/28/16
to Damien Irving, Iris
This is due to a poor choice we made in netCDF4-Python which has now been fixed:

The short answer is that you should either downgrade netCDF4-Python to v1.1.7 or earlier or upgrade to v1.2.3 or later.

--
You received this message because you are subscribed to the Google Groups "Iris" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scitools-iri...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Richard Hattersley

unread,
Apr 28, 2016, 5:09:01 AM4/28/16
to Iris
Thanks for the clarification Stephan - that's really useful to know.

Richard

Damien Irving

unread,
May 2, 2016, 7:10:25 PM5/2/16
to Iris
Thanks, Stephan. That did indeed fix the problem.

Perhaps the SciTools anaconda package for Iris could be be updated so that it includes a netcdf4 version > 1.2.3? Or is that one moving to conda-forge? I'm happy to post an issue about it at the relevant github repo?


Reply all
Reply to author
Forward
0 new messages