Package ucar.nc2.constants

Examples of ucar.nc2.constants.AxisType


            throws IOException {

        String        vert_unit = null;
        String        vert_type;
        ArrayFloat.D1 data     = new ArrayFloat.D1(n_levels);
        AxisType      axisType = null;

        switch (vert_sys) {

          case (0) :
              vert_unit = null;
              vert_type = "height";
              break;

          case (1) :
          case (2) :
              vert_unit = "km";
              vert_type = "altitude";
              axisType  = AxisType.Height;
              break;

          case (3) :
              vert_unit = "mbar";
              vert_type = "pressure";
              axisType  = AxisType.Pressure;
              break;

          default :
              throw new IOException("vert_sys unknown");
        }

        Variable vertVar = new Variable(ncfile, null, null, vert_type);
        vertVar.setDimensions(LEVEL);
        vertVar.setDataType(DataType.FLOAT);
        if (vert_unit != null) {
            vertVar.addAttribute(new Attribute(CF.UNITS, vert_unit));
        }
        if (axisType != null) {
            vertVar.addAttribute(new Attribute(_Coordinate.AxisType,
                    axisType.toString()));
        }

        switch (vert_sys) {

          case (0) :
View Full Code Here


    HashMap<AxisType, VarProcess> map = new HashMap<AxisType, VarProcess>();

    // find existing axes, so we dont duplicate
    for (VarProcess vp : varList) {
      if (vp.isCoordinateAxis) {
        AxisType atype = getAxisType(ds, (VariableEnhanced) vp.v);
        if (atype != null)
          map.put(atype, vp);
      }
    }

    // look for variables to turn into axes
    for (VarProcess vp : varList) {
      if (vp.isCoordinateVariable) continue;
      Variable ncvar = vp.v;
      if (!(ncvar instanceof VariableDS)) continue; // cant be a structure

      AxisType atype = getAxisType(ds, (VariableEnhanced) vp.v);
      if (atype != null) {
        if (map.get(atype) == null) {
          vp.isCoordinateAxis = true;
          parseInfo.format(" Coordinate Axis added (GDV forced) = %s  for axis %s\n", vp.v.getFullName(), atype);
        }
View Full Code Here

      for (String vertical_coord : vertical_coords)
        if (sname.equalsIgnoreCase(vertical_coord))
          return AxisType.GeoZ;
    }

    AxisType at = super.getAxisType(ncDataset, v);

    // check axis attribute - only for X, Y, Z
    if (at == null) {
      String axis = ncDataset.findAttValueIgnoreCase((Variable) v, "axis", null);
      if (axis != null) {
View Full Code Here

    varElem.setAttribute("shape", getShapeString(axis.getShape())); // axis.getDimensionsString());

    DataType dt = axis.getDataType();
    varElem.setAttribute("type", dt.toString());

    AxisType axisType = axis.getAxisType();
    if (null != axisType)
      varElem.setAttribute("axisType", axisType.toString());

    // attributes
    for (Attribute att : axis.getAttributes())
      varElem.addContent(ucar.nc2.ncml.NcMLWriter.writeAttribute(att, "attribute", null));
View Full Code Here

    varElem.setAttribute("shape", getShapeString(axis.getShape())); // axis.getDimensionsString());

    DataType dt = axis.getDataType();
    varElem.setAttribute("type", dt.toString());

    AxisType axisType = axis.getAxisType();
    if (null != axisType)
      varElem.setAttribute("axisType", axisType.toString());

    // attributes
    for (Attribute att : axis.getAttributes()) {
      varElem.addContent(ucar.nc2.ncml.NcMLWriter.writeAttribute(att, "attribute", null));
    }
View Full Code Here

    // count vertical axes
    int countVertCooordAxes = 0;
    List axes = ncd.getCoordinateAxes();
    for (int i = 0; i < axes.size(); i++) {
      CoordinateAxis axis =  (CoordinateAxis) axes.get(i);
      AxisType t = axis.getAxisType();
      if ((t == AxisType.GeoZ) || (t == AxisType.Height) || (t == AxisType.Pressure) )
        countVertCooordAxes++;
    }

    if (showCount) {
View Full Code Here

    // count vertical axes
    int countVertCooordAxes = 0;
    List axes = ncd.getCoordinateAxes();
    for (int i = 0; i < axes.size(); i++) {
      CoordinateAxis axis =  (CoordinateAxis) axes.get(i);
      AxisType t = axis.getAxisType();
      if ((t == AxisType.GeoZ) || (t == AxisType.Height) || (t == AxisType.Pressure) )
        countVertCooordAxes++;
    }

    if (showCount) {
View Full Code Here

   * Standard  sort on Coordinate Axes
   */
  static public class AxisComparator implements java.util.Comparator<CoordinateAxis> {
    public int compare(CoordinateAxis c1, CoordinateAxis c2) {

      AxisType t1 = c1.getAxisType();
      AxisType t2 = c2.getAxisType();

      if ((t1 == null) && (t2 == null))
        return c1.getShortName().compareTo(c2.getShortName());
      if (t1 == null)
        return -1;
      if (t2 == null)
        return 1;

      return t1.axisOrder() - t2.axisOrder();
    }
View Full Code Here

    // count vertical axes
    int countVertCooordAxes = 0;
    List axes = gridDs.getNetcdfDataset().getCoordinateAxes();
    for (int i = 0; i < axes.size(); i++) {
      CoordinateAxis axis =  (CoordinateAxis) axes.get(i);
      AxisType t = axis.getAxisType();
      if ((t == AxisType.GeoZ) || (t == AxisType.Height) || (t == AxisType.Pressure) )
        countVertCooordAxes++;
    }

    Iterator iter = gridDs.getGridsets().iterator();
View Full Code Here

         */
        while (--targetDim >= 0) {
            final CoordinateAxis  axis = range.get(targetDim);
            final List<Dimension> axisDomain = axis.getDimensions();
            AttributeNames.Dimension attributeNames = null;
            final AxisType type = axis.getAxisType();
            if (type != null) switch (type) {
                case Lon:      attributeNames = AttributeNames.LONGITUDE; break;
                case Lat:      attributeNames = AttributeNames.LATITUDE; break;
                case Pressure: // Fallthrough: consider as Height
                case Height:   attributeNames = AttributeNames.VERTICAL; break;
View Full Code Here

TOP

Related Classes of ucar.nc2.constants.AxisType

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.