Package ucar.nc2.ncml

Examples of ucar.nc2.ncml.NcMLWriter


    if (coordinates != null) {
      String[] vars = coordinates.split(" ");
      for (String vname : vars) {
        Variable v = ds.findVariable(vname);
        if (v != null) {
          AxisType atype = getAxisType(ds, (VariableEnhanced) v);
          if (atype != null)
            v.addAttribute(new Attribute(_Coordinate.AxisType, atype.name()));
        }
      }
    }

  }
View Full Code Here


  }

  protected boolean hasXY(List<CoordinateAxis> coordAxes) {
    boolean hasX = false, hasY = false, hasLat = false, hasLon = false;
    for (CoordinateAxis axis : coordAxes) {
      AxisType axisType = axis.getAxisType();
      if (axisType == AxisType.GeoX) hasX = true;
      if (axisType == AxisType.GeoY) hasY = true;
      if (axisType == AxisType.Lat) hasLat = true;
      if (axisType == AxisType.Lon) hasLon = true;
    }
View Full Code Here

      if (vp.isCoordinateTransform && (vp.ct != null) && (vp.coordAxisTypes != null)) {
        List<AxisType> axisTypesList = new ArrayList<AxisType>();
        StringTokenizer stoker = new StringTokenizer(vp.coordAxisTypes);
        while (stoker.hasMoreTokens()) {
          String name = stoker.nextToken();
          AxisType atype;
          if (null != (atype = AxisType.getType(name)))
            axisTypesList.add(atype);
        }
        if (axisTypesList.size() > 0) {
          for (CoordinateSystem cs : ncDataset.getCoordinateSystems()) {
View Full Code Here

  private static void mergeOverwriteDataType( ThreddsMetadataBuilder first,
                                              ThreddsMetadataBuilder second,
                                              ThreddsMetadataBuilder mergedThreddsMetadata )
  {
    FeatureType dataType = second.getDataType() != null ? second.getDataType() : first.getDataType();
    if ( dataType != null )
      mergedThreddsMetadata.setDataType( dataType );
  }
View Full Code Here

          }

        } else if (elem.getName().equals("typedDatasetFactory")) {
          String typeName = elem.getAttributeValue("datatype");
          String className = elem.getAttributeValue("class");
          FeatureType datatype = FeatureType.valueOf(typeName.toUpperCase());
          if (null == datatype) {
            errlog.append("TypedDatasetFactory "+className+" unknown datatype= "+typeName+"\n");
            continue;
          }
View Full Code Here

    SimpleDateFormat format = new SimpleDateFormat("ddMMMyyyyHHmm");
    format.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
    try {
      Date d = format.parse(dateS+timeS);
      VariableDS time = new VariableDS(ds, vhrr, null, "time", DataType.LONG, "",
          "seconds since 1970-01-01 00:00", "time generated from PRODUCT_METADATA/PRODUCT_DETAILS");

      time.addAttribute( new Attribute(_Coordinate.AxisType, AxisType.Time.toString())); // // LOOK : cant handle scalar coordinates yet ??
      time.addAttribute( new Attribute("IsoDate", new DateFormatter().toDateTimeStringISO(d)));
      ds.addVariable(vhrr, time);
      ArrayLong.D0 timeData = new ArrayLong.D0();
      timeData.set(d.getTime() / 1000);
      time.setCachedData(timeData, true);

    } catch (ParseException e) {
      e.printStackTrace();
      throw new IOException(e.getMessage());
    }
View Full Code Here

    // attributes
    checkAll( org.getAttributes(), copy.getAttributes());

    // coord sys
    if ((org instanceof VariableEnhanced) && (copy instanceof VariableEnhanced) ) {
      VariableEnhanced orge = (VariableEnhanced) org;
      VariableEnhanced copye = (VariableEnhanced) copy;
      checkAll( orge.getCoordinateSystems(), copye.getCoordinateSystems());
    }

    // data !!
    if (compareData) {
      try {
View Full Code Here

    // attributes
    ok &= checkAll(org.getAttributes(), copy.getAttributes(), null);

    // coord sys
    if ((org instanceof VariableEnhanced) && (copy instanceof VariableEnhanced)) {
      VariableEnhanced orge = (VariableEnhanced) org;
      VariableEnhanced copye = (VariableEnhanced) copy;
      ok &= checkAll(orge.getCoordinateSystems(), copye.getCoordinateSystems(), null);
    }

    // data !!
    if (compareData) {
      try {
View Full Code Here

  private VerticalCT makeWRFEtaVerticalCoordinateTransform(NetcdfDataset ds, CoordinateSystem cs) {
    if ((null == ds.findVariable("PH")) || (null == ds.findVariable("PHB")) ||
        (null == ds.findVariable("P")) || (null == ds.findVariable("PB")))
      return null;

    WRFEtaTransformBuilder builder = new WRFEtaTransformBuilder(cs);
    return (VerticalCT) builder.makeCoordinateTransform(ds, null);
  }
View Full Code Here

  }
*/

  static private NetcdfFile acquireDODS(FileCache cache, FileFactory factory, Object hashKey,
                                        String location, int buffer_size, ucar.nc2.util.CancelTask cancelTask, Object spiObject) throws IOException {
    if (cache == null) return new DODSNetcdfFile(location, cancelTask);

    if (factory == null) factory = new DodsFactory();
    return (NetcdfFile) cache.acquire(factory, hashKey, location, buffer_size, cancelTask, spiObject);
  }
View Full Code Here

TOP

Related Classes of ucar.nc2.ncml.NcMLWriter

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.