public TableConfig getConfig(FeatureType wantFeatureType, NetcdfDataset ds, Formatter errlog) throws IOException { TableConfig topTable = new TableConfig(Table.Type.Top, "singleTrajectory"); CoordinateAxis coordAxis = CoordSysEvaluator.findCoordByType(ds, AxisType.Time); if (coordAxis == null) { errlog.format("Cant find a time coordinate"); return null; } Dimension innerDim = coordAxis.getDimension(0); boolean obsIsStruct = Evaluator.hasRecordStructure(ds) && innerDim.isUnlimited(); TableConfig obsTable = new TableConfig(Table.Type.Structure, innerDim.getShortName()); obsTable.dimName = innerDim.getShortName(); obsTable.time = coordAxis.getFullName(); obsTable.structName = obsIsStruct ? "record" : innerDim.getShortName(); obsTable.structureType = obsIsStruct ? TableConfig.StructureType.Structure : TableConfig.StructureType.PsuedoStructure; CoordSysEvaluator.findCoordWithDimension(obsTable, ds, innerDim); topTable.addChild(obsTable); return topTable; } }
private TableConfig makeSingle(NetcdfDataset ds, Dimension obsDim, Formatter errlog) throws IOException { Table.Type obsTableType = Table.Type.Structure; TableConfig obsTable = new TableConfig(obsTableType, "single"); obsTable.dimName = obsDim.getShortName(); obsTable.lat = matchAxisTypeAndDimension(ds, AxisType.Lat, obsDim); obsTable.lon = matchAxisTypeAndDimension(ds, AxisType.Lon, obsDim); obsTable.elev = matchAxisTypeAndDimension(ds, AxisType.Height, obsDim); if (obsTable.elev == null) obsTable.elev = matchAxisTypeAndDimension(ds, AxisType.Pressure, obsDim); if (obsTable.elev == null) obsTable.elev = matchAxisTypeAndDimension(ds, AxisType.GeoZ, obsDim); obsTable.time = matchAxisTypeAndDimension(ds, AxisType.Time, obsDim); boolean obsIsStruct = Evaluator.hasRecordStructure(ds) && obsDim.isUnlimited(); obsTable.structName = obsIsStruct ? "record" : obsDim.getShortName(); obsTable.structureType = obsIsStruct ? TableConfig.StructureType.Structure : TableConfig.StructureType.PsuedoStructure; return obsTable; }
private TableConfig makeStructTable(NetcdfDataset ds, FeatureType ftype, EncodingInfo info, Formatter errlog) throws IOException { Table.Type tableType = Table.Type.Structure; if (info.encoding == Encoding.single) tableType = Table.Type.Top; if (info.encoding == Encoding.flat) tableType = Table.Type.ParentId; String name = (info.parentDim == null) ? " single" : info.parentDim.getShortName(); TableConfig tableConfig = new TableConfig(tableType, name); tableConfig.lat = matchAxisTypeAndDimension(ds, AxisType.Lat, info.parentDim); tableConfig.lon = matchAxisTypeAndDimension(ds, AxisType.Lon, info.parentDim); tableConfig.elev = matchAxisTypeAndDimension(ds, AxisType.Height, info.parentDim); if (tableConfig.elev == null) tableConfig.elev = matchAxisTypeAndDimension(ds, AxisType.Pressure, info.parentDim); if (tableConfig.elev == null) tableConfig.elev = matchAxisTypeAndDimension(ds, AxisType.GeoZ, info.parentDim); tableConfig.time = matchAxisTypeAndDimension(ds, AxisType.Time, info.parentDim); tableConfig.featureType = ftype; if (info.encoding != Encoding.single) { // set up structure boolean stnIsStruct = Evaluator.hasRecordStructure(ds) && info.parentDim.isUnlimited(); tableConfig.structureType = stnIsStruct ? TableConfig.StructureType.Structure : TableConfig.StructureType.PsuedoStructure; tableConfig.dimName = info.parentDim.getShortName(); tableConfig.structName = stnIsStruct ? "record" : tableConfig.dimName; } return tableConfig; }
private TableConfig makeRaggedContiguous(NetcdfDataset ds, Dimension parentDim, Dimension childDim, Variable ragged_rowSize, Formatter errlog) throws IOException { TableConfig obsTable = new TableConfig(Table.Type.Contiguous, childDim.getShortName()); obsTable.dimName = childDim.getShortName(); obsTable.lat = matchAxisTypeAndDimension(ds, AxisType.Lat, childDim); obsTable.lon = matchAxisTypeAndDimension(ds, AxisType.Lon, childDim); obsTable.elev = matchAxisTypeAndDimension(ds, AxisType.Height, childDim); if (obsTable.elev == null) obsTable.elev = matchAxisTypeAndDimension(ds, AxisType.Pressure, childDim); if (obsTable.elev == null) obsTable.elev = matchAxisTypeAndDimension(ds, AxisType.GeoZ, childDim); obsTable.time = matchAxisTypeAndDimension(ds, AxisType.Time, childDim); boolean obsIsStruct = Evaluator.hasRecordStructure(ds) && childDim.isUnlimited(); obsTable.structName = obsIsStruct ? "record" : childDim.getShortName(); obsTable.structureType = obsIsStruct ? TableConfig.StructureType.Structure : TableConfig.StructureType.PsuedoStructure; obsTable.numRecords = ragged_rowSize.getFullName(); return obsTable; }
private TableConfig makeRaggedIndex(NetcdfDataset ds, Dimension parentDim, Dimension childDim, Variable ragged_parentIndex, Formatter errlog) throws IOException { TableConfig obsTable = new TableConfig(Table.Type.ParentIndex, childDim.getShortName()); obsTable.dimName = childDim.getShortName(); obsTable.lat = matchAxisTypeAndDimension(ds, AxisType.Lat, childDim); obsTable.lon = matchAxisTypeAndDimension(ds, AxisType.Lon, childDim); obsTable.elev = matchAxisTypeAndDimension(ds, AxisType.Height, childDim); if (obsTable.elev == null) obsTable.elev = matchAxisTypeAndDimension(ds, AxisType.Pressure, childDim); if (obsTable.elev == null) obsTable.elev = matchAxisTypeAndDimension(ds, AxisType.GeoZ, childDim); obsTable.time = matchAxisTypeAndDimension(ds, AxisType.Time, childDim); boolean obsIsStruct = Evaluator.hasRecordStructure(ds) && childDim.isUnlimited(); obsTable.structName = obsIsStruct ? "record" : childDim.getShortName(); obsTable.structureType = obsIsStruct ? TableConfig.StructureType.Structure : TableConfig.StructureType.PsuedoStructure; obsTable.parentIndex = ragged_parentIndex.getFullName(); return obsTable; }
private TableConfig makeStructTableTestTraj(NetcdfDataset ds, FeatureType ftype, EncodingInfo info, Formatter errlog) throws IOException { Table.Type tableType = Table.Type.Structure; if (info.encoding == Encoding.single) tableType = Table.Type.Top; if (info.encoding == Encoding.flat) tableType = Table.Type.ParentId; String name = (info.parentDim == null) ? " single" : info.parentDim.getShortName(); TableConfig tableConfig = new TableConfig(tableType, name); tableConfig.lat = CoordSysEvaluator.findCoordNameByType(ds, AxisType.Lat); tableConfig.lon = CoordSysEvaluator.findCoordNameByType(ds, AxisType.Lon); tableConfig.elev = CoordSysEvaluator.findCoordNameByType(ds, AxisType.Height); if (tableConfig.elev == null) tableConfig.elev = CoordSysEvaluator.findCoordNameByType(ds, AxisType.Pressure); if (tableConfig.elev == null) tableConfig.elev = CoordSysEvaluator.findCoordNameByType(ds, AxisType.GeoZ); tableConfig.time = CoordSysEvaluator.findCoordNameByType(ds, AxisType.Time); tableConfig.featureType = ftype; if (info.encoding != Encoding.single) { // set up structure boolean stnIsStruct = Evaluator.hasRecordStructure(ds) && info.parentDim.isUnlimited(); tableConfig.structureType = stnIsStruct ? TableConfig.StructureType.Structure : TableConfig.StructureType.PsuedoStructure; tableConfig.dimName = info.parentDim.getShortName(); tableConfig.structName = stnIsStruct ? "record" : tableConfig.dimName; } return tableConfig; }
boolean hasStruct = Evaluator.hasRecordStructure(ds);
return null; boolean hasStruct = Evaluator.hasRecordStructure(ds);
return null; boolean hasStruct = Evaluator.hasRecordStructure(ds);
boolean hasStruct = Evaluator.hasRecordStructure(ds) && stationDim.isUnlimited(); stnTable.structureType = hasStruct ? TableConfig.StructureType.Structure : TableConfig.StructureType.PsuedoStructure; stnTable.dimName = stationDim.getShortName();
boolean hasStruct = Evaluator.hasRecordStructure(ds); FeatureType ft = Evaluator.getFeatureType(ds, ":thredds_data_type", errlog); if (null == ft) {
return null; boolean hasStruct = Evaluator.hasRecordStructure(ds);