Re: [netcdf-java] sample code for reading multidim vlen variable

  • To: Bob Simons - NOAA Federal <bob.simons@xxxxxxxx>
  • Subject: Re: [netcdf-java] sample code for reading multidim vlen variable
  • From: Christian Ward-Garrison <cwardgar@xxxxxxxx>
  • Date: Sat, 18 Jun 2016 15:48:54 -0600
Hi Bob,

I did some research, and the short answer is that multiple VLEN dimensions
are not supported. Check out the GitHub issue [1] for my full findings.
Sorry about that.

Cheers,
Christian

[1] https://github.com/Unidata/thredds/issues/567

On Fri, Jun 17, 2016 at 11:33 AM, Bob Simons - NOAA Federal <
bob.simons@xxxxxxxx> wrote:

> Is there sample code somewhere for reading a multidimensional variable
> where some of the dimensions are vlen, e.g., myVar[dimA][*][*] ?
>
> I found
>
> http://www.unidata.ucar.edu/software/thredds/v4.5/netcdf-java/reference/StructureData.html#vlen
> but the temp variable just has the one dimension.
>
> Just calling myVar.read() doesn't work(java.io.IOException) -- I suspect
> because it would be useless without knowing all the subdimension sizes.
>
> Is there a way to get a flattened version of the data and dimensions?
> e.g., have myVar[dimA][*][*] flattened into
> a  b  c myVar
> 0  0  0  1.2
> 0  0  1  1.4
> 0  1  0  1.6
> 1  0  0  1.1
> 1  0  1  1.3
> 1  0  2  1.4
> 1  1  0  1.7
> 1  1  1  1.1
> 1  2  0  1.2
>
> Or, can you give me general advice on how to get the data out of a
> variable like this?
> Do I need to iterate through the dimA values, and do separate read()s for
> each value of a, then separate reads for each value of that dimension?
>
> Thank you.
>
> --
> Sincerely,
>
> Bob Simons
> IT Specialist
> Environmental Research Division
> NOAA Southwest Fisheries Science Center
> 99 Pacific St., Suite 255A      (New!)
> Monterey, CA 93940               (New!)
> Phone: (831)333-9878            (New!)
> Fax:   (831)648-8440
> Email: bob.simons@xxxxxxxx
>
> The contents of this message are mine personally and
> do not necessarily reflect any position of the
> Government or the National Oceanic and Atmospheric Administration.
> <>< <>< <>< <>< <>< <>< <>< <>< <><
>
>
> _______________________________________________
> 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.
>
>
> netcdf-java mailing list
> netcdf-java@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe, visit:
> http://www.unidata.ucar.edu/mailing_lists/
>
  • 2016 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: