Hi Sara-It's obvious that you are creating a grid given your x/y/z dimensions, but you do need to get the metadata right. I think the IDV may not like a time unit of just "hours" - you might try "hours since 1970-01-01 00:00:00". That's a limitation of the way the IDV handles time. And you might also try Brian's suggestion of changing the dimension names. The IDV should not need a Conventions global attribute - I would think that the underlying netCDF-Java library should be able to handle some sort of default convention that closely resembles the CF defaults. Maybe you could send a sample file to Unidata and they could help you adjust the the metadata so you'd just need the minimal amount. You shouldn't need to make such a file CF compliant just to get it into the IDV. It was designed to handle a variety of conventions (even none) - or at least it used to.
Don Murray On 8/22/16 9:20 AM, Julien Chastang wrote:
Hi Sara, There are a variety of problems here. For starters, there are no global attributes and metadata related to CF conventions. Moreover, the IDV is trying to find gridded data and can't, but is that really what you intend? I can't tell what kind of data these data are meant to be. I once wrote a blog entry on creating a CF compliant netCDF files with Python that can subsequently be read in to the IDV. http://www.unidata.ucar.edu/blogs/developer/entry/ipynb_cookbooks_to_create_cf http://nbviewer.jupyter.org/github/julienchastang/py-netcdf-cf-cookbooks/blob/master/traj.ipynb The example is for trajectory data, but you will be able to find many hints for the kind of data you wish to create, e.g., gridded data if that is what you intend. Again, make sure to follow CF conventions and checkout those NODC templates (described in the blog) for examples. Best, Unidata IDV Support On Mon, Aug 22, 2016 at 7:45 AM, Sara Loureiro Solla < sara.solla@xxxxxxxxxxxxx> wrote:Hello everyone! I am having trouble opening a *.nc file using IDV. The error I encounter is " No gridded data found". I found some posts about the same problem in the idvusers list, but I cannot find a proper solution. I create a nc file using python 2.7 and netCDF126.96.36.199 module. The dimensions and the variables related to them are created this way: Dimensions: dataout.createDimension('t', None) dataout.createDimension('y', 361) dataout.createDimension('x', 720) dataout.createDimension('z', 1) Variables: lat = self.dataout.createVariable('y', 'f4',( 'y',), zlib=True) lat.units = 'degrees_north' lon = self.dataout.createVariable('x', 'f4', ('x',), zlib=True) lon.units = 'degrees_east' time = self.dataout.createVariable('t', 'f4', ('t',), zlib=True) time.units = 'hours' time.calendar = 'gregorian' vertical = self.dataout.createVariable('z','f4',('z',),zlib=True) vertical.units = 'hPa' vertical.positive = 'down' Variable filling: lat[:] = np.arange(-90,90.5,.5) lon[:] = np.arange(-180,180,.5) time[:] = 80 vertical[:] = 850 According to ncdump my file has the follow coordinate variable data: t = 180 ; z = 850 ; y = -90, -89.5, -89, -88.5 ...... 85.5, 86, 86.5, 87, 87.5, 88, 88.5, 89, 89.5, 90 ; x = -180, -179.5, -179, ...... 178, 178.5, 179, 179.5 ; Any idea about what could lead to the "no gridded data found" error? Thank you very much! Sara_______________________________________________ NOTE: All exchanges posted to Unidata maintained email lists are recorded in the Unidata inquiry tracking system and made publicly available through the web. Users who post to any of the lists we maintain are reminded to remove any personal information that they do not want to be made public. idvusers mailing list idvusers@xxxxxxxxxxxxxxxx For list information, to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/
-- Don Murray NOAA/ESRL/PSD and CU-CIRES 303-497-3596 http://www.esrl.noaa.gov/psd/people/don.murray/