Package ucar.nc2.iosp.netcdf3

Examples of ucar.nc2.iosp.netcdf3.N3iosp


    Array array = null;
    if (vi.classType == DataType.BYTE.getPrimitiveClassType()) {

      array = Array.factory(DataType.BYTE.getPrimitiveClassType(), v2.getShape(), data);
    } else if (vi.classType == DataType.SHORT.getPrimitiveClassType()) {
      EndianByteBuffer byteBuff = new EndianByteBuffer(data, vi.byteOrder);
      short[] sdata = byteBuff.getShortArray();
      //for(int i=0; i<sdata.length; i++){
      //  System.out.println(sdata[i]);
      //}
      array = Array.factory(DataType.SHORT.getPrimitiveClassType(), v2.getShape(), sdata);
    } else if (vi.classType == DataType.INT.getPrimitiveClassType()) {
      EndianByteBuffer byteBuff = new EndianByteBuffer(data, vi.byteOrder);
      short[] idata = byteBuff.getShortArray();
      array = Array.factory(DataType.INT.getPrimitiveClassType(), v2.getShape(), idata);

    } else {
      throw new UnsupportedEncodingException();
    }
View Full Code Here


    saveEdition = attr.get("grid_edition").equals("2") ? 2 : 1;
    version = Float.parseFloat(attr.get("index_version"));
    GridTableLookup lookup = (saveEdition == 2) ? getLookup2() : getLookup1();

    // make it into netcdf objects
    GridIndexToNC convert = new GridIndexToNC(raf);
    convert.open(index, lookup, saveEdition, ncfile, fmrcCoordSys, cancelTask);
    ncfile.finish();

    // may want to save index for debugging
    if (GridServiceProvider.debugOpen)
      gridIndexSave = index;
View Full Code Here

  protected void open(GridIndex index, CancelTask cancelTask) throws IOException {
    long start = System.currentTimeMillis();
    GridTableLookup lookup = (saveEdition == 2) ? getLookup2() : getLookup1();

    // make it into netcdf objects
    GridIndexToNC convert = new GridIndexToNC(index.filename);
    convert.open(index, lookup, saveEdition, ncfile, fmrcCoordSys, cancelTask);

    ncfile.finish();

    if (debugTiming) {
      long took = System.currentTimeMillis() - start;
View Full Code Here

    DataOutputStream stream;

    NetcdfFileStream(DataOutputStream stream) {
      super();
      this.stream = stream;
      swriter = new N3outputStreamWriter(this);
    }
View Full Code Here

    DataOutputStream stream;

    NetcdfFileStream(DataOutputStream stream) {
      super();
      this.stream = stream;
      swriter = new N3outputStreamWriter(this);
    }
View Full Code Here

  double streamOutputWriter(File f) throws IOException, InvalidRangeException {
    Socket s = new Socket(host, port);
    DataOutputStream stream = new DataOutputStream(new BufferedOutputStream(s.getOutputStream(), bufferSize));

    NetcdfFile ncfile = NetcdfFile.open(f.getPath());
    N3outputStreamWriter writer = new N3outputStreamWriter(ncfile);

    writer.writeHeader(stream, -1);
    writer.writeDataAll(stream);
    stream.close();

    stream.close();

    return ((double) f.length()) / (1000 * 1000);
 
View Full Code Here

    private ucar.unidata.io.RandomAccessFile myRaf;
    // private Nidsheader.Vinfo myInfo;
    protected UFheader headerParser;

    public boolean isValidFile(ucar.unidata.io.RandomAccessFile raf) {
        UFheader localHeader = new UFheader();
        return (localHeader.isValidFile(raf));
    }
View Full Code Here

    public void open(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile file,
                   ucar.nc2.util.CancelTask cancelTask) throws IOException {
        ncfile = file;
        myRaf = raf;

        headerParser = new UFheader();
        headerParser.read(myRaf, ncfile);
        //myInfo = headerParser.getVarInfo();
        HashMap variables = headerParser.variableGroup;

        Set vSet = variables.keySet();
View Full Code Here

   * @param showCoords shoe the values of coordinate axes
   * @param uri        use this for the uri attribute; if null use getLocation().
   * @throws IOException on write error
   */
  public void writeNcMLG(java.io.OutputStream os, boolean showCoords, String uri) throws IOException {
    new NcMLGWriter().writeXML(this, os, showCoords, uri);
  }
View Full Code Here

   * @param os  write to this Output Stream.
   * @param uri use this for the uri attribute; if null use getLocation().
   * @throws IOException
   */
  public void writeNcML(java.io.OutputStream os, String uri) throws IOException {
    new NcMLWriter().writeXML(this, os, uri);
  }
View Full Code Here

TOP

Related Classes of ucar.nc2.iosp.netcdf3.N3iosp

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.