[Numpy-discussion] MFDatasets and NetCDF4

George Nurser gnurser@googlemail....
Fri Sep 25 08:59:53 CDT 2009

2009/9/25 David Huard <david.huard@gmail.com>:
> Hi George,
> On Fri, Sep 25, 2009 at 6:55 AM, George Nurser <gnurser@googlemail.com>
> wrote:
>> Hi,
>> I hope this is the right place to ask this.
>> I've found the MFDataset works well in reading NetCDF3 files, but it
>> appears that it doesn't work at present for NetCDF4 files.
> It works on my side for netCDF4 files. What error are you getting ?
>> Is this an inherent problem with the NetCDF4 file structure, or would
>> it be possible to implement the MFDataset for NetCDF4 files sometime?
>> It would be very useful.
> From the docstring:
>  Datasets must be in C{NETCDF4_CLASSIC, NETCDF3_CLASSIC or NETCDF3_64BIT}
>     format (C{NETCDF4} Datasets won't work).
> I suspect your files are not in CLASSIC mode.

I haven't tried it yet:) I was just trusting the documentation (which
I've found to be very good).
Doing ncdump -k on my files gives 'netCDF-4' so I guess the files are
indeed not in CLASSIC mode.

> NETCDF4 datasets are allowed
> to have a more complex hierarchy than the CLASSIC mode, and I think this is
> what makes concatenation difficult to implement. That is, there would be no
> simple rule to determine which fields should be concatenated.
> David

Ok. I suspected it was something like that. If the netCDF-4 CLASSIC
mode allows data compression and chunking, which I think it is
supposed to do, perhaps I can persuade the guys running the model to
produce files in netCDF-4 CLASSIC mode.

Many thanks. George.

More information about the NumPy-Discussion mailing list