[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [netcdf-java] Problem reading NetCDF4 from netcdfall-4.5.jar



Yes, the nc4 file is mis-formed. Apparently Charlie Zender changed his mind on why.



On Tue, Nov 4, 2014 at 3:44 PM, Antonio Rodriges <address@hidden> wrote:
John,

Did you have a chance to look on the file?

Antonio

2014-11-03 21:30 GMT+02:00 Antonio Rodriges <address@hidden>:
> Hello,
>
> The resulting file is
> https://www.dropbox.com/s/xa067an5xogrdyg/2014_ch.nc?dl=0
>
> The exception is thrown by the NetCDF 4.5 Java, however, I returned
> back to NetCDF 4.2 which prints only those 2 lines. The reason of
> switching back to 4.2:
> - version 4.5 does not open that file correctly
> - throws exception
> - my other old code (not with NetCDF 4 files) which worked with 4.2
> stopped working with 4.5
>
> Please, have a look on the 2014_ch.nc. If you will still need stack
> trace, that will require me some time to get 4.5 Java back and
> reproduce the exception
>
> 2014-11-03 20:09 GMT+02:00 John Caron <address@hidden>:
>> also the full stack trace?
>>
>> On Mon, Nov 3, 2014 at 11:09 AM, John Caron <address@hidden> wrote:
>>>
>>> ok, can i get the nc4 file?
>>>
>>> On Mon, Nov 3, 2014 at 10:40 AM, Antonio Rodriges <address@hidden>
>>> wrote:
>>>>
>>>> John,
>>>>
>>>> I chunk the NetCDF 3 file and obtain NetCDF 4 file as the result.
>>>>
>>>> Here is my initial question posted earlier:
>>>>
>>>> I have file 2014.nc of NetCDF version 3.
>>>> I used the latest ncks for Windows (released 1 Oct 2014) to rechunk my
>>>> file
>>>> ncks -4 --cnk_dmn lat,4 --cnk_dmn lon,4 --cnk_dmn time,512 2014.nc
>>>> 2014_ch.nc
>>>>
>>>> The new file 2014_ch.nc can be read by WCT, for example.
>>>> However, java code yields
>>>> [ucar.nc2.NetcdfFile] DEBUG Using IOSP ucar.nc2.iosp.hdf5.H5iosp
>>>> [ucar.nc2.iosp.hdf5.H5header] ERROR bad version 72 at filePos 22386
>>>> and throws exception
>>>>
>>>> The code is
>>>> import ucar.nc2.NetcdfFile;
>>>> NetcdfFile nativeNetCDFFile = NetcdfFile.open(fullPath);
>>>>
>>>>
>>>> 2014-11-03 19:18 GMT+02:00 John Caron <address@hidden>:
>>>> >> Is it possible to perform chunking programmatically using NetCDF Java
>>>> >> library?
>>>> >
>>>> > Yes, see:
>>>> >
>>>> >
>>>> > http://www.unidata.ucar.edu/software/thredds/v4.5/netcdf-java/reference/netcdf4Clibrary.html
>>>> >>
>>>> >>
>>>> >
>>>
>>>
>>