Re: [idvusers] No gridded data found

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 netCDF4.1.2.4 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
>