Package ucar.nc2.dataset

Examples of ucar.nc2.dataset.CoordinateAxis


    if (null == axis) throw new IllegalArgumentException("There is no time coordinate");
    return readValue( axis, fromVar, index);
  }

  public double readGeoXCoord(Variable fromVar, int[] index) throws IOException, InvalidRangeException {
    CoordinateAxis axis = cs.getXaxis();
    if (null == axis) throw new IllegalArgumentException("There is no GeoX coordinate");
    return readValue( axis, fromVar, index);
  }
View Full Code Here


    if (null == axis) throw new IllegalArgumentException("There is no GeoX coordinate");
    return readValue( axis, fromVar, index);
  }

  public double readGeoYCoord(Variable fromVar, int[] index) throws IOException, InvalidRangeException {
    CoordinateAxis axis = cs.getYaxis();
    if (null == axis) throw new IllegalArgumentException("There is no GeoY coordinate");
    return readValue( axis, fromVar, index);
  }
View Full Code Here

    if (null == axis) throw new IllegalArgumentException("There is no GeoY coordinate");
    return readValue( axis, fromVar, index);
  }

  public double readGeoZCoord(Variable fromVar, int[] index) throws IOException, InvalidRangeException {
    CoordinateAxis axis = cs.getZaxis();
    if (null == axis) throw new IllegalArgumentException("There is no GeoZ coordinate");
    return readValue( axis, fromVar, index);
  }
View Full Code Here

   * @param ds look in this dataset's "Best" coordinate system.
   * @param atype look for this type of CoordinateAxis. takes the first one it finds.
    * @return the found CoordinateAxis name, or null if none
   */
   static public String findCoordNameByType(NetcdfDataset ds, AxisType atype) {
     CoordinateAxis coordAxis = findCoordByType(ds, atype);
     return coordAxis == null ? null : coordAxis.getFullName();
   }
View Full Code Here

     CoordinateAxis coordAxis = findCoordByType(ds, atype);
     return coordAxis == null ? null : coordAxis.getFullName();
   }

  static public String findCoordShortNameByType(NetcdfDataset ds, AxisType atype) {
    CoordinateAxis coordAxis = findCoordByType(ds, atype);
    return coordAxis == null ? null : coordAxis.getShortName();
  }
View Full Code Here

   * @param ds look in this dataset's "Best" coordinate system.
   * @param atype look for this type of CoordinateAxis. takes the first one it finds.
   * @return the found CoordinateAxis' first Dimension, or null if none or scalar
   */
  static public Dimension findDimensionByType(NetcdfDataset ds, AxisType atype) {
    CoordinateAxis axis = findCoordByType(ds, atype);
    if (axis == null) return null;
    if (axis.isScalar()) return null;
    return axis.getDimension(0);
  }
View Full Code Here

    Variable latVar = null, timeVar = null;

    // identify key variables
    List axes = ds.getCoordinateAxes();
    for (int i = 0; i < axes.size(); i++) {
      CoordinateAxis axis = (CoordinateAxis) axes.get(i);
      if (axis.getAxisType() == AxisType.Lat)
        latVar = axis;
      if (axis.getAxisType() == AxisType.Time)
        timeVar = axis;
    }

    // lat, lon are always in the outer; gotta use name to fetch wrapping variable
    Structure outerSequence = getWrappingParent(ds, latVar);
View Full Code Here

    super(ds);

    // identify key variables
    List axes = ds.getCoordinateAxes();
    for (int i = 0; i < axes.size(); i++) {
      CoordinateAxis axis = (CoordinateAxis) axes.get(i);
      if (axis.getAxisType() == AxisType.Lat)
        latVar = axis;
      if (axis.getAxisType() == AxisType.Lon)
        lonVar = axis;
      if (axis.getAxisType() == AxisType.Height)
        altVar = axis;
      if (axis.getAxisType() == AxisType.Time)
        timeVar = axis;
    }

    if (latVar == null) {
      parseInfo.append("Missing latitude variable");
View Full Code Here

    if (var == null) return null;
    return var.getShortName();
  }

  protected CoordinateAxis findZAxisNotStationAlt(NetcdfDataset ds) {
    CoordinateAxis z = CoordSysEvaluator.findCoordByType(ds, AxisType.Height, new CoordSysEvaluator.Predicate() {
      public boolean match(CoordinateAxis axis) {
        Attribute stdName = axis.findAttribute(CF.STANDARD_NAME);
        return ((stdName == null) || !CF.STATION_ALTITUDE.equals(stdName.getStringValue()));
      }
    });
View Full Code Here

  public static void test1() throws IOException {
    String filename = "D:/work/asaScience/EGM200_3.ncml";
    GridDataset gds = GridDataset.open(filename);
    GeoGrid grid = gds.findGridByName("u_wind");
    GridCoordSystem gcs = grid.getCoordinateSystem();
    CoordinateAxis lonAxis = gcs.getXHorizAxis();
    assert lonAxis instanceof CoordinateAxis2D;
    CoordinateAxis latAxis = gcs.getYHorizAxis();
    assert latAxis instanceof CoordinateAxis2D;

    GridCoordinate2D g2d = new GridCoordinate2D((CoordinateAxis2D) latAxis, (CoordinateAxis2D) lonAxis);
    doOne(g2d, 35.0, -6.0);
    doOne(g2d, 34.667302, -5.008376); // FAIL
View Full Code Here

TOP

Related Classes of ucar.nc2.dataset.CoordinateAxis

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.