Examples of sendIospMessage()


Examples of ucar.nc2.NetcdfFile.sendIospMessage()

  static void readFromNetcdf(String filename) throws IOException {
    long start = System.currentTimeMillis();

    NetcdfFile ncfile = NetcdfFile.open(filename);
    ncfile.sendIospMessage(NetcdfFile.IOSP_MESSAGE_ADD_RECORD_STRUCTURE);

    Structure record = (Structure) ncfile.findVariable("record");
    List<Variable> members = record.getVariables();
    for (Variable v : members) {
      if (v.getDataType() != DataType.CHAR)
View Full Code Here

Examples of ucar.nc2.dataset.NetcdfDataset.sendIospMessage()

    // otherwise open as netcdf and have a look. use NetcdfDataset in order to deal with scale/enhance, etc.
    NetcdfDataset ncfile = NetcdfDataset.acquireDataset( location, task);

    // add record variable if there is one.
    ncfile.sendIospMessage(NetcdfFile.IOSP_MESSAGE_ADD_RECORD_STRUCTURE);

    if (UnidataStationObsDataset.isValidFile( ncfile))
      return new UnidataStationObsDataset( ncfile);

    if (UnidataPointObsDataset.isValidFile( ncfile))
View Full Code Here

Examples of ucar.nc2.dataset.NetcdfDataset.sendIospMessage()

  private void convertAsNcdataset(String location, boolean useRecords) throws IOException {
    location = StringUtil.replace(location, '\\', "/");

    NetcdfDataset org_ncd = NetcdfDataset.openDataset(location, false, null);
    if (useRecords)
      org_ncd.sendIospMessage(NetcdfFile.IOSP_MESSAGE_ADD_RECORD_STRUCTURE);

    NcMLWriter writer = new NcMLWriter();
    if (showFiles) {
      System.out.println("-----------");
      System.out.println("DS input filename= "+location);
View Full Code Here

Examples of ucar.nc2.dataset.NetcdfDataset.sendIospMessage()

    }

    // read it back in
    NetcdfDataset new_ncd = NetcdfDataset.openDataset(ncmlOut, false, null);
    if (useRecords)
      new_ncd.sendIospMessage(NetcdfFile.IOSP_MESSAGE_ADD_RECORD_STRUCTURE);

    CompareNetcdf.compareFiles( org_ncd, new_ncd);
    //assert cat.equals( catV1);

    org_ncd.close();
View Full Code Here

Examples of ucar.nc2.dataset.NetcdfDataset.sendIospMessage()

    long start = System.currentTimeMillis();
    Map<String, ucar.unidata.geoloc.Station> staHash = new HashMap<String,ucar.unidata.geoloc.Station>();

    String location = "R:/testdata/sounding/netcdf/Upperair_20070401_0000.nc";
    NetcdfDataset ncfile =  NetcdfDataset.openDataset(location);
    ncfile.sendIospMessage(NetcdfFile.IOSP_MESSAGE_ADD_RECORD_STRUCTURE);

    // look through record varibles, for those that have "manLevel" dimension
    // make a StructureData object for those
    StructureMembers sm = new StructureMembers("manLevel");
    Dimension manDim = ncfile.findDimension("manLevel");
View Full Code Here

Examples of ucar.nc2.dataset.NetcdfDataset.sendIospMessage()

    nc.close();
  }

  public void testDatasetAddRecordAfter() throws InvalidRangeException, IOException {
    NetcdfDataset nc = NetcdfDataset.openDataset(TestLocal.cdmTestDataDir + "testWriteRecord.nc");
    assert (Boolean) nc.sendIospMessage(NetcdfFile.IOSP_MESSAGE_ADD_RECORD_STRUCTURE);

    // record variable
    Variable record = nc.findVariable("record");
    assert record instanceof StructureDS;
    StructureDS rs = (StructureDS) record;
View Full Code Here

Examples of ucar.nc2.iosp.IOServiceProvider.sendIospMessage()

    Class iospClass = NetcdfFile.class.getClassLoader().loadClass(iospClassName);
    IOServiceProvider spi = (IOServiceProvider) iospClass.newInstance(); // fail fast

    // send before iosp is opened
    if (iospMessage != null)
      spi.sendIospMessage(iospMessage);

    // get rid of file prefix, if any
    String uriString = location.trim();
    if (uriString.startsWith("file://"))
      uriString = uriString.substring(7);
View Full Code Here

Examples of ucar.nc2.iosp.IOServiceProvider.sendIospMessage()

    NetcdfFile result = new NetcdfFile(spi, raf, location, cancelTask);

    // send after iosp is opened
    if (iospMessage != null)
      spi.sendIospMessage(iospMessage);

    return result;
  }

  static private ucar.unidata.io.RandomAccessFile getRaf(String location, int buffer_size) throws IOException {
View Full Code Here

Examples of ucar.nc2.iosp.IOServiceProvider.sendIospMessage()

      throw new IOException("Cant read " + location + ": not a valid CDM file.");
    }

    // send before iosp is opened
    if (iospMessage != null)
      spi.sendIospMessage(iospMessage);

    if (log.isDebugEnabled())
      log.debug("Using IOSP " + spi.getClass().getName());

    NetcdfFile result = new NetcdfFile(spi, raf, location, cancelTask);
View Full Code Here

Examples of ucar.nc2.iosp.IOServiceProvider.sendIospMessage()

    NetcdfFile result = new NetcdfFile(spi, raf, location, cancelTask);

    // send after iosp is opened
    if (iospMessage != null)
      spi.sendIospMessage(iospMessage);

    return result;
  }

  ////////////////////////////////////////////////////////////////////////////////////////////////
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.