Examples of NetcdfDataset


Examples of ucar.nc2.dataset.NetcdfDataset

    FeatureType ft = FeatureType.getType(fType);

    if (ft == null || ft == FeatureType.NONE || ft == FeatureType.GRID) {
      CdmRemote ncremote = new CdmRemote(uri);
      NetcdfDataset ncd = new NetcdfDataset(ncremote, null);
      return new GridDataset(ncd);

    } else {
      List<VariableSimpleIF> dataVars = FeatureDatasetPointXML.getDataVariables(doc);
      LatLonRect bb = FeatureDatasetPointXML.getSpatialExtent(doc);
View Full Code Here

Examples of ucar.nc2.dataset.NetcdfDataset

      if (ncml == null) {
        gds = GridDataset.open( mfile.getPath());

      } else {
        NetcdfFile nc = NetcdfDataset.acquireFile(mfile.getPath(), null);
        NetcdfDataset ncd = NcMLReader.mergeNcML(nc, ncml); // create new dataset
        ncd.enhance(); // now that the ncml is added, enhance "in place", ie modify the NetcdfDataset
        gds = new GridDataset(ncd);
      }

      // System.out.println("gds dataset= "+ gds.getNetcdfDataset());
View Full Code Here

Examples of ucar.nc2.dataset.NetcdfDataset

      }

      return result;
    }

    NetcdfDataset ncd = openDataset(invDataset, true, task, result.errLog);
    if (null != ncd)
      result.featureDataset = FeatureDatasetFactoryManager.wrap(result.featureType, ncd, task, result.errLog);

    if (null == result.featureDataset)
      result.fatalError = true;
View Full Code Here

Examples of ucar.nc2.dataset.NetcdfDataset

      result.featureDataset = CdmrFeatureDataset.factory(wantFeatureType, access.getStandardUrlName());

    } else {

      // all other datatypes
      NetcdfDataset ncd = openDataset(access, true, task, result);
      if (null != ncd) {
        result.featureDataset = FeatureDatasetFactoryManager.wrap(result.featureType, ncd, task, result.errLog);
      }
    }
View Full Code Here

Examples of ucar.nc2.dataset.NetcdfDataset

   * @return NetcdfDataset or null if failure
   * @throws IOException on read error
   */
  public NetcdfDataset openDataset(InvDataset invDataset, boolean acquire, ucar.nc2.util.CancelTask task, Formatter log) throws IOException {
    Result result = new Result();
    NetcdfDataset ncd = openDataset(invDataset, acquire, task, result);
    if (log != null) log.format("%s", result.errLog);
    return (result.fatalError) ? null : ncd;
  }
View Full Code Here

Examples of ucar.nc2.dataset.NetcdfDataset

        accessList = new ArrayList<InvAccess>(rds.getAccess());
        continue;
      }

      // ready to open it through netcdf API
      NetcdfDataset ds;

// try to open
      try {
        ds = openDataset(access, acquire, task, result);
View Full Code Here

Examples of ucar.nc2.dataset.NetcdfDataset

   * @return NetcdfDataset or null if failure
   * @throws IOException on read error
   */
  public NetcdfDataset openDataset(InvAccess access, boolean acquire, ucar.nc2.util.CancelTask task, Formatter log) throws IOException {
    Result result = new Result();
    NetcdfDataset ncd = openDataset(access, acquire, task, result);
    if (log != null) log.format("%s", result.errLog);
    return (result.fatalError) ? null : ncd;
  }
View Full Code Here

Examples of ucar.nc2.dataset.NetcdfDataset

      if (rds == null) return null;
      return openDataset(rds, acquire, task, result);
    }

    // ready to open it through netcdf API
    NetcdfDataset ds;

    // open DODS type
    if ((serviceType == ServiceType.OPENDAP) || (serviceType == ServiceType.DODS)) {
      String curl = DODSNetcdfFile.canonicalURL(datasetLocation);
      ds = acquire ? NetcdfDataset.acquireDataset(curl, enhanceMode, task) : NetcdfDataset.openDataset(curl, enhanceMode, task);
    }

    // open CdmRemote
    else if (serviceType == ServiceType.CdmRemote) {
      String curl = CdmRemote.canonicalURL(datasetLocation);
      ds = acquire ? NetcdfDataset.acquireDataset(curl, enhanceMode, task) : NetcdfDataset.openDataset(curl, enhanceMode, task);
    }

    /* open ADDE type
   else if (serviceType == ServiceType.ADDE) {
     try {
       ds = ucar.nc2.adde.AddeDatasetFactory.openDataset(access, task);

     } catch (IOException e) {
       log.append("Cant open as ADDE dataset= "+datasetLocation);
       accessList.remove( access);
       continue;
     }
   } */

    else {
      // open through NetcdfDataset API
      ds = acquire ? NetcdfDataset.acquireDataset(datasetLocation, enhanceMode, task) : NetcdfDataset.openDataset(datasetLocation, enhanceMode, task);
    }

    if (ds != null) {
      ds.setId(datasetId);
      ds.setTitle(title);
      annotate(invDataset, ds);
    }

    // see if there's metadata LOOK whats this
    List list = invDataset.getMetadata(MetadataType.NcML);
View Full Code Here

Examples of ucar.nc2.dataset.NetcdfDataset

    assert str.equals("http://www.opendap.org") || str.equals("http://www.dods.org") : str;
  }

  public void testDODSwithDataset() throws IOException {
    DODSNetcdfFile dodsfile = TestDODSRead.open("test.04");
    NetcdfDataset ds = new  NetcdfDataset( dodsfile, false);

    // bug in forming dods name
    Variable v = null;
    assert null != (v = ds.findVariable("types.b"));
    v.invalidateCache();
    v.read();
  }
View Full Code Here

Examples of ucar.nc2.dataset.NetcdfDataset

    System.out.println("--Compare "+localPath+" to "+dodsUrl);
    compareDatasets(dodsUrl, localPath);
  }

  private void compareDatasets(String dodsUrl, String ncfile) throws IOException {
    NetcdfDataset org_ncfile = NetcdfDataset.openDataset(ncfile);
    NetcdfDataset dods_file = NetcdfDataset.openDataset(dodsUrl);
    compareDatasets( org_ncfile, dods_file);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.