static Structure decodeStructure(NetcdfFile ncfile, Group g, Structure parent, NcStreamProto.Structure s) { Structure ncvar = (s.getDataType() == ucar.nc2.stream.NcStreamProto.DataType.SEQUENCE) ? new Sequence(ncfile, g, parent, s.getName()) : new Structure(ncfile, g, parent, s.getName()); ncvar.setDataType(convertDataType(s.getDataType())); List<Dimension> dims = new ArrayList<>(6); for (ucar.nc2.stream.NcStreamProto.Dimension dim : s.getShapeList()) { Dimension ncdim = decodeDim(dim); if (!ncdim.isShared()) dims.add(ncdim); else { Dimension d = g.findDimension(ncdim.getShortName()); if (d == null) throw new IllegalStateException("Can find shared dimension " + dim.getName()); dims.add(d); } } ncvar.setDimensions(dims); for (ucar.nc2.stream.NcStreamProto.Attribute att : s.getAttsList()) ncvar.addAttribute(decodeAtt(att)); for (ucar.nc2.stream.NcStreamProto.Variable vp : s.getVarsList()) ncvar.addMemberVariable(decodeVar(ncfile, g, ncvar, vp)); for (NcStreamProto.Structure sp : s.getStructsList()) ncvar.addMemberVariable(decodeStructure(ncfile, g, ncvar, sp)); return ncvar; }
static Structure decodeStructure(NetcdfFile ncfile, Group g, Structure parent, NcStreamProto.Structure s) { Structure ncvar = (s.getDataType() == ucar.nc2.stream.NcStreamProto.DataType.SEQUENCE) ? new Sequence(ncfile, g, parent, s.getName()) : new Structure(ncfile, g, parent, s.getName()); ncvar.setDataType(decodeDataType(s.getDataType())); List<Dimension> dims = new ArrayList<Dimension>(6); for (ucar.nc2.stream.NcStreamProto.Dimension dim : s.getShapeList()) { Dimension ncdim = decodeDim(dim); if (!ncdim.isShared()) dims.add(ncdim); else { Dimension d = g.findDimension(ncdim.getShortName()); if (d == null) throw new IllegalStateException("Can find shared dimension " + dim.getName()); dims.add(d); } } ncvar.setDimensions(dims); for (ucar.nc2.stream.NcStreamProto.Attribute att : s.getAttsList()) ncvar.addAttribute(decodeAtt(att)); for (ucar.nc2.stream.NcStreamProto.Variable vp : s.getVarsList()) ncvar.addMemberVariable(decodeVar(ncfile, g, ncvar, vp)); for (NcStreamProto.Structure sp : s.getStructsList()) ncvar.addMemberVariable(decodeStructure(ncfile, g, ncvar, sp)); return ncvar; }
dist.setDimensions(dims); ncfile.addVariable(null, dist); dist.addAttribute( new Attribute(CDM.LONG_NAME, "special graphic symbol for code "+code));
dist.setDimensions(dims); ncfile.addVariable(null, dist); dist.addAttribute( new Attribute(CDM.LONG_NAME, "special graphic symbol for code "+code));
dist.setDimensions(dims); ncfile.addVariable(null, dist); dist.addAttribute( new Attribute(CDM.LONG_NAME, "special graphic symbol for code "+code));
dist.setDimensions(dims); ncfile.addVariable(null, dist); dist.addAttribute( new Attribute(CDM.LONG_NAME, "Circle Packet"));
static Structure decodeStructure(NetcdfFile ncfile, Group g, Structure parent, NcStreamProto.Structure s) { Structure ncvar = (s.getDataType() == ucar.nc2.stream.NcStreamProto.DataType.SEQUENCE) ? new Sequence(ncfile, g, parent, s.getName()) : new Structure(ncfile, g, parent, s.getName()); ncvar.setDataType(decodeDataType(s.getDataType())); List<Dimension> dims = new ArrayList<Dimension>(6); for (ucar.nc2.stream.NcStreamProto.Dimension dim : s.getShapeList()) { if (dim.getIsPrivate() || dim.getIsVlen()) dims.add(new Dimension(dim.getName(), (int) dim.getLength(), false, dim.getIsUnlimited(), dim.getIsVlen())); else { Dimension d = g.findDimension(dim.getName()); if (d == null) throw new IllegalStateException("Can find shared dimension " + dim.getName()); dims.add(d); } } ncvar.setDimensions(dims); for (ucar.nc2.stream.NcStreamProto.Attribute att : s.getAttsList()) ncvar.addAttribute(decodeAtt(att)); for (ucar.nc2.stream.NcStreamProto.Variable vp : s.getVarsList()) ncvar.addMemberVariable(decodeVar(ncfile, g, ncvar, vp)); for (NcStreamProto.Structure sp : s.getStructsList()) ncvar.addMemberVariable(decodeStructure(ncfile, g, ncvar, sp)); return ncvar; }
dist.setDimensions(dims); ncfile.addVariable(null, dist); dist.addAttribute( new Attribute(CDM.LONG_NAME, "Circle Packet"));
dist.setDimensions(dims); ncfile.addVariable(null, dist); dist.addAttribute( new Attribute(CDM.LONG_NAME, "Circle Packet"));
dist.setDimensions(dims); ncfile.addVariable(null, dist); dist.addAttribute( new Attribute(CDM.LONG_NAME, vname+" Packet"));
private Structure makeReportIndexStructure() throws IOException { Structure reportIndex = new Structure(ncfile, null, null, BufrIosp.obsIndex); ncfile.addVariable(null, reportIndex); reportIndex.setDimensions("record"); reportIndex.addAttribute(new Attribute("long_name", "index on report")); Variable v = reportIndex.addMemberVariable(new Variable(ncfile, null, reportIndex, "name", DataType.STRING, "")); v.addAttribute(new Attribute("long_name", "name of station")); v.addAttribute(new Attribute("standard_name", "station_name")); v = reportIndex.addMemberVariable(new Variable(ncfile, null, reportIndex, "time", DataType.LONG, "")); v.addAttribute(new Attribute("units", "msecs since 1970-01-01 00:00")); v.addAttribute(new Attribute("long_name", "observation time")); v.addAttribute(new Attribute(_Coordinate.AxisType, "Time")); return reportIndex; }
dist.setDimensions(dims); ncfile.addVariable(null, dist); dist.addAttribute( new Attribute(CDM.LONG_NAME, "text and special symbol for code "+code));
private Structure makeReportIndexStructure() throws InvalidRangeException, IOException { Structure reportIndex = new Structure(ncfile, null, null, "reportIndex"); reportIndex.setDimensions("report"); reportIndex.addAttribute(new Attribute(CDM.LONG_NAME, "index on report - in memory")); int pos = 0; Variable v = reportIndex.addMemberVariable(new Variable(ncfile, null, reportIndex, "stationName", DataType.CHAR, "")); v.setDimensionsAnonymous(new int[]{6}); v.addAttribute(new Attribute(CDM.LONG_NAME, "name of station")); v.addAttribute(new Attribute("standard_name", "station_name")); v.setSPobject(new Vinfo(pos)); pos += 6; v = reportIndex.addMemberVariable(new Variable(ncfile, null, reportIndex, "time", DataType.INT, "")); v.addAttribute(new Attribute(CDM.UNITS, "secs since 1970-01-01 00:00")); v.addAttribute(new Attribute(CDM.LONG_NAME, "observation time")); v.setSPobject(new Vinfo(pos)); return reportIndex; }
private Structure makeReportIndexStructure() throws InvalidRangeException, IOException { Structure reportIndex = new Structure(ncfile, null, null, "reportIndex"); reportIndex.setDimensions("report"); reportIndex.addAttribute(new Attribute(CDM.LONG_NAME, "index on report - in memory")); int pos = 0; Variable v = reportIndex.addMemberVariable(new Variable(ncfile, null, reportIndex, "stationName", DataType.CHAR, "")); v.setDimensionsAnonymous(new int[]{6}); v.addAttribute(new Attribute(CDM.LONG_NAME, "name of station")); v.addAttribute(new Attribute("standard_name", "station_name")); v.setSPobject(new Vinfo(pos)); pos += 6; v = reportIndex.addMemberVariable(new Variable(ncfile, null, reportIndex, "time", DataType.INT, "")); v.addAttribute(new Attribute(CDM.UNITS, "secs since 1970-01-01 00:00")); v.addAttribute(new Attribute(CDM.LONG_NAME, "observation time")); v.setSPobject(new Vinfo(pos)); return reportIndex; }
private Structure makeReportIndexStructure() throws InvalidRangeException, IOException { Structure reportIndex = new Structure(ncfile, null, null, "reportIndex"); reportIndex.setDimensions("report"); reportIndex.addAttribute(new Attribute(CDM.LONG_NAME, "index on report - in memory")); int pos = 0; Variable v = reportIndex.addMemberVariable(new Variable(ncfile, null, reportIndex, "stationName", DataType.CHAR, "")); v.setDimensionsAnonymous(new int[]{6}); v.addAttribute(new Attribute(CDM.LONG_NAME, "name of station")); v.addAttribute(new Attribute("standard_name", "station_name")); v.setSPobject(new Vinfo(pos)); pos += 6; v = reportIndex.addMemberVariable(new Variable(ncfile, null, reportIndex, "time", DataType.INT, "")); v.addAttribute(new Attribute(CDM.UNITS, "secs since 1970-01-01 00:00")); v.addAttribute(new Attribute(CDM.LONG_NAME, "observation time")); v.setSPobject(new Vinfo(pos)); pos += 4; return reportIndex; }
dist.setDimensions(dims); ncfile.addVariable(null, dist); dist.addAttribute( new Attribute(CDM.LONG_NAME, "Vector Arrow Data"));
private Structure makeReportStructure() throws InvalidRangeException, IOException { Structure report = new Structure(ncfile, null, null, "report"); report.setDimensions("report"); report.addAttribute(new Attribute(CDM.LONG_NAME, "ON29 observation report")); int pos = 0;
private Structure makeStationStructure() throws IOException, InvalidRangeException { Structure station = new Structure(ncfile, null, null, "station"); station.setDimensions("station"); station.addAttribute(new Attribute(CDM.LONG_NAME, "unique stations within this file"));
private Structure makeStationStructure() throws IOException, InvalidRangeException { Structure station = new Structure(ncfile, null, null, "station"); station.setDimensions("station"); station.addAttribute(new Attribute(CDM.LONG_NAME, "unique stations within this file"));
private Structure makeStationStructure() throws IOException, InvalidRangeException { Structure station = new Structure(ncfile, null, null, "station"); station.setDimensions("station"); station.addAttribute(new Attribute(CDM.LONG_NAME, "unique stations within this file"));