OK, more questions...

I was trying to understand the group functionality.  It isn't clear to
me how to create groups and then how to put variables in them.  Here is
some sample code...

        Group root = file.getRootGroup();  // Seems pretty obvious
        Group child = new Group(file, root, "child");
        file.addGroup(root, child);

OK, I'm not sure about this line.  It seems strange that to add a group
you have to already have created the group.

        child.addAttribute(new Attribute("testAttr", "testValue"));
        Group grand = new Group(file, child, "grand");
        //file.addGroup(child, grand);

This line is commented out because it causes a null pointer exception if
it isn't (although it isn't clear why it should cause any problems).
              
        Variable x = new Variable(file, grand, null, "x");
        file.addVariable(grand, x);

Hmmm...the constructor to Variable requires a group and the
file.addVariable method requires a group?  This seems redundant.

My example actually runs (generates a netCDF file) but if I open it with
the ToolsUI tool, I don't see any groups?!?  Whenever the user's guide
is updated, it would be nice to have an example of the proper method for
creating groups.

--
Mike

begin:vcard
fn:Michael Tiller
n:Tiller;Michael
org:Emmeskay, Inc.
adr;dom:;;47119 Five Mile Road;Plymouth;MI;48170
email;internet:mtiller@xxxxxxxxxxxx
title:Vice-President Modeling Research and Development
tel;work:(734) 635-3450
x-mozilla-html:TRUE
url:http://www.emmeskay.com
version:2.1
end:vcard

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