Java Code Examples for ucar.nc2.constants.FeatureType#TRAJECTORY

The following examples show how to use ucar.nc2.constants.FeatureType#TRAJECTORY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MadisAcars.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public boolean isMine(FeatureType wantFeatureType, NetcdfDataset ds) {
  if ((wantFeatureType != FeatureType.ANY_POINT) && (wantFeatureType != FeatureType.TRAJECTORY))
    return false;

  String title = ds.getRootGroup().findAttributeString("title", null);
  if (!"MADIS ACARS data".equals(title))
    return false;

  if (!ds.hasUnlimitedDimension())
    return false;
  if (ds.findDimension("recNum") == null)
    return false;

  VNames vn = getVariableNames(ds, null);
  if (ds.findVariable(vn.lat) == null)
    return false;
  if (ds.findVariable(vn.lon) == null)
    return false;
  if (ds.findVariable(vn.obsTime) == null)
    return false;
  return ds.findVariable(TRAJ_ID) != null;

}
 
Example 2
Source File: MadisAcars.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public TableConfig getConfig(FeatureType wantFeatureType, NetcdfDataset ds, Formatter errlog) {
  VNames vn = getVariableNames(ds, errlog);

  TableConfig trajTable = new TableConfig(Table.Type.Construct, "trajectory");
  trajTable.featureType = FeatureType.TRAJECTORY;
  trajTable.feature_id = TRAJ_ID;

  TableConfig obs = new TableConfig(Table.Type.ParentId, "record");
  obs.parentIndex = TRAJ_ID;
  obs.dimName = Evaluator.getDimensionName(ds, "recNum", errlog);
  obs.time = vn.obsTime;
  obs.timeNominal = vn.nominalTime;

  // obs.stnId = vn.stnId;
  // obs.stnDesc = vn.stnDesc;
  obs.lat = vn.lat;
  obs.lon = vn.lon;
  obs.elev = vn.elev;

  trajTable.addChild(obs);
  return trajTable;
}
 
Example 3
Source File: TableAnalyzer.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private void checkIfTrajectory(TableConfig st) {
  // deal with possible trajectory - only do this if dataset has metadata
  FeatureType ft = FeatureDatasetFactoryManager.findFeatureType(ds);
  if (ft == FeatureType.TRAJECTORY) {
    st.featureType = FeatureType.TRAJECTORY;
    TableConfig pc = new TableConfig(Table.Type.Top, "single");
    st.parent = pc;
    pc.addChild(st);
  } else
    st.featureType = FeatureType.POINT;
}
 
Example 4
Source File: ZebraClassTrajectoryObsDataset.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public FeatureType getScientificDataType() {
  return FeatureType.TRAJECTORY;
}
 
Example 5
Source File: COSMICTrajectoryObsDataset.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public FeatureType getScientificDataType() {
  return FeatureType.TRAJECTORY;
}
 
Example 6
Source File: UnidataTrajectoryObsDataset2.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public FeatureType getScientificDataType() {
  return FeatureType.TRAJECTORY;
}
 
Example 7
Source File: Float10TrajectoryObsDataset.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public FeatureType getScientificDataType() {
  return FeatureType.TRAJECTORY;
}
 
Example 8
Source File: RafTrajectoryObsDataset.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public FeatureType getScientificDataType() {
  return FeatureType.TRAJECTORY;
}
 
Example 9
Source File: UnidataTrajectoryObsDataset.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public FeatureType getScientificDataType() {
  return FeatureType.TRAJECTORY;
}
 
Example 10
Source File: SimpleTrajectoryObsDataset.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public FeatureType getScientificDataType() {
  return FeatureType.TRAJECTORY;
}
 
Example 11
Source File: ARMTrajectoryObsDataset.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public FeatureType getScientificDataType() {
  return FeatureType.TRAJECTORY;
}
 
Example 12
Source File: TrajectoryFeatureImpl.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Nonnull
@Override
public FeatureType getCollectionFeatureType() {
  return FeatureType.TRAJECTORY;
}
 
Example 13
Source File: PointDatasetStandardFactory.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
PointDatasetStandard(FeatureType wantFeatureType, TableAnalyzer analyser, NetcdfDataset ds, Formatter errlog) {
  super(ds, null);
  parseInfo.format(" PointFeatureDatasetImpl=%s%n", getClass().getName());
  this.analyser = analyser;

  List<DsgFeatureCollection> featureCollections = new ArrayList<>();
  for (NestedTable flatTable : analyser.getFlatTables()) { // each flat table becomes a "feature collection"

    CalendarDateUnit timeUnit;
    try {
      timeUnit = flatTable.getTimeUnit();
    } catch (Exception e) {
      if (null != errlog)
        errlog.format("%s%n", e.getMessage());
      timeUnit = CalendarDateUnit.unixDateUnit;
    }

    String altUnits = flatTable.getAltUnits();

    // create member variables
    dataVariables = new ArrayList<>(flatTable.getDataVariables());

    featureType = flatTable.getFeatureType(); // hope they're all the same
    if (flatTable.getFeatureType() == FeatureType.POINT)
      featureCollections.add(new StandardPointCollectionImpl(flatTable, timeUnit, altUnits));

    else if (flatTable.getFeatureType() == FeatureType.PROFILE)
      featureCollections.add(new StandardProfileCollectionImpl(flatTable, timeUnit, altUnits));

    else if (flatTable.getFeatureType() == FeatureType.STATION)
      featureCollections.add(new StandardStationCollectionImpl(flatTable, timeUnit, altUnits));

    else if (flatTable.getFeatureType() == FeatureType.STATION_PROFILE)
      featureCollections.add(new StandardStationProfileCollectionImpl(flatTable, timeUnit, altUnits));

    else if (flatTable.getFeatureType() == FeatureType.TRAJECTORY_PROFILE)
      featureCollections.add(new StandardSectionCollectionImpl(flatTable, timeUnit, altUnits));

    else if (flatTable.getFeatureType() == FeatureType.TRAJECTORY)
      featureCollections.add(new StandardTrajectoryCollectionImpl(flatTable, timeUnit, altUnits));
  }

  if (featureCollections.isEmpty())
    throw new IllegalStateException("No feature collections found");

  setPointFeatureCollection(featureCollections);
}
 
Example 14
Source File: StandardTrajectoryCollectionImpl.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
protected StandardTrajectoryCollectionImpl(String name, CalendarDateUnit timeUnit, String altUnits) {
  super(name, timeUnit, altUnits, FeatureType.TRAJECTORY);
}
 
Example 15
Source File: StandardTrajectoryCollectionImpl.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
StandardTrajectoryCollectionImpl(NestedTable ft, CalendarDateUnit timeUnit, String altUnits) {
  super(ft.getName(), timeUnit, altUnits, FeatureType.TRAJECTORY);
  this.ft = ft;
  this.extras = ft.getExtras();
}