private void annotateObs(Sequence recordStructure) { StandardFields.StandardFieldsFromStructure extract = new StandardFields.StandardFieldsFromStructure(centerId, recordStructure); Formatter f = new Formatter(); String name = extract.getFieldName(BufrCdmIndexProto.FldType.lat); if (name != null) f.format("%s ", name); name = extract.getFieldName(BufrCdmIndexProto.FldType.lon); if (name != null) f.format("%s ", name); name = extract.getFieldName(BufrCdmIndexProto.FldType.height); if (name != null) f.format("%s ", name); name = extract.getFieldName(BufrCdmIndexProto.FldType.heightAboveStation); if (name != null) f.format("%s ", name); recordStructure.addAttribute(new Attribute("coordinates", f.toString())); }
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "otherData"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[8])); int pos = 0; Variable v = seq.addMemberVariable(new Variable(ncfile, null, parent, "data", DataType.INT, "")); v.addAttribute(new Attribute(CDM.LONG_NAME, "additional data specified in table 101.1")); v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Pressure.toString())); v.setSPobject(new Vinfo(pos)); pos += 4; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "table101code", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.LONG_NAME, "code figure from table 101")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "indicatorFlags", DataType.CHAR, "")); v.setDimensionsAnonymous(new int[]{2}); v.addAttribute(new Attribute(CDM.LONG_NAME, "quality marks: 0=data, 1=form")); v.setSPobject(new Vinfo(pos)); pos += 2; return seq; }
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "otherData"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[8])); int pos = 0; Variable v = seq.addMemberVariable(new Variable(ncfile, null, parent, "data", DataType.INT, "")); v.addAttribute(new Attribute(CDM.LONG_NAME, "additional data specified in table 101.1")); v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Pressure.toString())); v.setSPobject(new Vinfo(pos)); pos += 4; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "table101code", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.LONG_NAME, "code figure from table 101")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "indicatorFlags", DataType.CHAR, "")); v.setDimensionsAnonymous(new int[]{2}); v.addAttribute(new Attribute(CDM.LONG_NAME, "quality marks: 0=data, 1=form")); v.setSPobject(new Vinfo(pos)); return seq; }
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "otherData"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[8])); int pos = 0; Variable v = seq.addMemberVariable(new Variable(ncfile, null, parent, "data", DataType.INT, "")); v.addAttribute(new Attribute(CDM.LONG_NAME, "additional data specified in table 101.1")); v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Pressure.toString())); v.setSPobject(new Vinfo(pos)); pos += 4; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "table101code", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.LONG_NAME, "code figure from table 101")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "indicatorFlags", DataType.CHAR, "")); v.setDimensionsAnonymous(new int[]{2}); v.addAttribute(new Attribute(CDM.LONG_NAME, "quality marks: 0=data, 1=form")); v.setSPobject(new Vinfo(pos)); return seq; }
String coordS = coordinates.toString(); if (!coordS.isEmpty()) recordStructure.addAttribute(new Attribute("coordinates", coordS));
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "clouds"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[7])); int pos = 0; Variable v = seq.addMemberVariable(new Variable(ncfile, null, parent, "pressure", DataType.FLOAT, "")); v.addAttribute(new Attribute(CDM.UNITS, "mbars")); v.addAttribute(new Attribute(CDM.LONG_NAME, "pressure level")); v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Pressure.toString())); v.setSPobject(new Vinfo(pos)); pos += 4; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "percentClouds", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.UNITS, "")); v.addAttribute(new Attribute(CDM.LONG_NAME, "amount of cloudiness (%)")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "qualityFlags", DataType.CHAR, "")); v.setDimensionsAnonymous(new int[]{2}); v.addAttribute(new Attribute(CDM.LONG_NAME, "quality marks: 0=pressure, 1=percentClouds")); v.setSPobject(new Vinfo(pos)); return seq; }
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "clouds"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[7])); int pos = 0; Variable v = seq.addMemberVariable(new Variable(ncfile, null, parent, "pressure", DataType.FLOAT, "")); v.addAttribute(new Attribute(CDM.UNITS, "mbars")); v.addAttribute(new Attribute(CDM.LONG_NAME, "pressure level")); v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Pressure.toString())); v.setSPobject(new Vinfo(pos)); pos += 4; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "percentClouds", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.UNITS, "")); v.addAttribute(new Attribute(CDM.LONG_NAME, "amount of cloudiness (%)")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "qualityFlags", DataType.CHAR, "")); v.setDimensionsAnonymous(new int[]{2}); v.addAttribute(new Attribute(CDM.LONG_NAME, "quality marks: 0=pressure, 1=percentClouds")); v.setSPobject(new Vinfo(pos)); return seq; }
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "clouds"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[7])); int pos = 0; Variable v = seq.addMemberVariable(new Variable(ncfile, null, parent, "pressure", DataType.FLOAT, "")); v.addAttribute(new Attribute(CDM.UNITS, "mbars")); v.addAttribute(new Attribute(CDM.LONG_NAME, "pressure level")); v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Pressure.toString())); v.setSPobject(new Vinfo(pos)); pos += 4; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "percentClouds", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.UNITS, "")); v.addAttribute(new Attribute(CDM.LONG_NAME, "amount of cloudiness (%)")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "qualityFlags", DataType.CHAR, "")); v.setDimensionsAnonymous(new int[]{2}); v.addAttribute(new Attribute(CDM.LONG_NAME, "quality marks: 0=pressure, 1=percentClouds")); v.setSPobject(new Vinfo(pos)); pos += 2; return seq; }
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "windHeightLevels"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[4])); int pos = 0; Variable v = seq.addMemberVariable(new Variable(ncfile, null, parent, "geopotential", DataType.FLOAT, "")); v.addAttribute(new Attribute(CDM.UNITS, "meter")); v.addAttribute(new Attribute(CDM.LONG_NAME, "geopotential")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, 99999.0f)); v.setSPobject(new Vinfo(pos)); pos += 4; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "windDir", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.UNITS, "degrees")); v.addAttribute(new Attribute(CDM.LONG_NAME, "wind direction")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "windSpeed", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.UNITS, "knots")); v.addAttribute(new Attribute(CDM.LONG_NAME, "wind speed")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "qualityFlags", DataType.CHAR, "")); v.setDimensionsAnonymous(new int[]{2}); v.addAttribute(new Attribute(CDM.LONG_NAME, "quality marks: 0=geopot, 1=wind")); v.setSPobject(new Vinfo(pos)); return seq; }
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "windHeightLevels"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[4])); int pos = 0; Variable v = seq.addMemberVariable(new Variable(ncfile, null, parent, "geopotential", DataType.FLOAT, "")); v.addAttribute(new Attribute(CDM.UNITS, "meter")); v.addAttribute(new Attribute(CDM.LONG_NAME, "geopotential")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, 99999.0f)); v.setSPobject(new Vinfo(pos)); pos += 4; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "windDir", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.UNITS, "degrees")); v.addAttribute(new Attribute(CDM.LONG_NAME, "wind direction")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "windSpeed", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.UNITS, "knots")); v.addAttribute(new Attribute(CDM.LONG_NAME, "wind speed")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "qualityFlags", DataType.CHAR, "")); v.setDimensionsAnonymous(new int[]{2}); v.addAttribute(new Attribute(CDM.LONG_NAME, "quality marks: 0=geopot, 1=wind")); v.setSPobject(new Vinfo(pos)); pos += 2; return seq; }
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "windHeightLevels"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[4])); int pos = 0; Variable v = seq.addMemberVariable(new Variable(ncfile, null, parent, "geopotential", DataType.FLOAT, "")); v.addAttribute(new Attribute(CDM.UNITS, "meter")); v.addAttribute(new Attribute(CDM.LONG_NAME, "geopotential")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, 99999.0f)); v.setSPobject(new Vinfo(pos)); pos += 4; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "windDir", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.UNITS, "degrees")); v.addAttribute(new Attribute(CDM.LONG_NAME, "wind direction")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "windSpeed", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.UNITS, "knots")); v.addAttribute(new Attribute(CDM.LONG_NAME, "wind speed")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "qualityFlags", DataType.CHAR, "")); v.setDimensionsAnonymous(new int[]{2}); v.addAttribute(new Attribute(CDM.LONG_NAME, "quality marks: 0=geopot, 1=wind")); v.setSPobject(new Vinfo(pos)); return seq; }
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "windPressureLevels"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[3])); int pos = 0; Variable v = seq.addMemberVariable(new Variable(ncfile, null, parent, "pressure", DataType.FLOAT, "")); v.addAttribute(new Attribute(CDM.UNITS, "mbars")); v.addAttribute(new Attribute(CDM.LONG_NAME, "pressure level")); v.addAttribute(new Attribute("accuracy", "mbar/10")); v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Pressure.toString())); v.setSPobject(new Vinfo(pos)); pos += 4; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "windDir", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.UNITS, "degrees")); v.addAttribute(new Attribute(CDM.LONG_NAME, "wind direction")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "windSpeed", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.UNITS, "knots")); v.addAttribute(new Attribute(CDM.LONG_NAME, "wind speed")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "qualityFlags", DataType.CHAR, "")); v.setDimensionsAnonymous(new int[]{2}); v.addAttribute(new Attribute(CDM.LONG_NAME, "quality marks: 0=pressure, 1=wind")); v.setSPobject(new Vinfo(pos)); return seq; }
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "windPressureLevels"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[3])); int pos = 0; Variable v = seq.addMemberVariable(new Variable(ncfile, null, parent, "pressure", DataType.FLOAT, "")); v.addAttribute(new Attribute(CDM.UNITS, "mbars")); v.addAttribute(new Attribute(CDM.LONG_NAME, "pressure level")); v.addAttribute(new Attribute("accuracy", "mbar/10")); v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Pressure.toString())); v.setSPobject(new Vinfo(pos)); pos += 4; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "windDir", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.UNITS, "degrees")); v.addAttribute(new Attribute(CDM.LONG_NAME, "wind direction")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "windSpeed", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.UNITS, "knots")); v.addAttribute(new Attribute(CDM.LONG_NAME, "wind speed")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "qualityFlags", DataType.CHAR, "")); v.setDimensionsAnonymous(new int[]{2}); v.addAttribute(new Attribute(CDM.LONG_NAME, "quality marks: 0=pressure, 1=wind")); v.setSPobject(new Vinfo(pos)); return seq; }
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "windPressureLevels"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[3])); int pos = 0; Variable v = seq.addMemberVariable(new Variable(ncfile, null, parent, "pressure", DataType.FLOAT, "")); v.addAttribute(new Attribute(CDM.UNITS, "mbars")); v.addAttribute(new Attribute(CDM.LONG_NAME, "pressure level")); v.addAttribute(new Attribute("accuracy", "mbar/10")); v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Pressure.toString())); v.setSPobject(new Vinfo(pos)); pos += 4; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "windDir", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.UNITS, "degrees")); v.addAttribute(new Attribute(CDM.LONG_NAME, "wind direction")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "windSpeed", DataType.SHORT, "")); v.addAttribute(new Attribute(CDM.UNITS, "knots")); v.addAttribute(new Attribute(CDM.LONG_NAME, "wind speed")); v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999)); v.setSPobject(new Vinfo(pos)); pos += 2; v = seq.addMemberVariable(new Variable(ncfile, null, parent, "qualityFlags", DataType.CHAR, "")); v.setDimensionsAnonymous(new int[]{2}); v.addAttribute(new Attribute(CDM.LONG_NAME, "quality marks: 0=pressure, 1=wind")); v.setSPobject(new Vinfo(pos)); pos += 2; return seq; }
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "tempPressureLevels"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[2]));
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "tempPressureLevels"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[2]));
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "tempPressureLevels"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[2]));
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "tropopause"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[5]));
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "tropopause"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[5]));
Structure makeStructure(Structure parent) throws InvalidRangeException { Sequence seq = new Sequence(ncfile, null, parent, "mandatoryLevels"); seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[1]));