private void addStructure(Structure parent, DataDescriptor dataDesc, int count) { String structName = "struct" + structNum; structNum++; Structure struct = new Structure(ncfile, null, parent, structName); try { struct.setDimensionsAnonymous(new int[]{count}); // anon vector } catch (InvalidRangeException e) { log.error("illegal count= " + count + " for " + dataDesc); } for (DataDescriptor subKey : dataDesc.getSubKeys()) addMember(struct, subKey); parent.addMemberVariable(struct); struct.setSPobject(dataDesc); dataDesc.name = structName; dataDesc.refersTo = struct; }
private void addStructure(Structure parent, BufrConfig.FieldConverter fld, int count) { DataDescriptor dkey = fld.dds; String uname = findUniqueName(parent, fld.getName(), "struct"); dkey.name = uname; // name may need to be changed for uniqueness //String structName = dataDesc.name != null ? dataDesc.name : "struct" + structNum++; Structure struct = new Structure(ncfile, null, parent, uname); try { struct.setDimensionsAnonymous(new int[]{count}); // anon vector } catch (InvalidRangeException e) { log.error("illegal count= " + count + " for " + fld); } for (BufrConfig.FieldConverter subKey : fld.flds) addMember(struct, subKey); parent.addMemberVariable(struct); struct.setSPobject(fld); dkey.refersTo = struct; }
private void addDpiStructure(Structure parent, DataDescriptor parentDD, DataDescriptor dpiField) { String structName = findUnique(parent, dpiField.name); Structure struct = new Structure(ncfile, null, parent, structName); int n = parentDD.replication; try { struct.setDimensionsAnonymous(new int[]{n}); // anon vector } catch (InvalidRangeException e) { log.error("illegal count= " + 1 + " for " + dpiField); } Variable v = new Variable(ncfile, null, struct, "name"); v.setDataType(DataType.STRING); // scalar v.setDimensions(""); // scalar struct.addMemberVariable(v); v = new Variable(ncfile, null, struct, "data"); v.setDataType(DataType.FLOAT); // scalar v.setDimensions(""); // scalar struct.addMemberVariable(v); parent.addMemberVariable(struct); struct.setSPobject(dpiField); // ?? dpiField.name = structName; dpiField.refersTo = struct; // add some fake dkeys corresponding to above // DataDescriptor nameDD = new DataDescriptor(); }
s.setDimensionsAnonymous(new int[]{vh.nvert}); else s.setIsScalar();
private void addDpiStructure(Structure parent, BufrConfig.FieldConverter parentFld, BufrConfig.FieldConverter dpiField) { DataDescriptor dpiKey = dpiField.dds; String uname = findUniqueName(parent, dpiField.getName(), "struct"); dpiKey.name = uname; // name may need to be changed for uniqueness //String structName = findUnique(parent, dpiField.name); Structure struct = new Structure(ncfile, null, parent, uname); int n = parentFld.dds.replication; try { struct.setDimensionsAnonymous(new int[]{n}); // anon vector } catch (InvalidRangeException e) { log.error("illegal count= " + 1 + " for " + dpiField); } Variable v = new Variable(ncfile, null, struct, "name"); v.setDataType(DataType.STRING); // scalar v.setDimensions(""); // scalar struct.addMemberVariable(v); v = new Variable(ncfile, null, struct, "data"); v.setDataType(DataType.FLOAT); // scalar v.setDimensions(""); // scalar struct.addMemberVariable(v); parent.addMemberVariable(struct); struct.setSPobject(dpiField); // ?? dpiKey.refersTo = struct; // add some fake dkeys corresponding to above // DataDescriptor nameDD = new DataDescriptor(); }
s.setDimensionsAnonymous(new int[]{vh.nvert}); else s.setIsScalar();
private void addDpiSequence(Structure parent, BufrConfig.FieldConverter fld) { Structure struct = new Structure(ncfile, null, parent, "statistics"); try { struct.setDimensionsAnonymous(new int[]{fld.dds.replication}); // scalar } catch (InvalidRangeException e) { e.printStackTrace(); } Variable v = new Variable(ncfile, null, struct, "name"); v.setDataType(DataType.STRING); // scalar v.setDimensions(""); // scalar struct.addMemberVariable(v); v = new Variable(ncfile, null, struct, "data"); v.setDataType(DataType.FLOAT); // scalar v.setDimensions(""); // scalar struct.addMemberVariable(v); parent.addMemberVariable(struct); }
private void addDpiSequence(Structure parent, DataDescriptor dataDesc) { Structure struct = new Structure(ncfile, null, parent, "statistics"); try { struct.setDimensionsAnonymous(new int[] {dataDesc.replication}); // scalar } catch (InvalidRangeException e) { e.printStackTrace(); } Variable v = new Variable(ncfile, null, struct, "name"); v.setDataType(DataType.STRING); // scalar v.setDimensions(""); // scalar struct.addMemberVariable(v); v = new Variable(ncfile, null, struct, "data"); v.setDataType(DataType.FLOAT); // scalar v.setDimensions(""); // scalar struct.addMemberVariable(v); parent.addMemberVariable(struct); }
s.setDimensionsAnonymous(new int[]{vh.nvert}); else s.setIsScalar();