Re: [netcdf-java] [netcdfgroup] Not a valid CDM file

  • To: Sean Arms <sarms@xxxxxxxx>
  • Subject: Re: [netcdf-java] [netcdfgroup] Not a valid CDM file
  • From: Vineet Ghatge Hemantkumar <hemantku@xxxxxxx>
  • Date: Sat, 22 Nov 2014 12:21:57 -0800
Hi Sean,

Please find the grib file attached.

Regards,
Vineet

On Sat, Nov 22, 2014 at 11:57 AM, Sean Arms <sarms@xxxxxxxx> wrote:

> Hi Vineet,
>
> I'm not sure why this isn't working right off hand. Would it be possible
> for you to share the grib file you are working with?
>
> Thanks,
>
> Sean
>
>
> On Sat, Nov 22, 2014 at 12:43 PM, Vineet Ghatge Hemantkumar <
> hemantku@xxxxxxx> wrote:
>
>> Hi Sean,
>>
>> I am using netCDF version 4.5.3 and signature being used is the following
>>
>> public static NetcdfFile 
>> <http://www.unidata.ucar.edu/software/thredds/v4.3/netcdf-java/v4.0/javadoc/ucar/nc2/NetcdfFile.html>
>>  *openInMemory*(java.lang.String name,
>>                                       byte[] data)
>>                                throws java.io.IOException
>>
>> Open an in-memory netcdf file.
>>
>> *Parameters:*name - name of the dataset. Typically use the filename or
>> URI.data - in-memory netcdf file*Returns:*memory-resident NetcdfFile
>> *Throws:*java.io.IOException - if error
>>
>> On Sat, Nov 22, 2014 at 9:11 AM, Sean Arms <sarms@xxxxxxxx> wrote:
>>
>>> Greetings Vineet,
>>>
>>> Which version of netCDF-Java are you using, and which signature of
>>> openInMemory are you using?
>>>
>>> Thanks!
>>>
>>> Sean
>>>
>>>
>>> On Friday, November 21, 2014, Vineet Ghatge Hemantkumar <
>>> hemantku@xxxxxxx> wrote:
>>>
>>>> Hello All,
>>>>
>>>> I am trying to pass a InputStream of a grib file to the function 
>>>> *netcdf.openinmemory()
>>>> *but it fails with following error
>>>>
>>>> Caused by: java.io.IOException: Cant read : not a valid CDM file.
>>>> at ucar.nc2.NetcdfFile.open(NetcdfFile.java:811)
>>>> at ucar.nc2.NetcdfFile.openInMemory(NetcdfFile.java:728)
>>>>
>>>> If I change the netcdf to netcdf.open() and pass the file name it works
>>>> well.
>>>>
>>>> 1. Will the openinmemory() work only for .nc files only?
>>>> 2. What are options in netcdf to read inputstreams? My aim to is to
>>>> make code independent of filenames or any other specific configurations?
>>>>
>>>> Regards,
>>>> vineet
>>>>
>>>>
>>
>>
>> --
>> *Vineet Ghatge*
>>
>
>


-- 
*Vineet Ghatge*

Attachment: gdas1.forecmwf.2014062612.grib2
Description: Binary data

  • 2014 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: