Examples of StructurePseudo


Examples of ucar.nc2.StructurePseudo

    readStationTable();
  }

  private void readStationTable() throws IOException {
    Dimension stationDim = ncfile.findDimension("station");
    StructurePseudo stationTable = new StructurePseudo( ncfile, null, "stationTable", stationDim);
    ArrayStructure stationData = (ArrayStructure) stationTable.read();

    // how many are valid stations ?
    int nstations = 0;
    if (numStationsVar != null)
      nstations = numStationsVar.readScalarInt();
View Full Code Here

Examples of ucar.nc2.StructurePseudo

  private void readStationIndex() throws IOException {
    Array stationIndexArray = stationIndexVar.read();


    Dimension stationDim = ncfile.findDimension("station");
    StructurePseudo stationTable = new StructurePseudo( ncfile, null, "stationTable", stationDim);
    ArrayStructure stationData = (ArrayStructure) stationTable.read();

    // how many are valid stations ?
    int nstations = 0;
    if (numStationsVar != null)
      nstations = numStationsVar.readScalarInt();
View Full Code Here

Examples of ucar.nc2.StructurePseudo

    {
      Object result = this.ncfile.sendIospMessage(NetcdfFile.IOSP_MESSAGE_ADD_RECORD_STRUCTURE);
      if ((result != null) && (Boolean) result )
        this.recordVar = (Structure) this.ncfile.getRootGroup().findVariable( "record");
      else
        this.recordVar = new StructurePseudo( this.ncfile, null, "record", timeDim );
    } else {
      this.recordVar = new StructurePseudo( this.ncfile, null, "record", timeDim);
    }

    // @todo HACK, HACK, HACK - remove once addRecordStructure() deals with ncd attribute changes.
    Variable elevVarInRecVar = this.recordVar.findVariable( this.elevVar.getFullNameEscaped());
    if ( ! elevVarUnitsString.equals( elevVarInRecVar.findAttribute( "units").getStringValue()))
View Full Code Here

Examples of ucar.nc2.StructurePseudo

            if ((result != null) && (Boolean) result) {
                this.recordVar =
                    (Structure) this.ncfile.getRootGroup().findVariable(
                        "record");
            } else {
                this.recordVar = new StructurePseudo(this.ncfile, null,
                        "record", trajectoryDim);
            }
        } else {
            this.recordVar = new StructurePseudo(this.ncfile, null, "record",
                    trajectoryDim);
        }

        // @todo HACK, HACK, HACK - remove once addRecordStructure() deals with ncd attribute changes.
        Variable elevVarInRecVar =
View Full Code Here

Examples of ucar.nc2.StructurePseudo

    if ( this.ncfile.hasUnlimitedDimension() && this.ncfile.getUnlimitedDimension().equals( timeDim))
    {
      this.ncfile.sendIospMessage(NetcdfFile.IOSP_MESSAGE_ADD_RECORD_STRUCTURE);
      this.recordVar = (Structure) this.ncfile.getRootGroup().findVariable( "record");
    } else {
      this.recordVar = new StructurePseudo( this.ncfile, null, "record", timeDim);
    }

    // @todo HACK, HACK, HACK - remove once addRecordStructure() deals with ncd attribute changes.
    Variable latVarInRecVar = this.recordVar.findVariable( this.latVar.getFullNameEscaped() );
    Attribute latVarUnitsAtt = latVarInRecVar.findAttribute( "units");
View Full Code Here

Examples of ucar.nc2.StructurePseudo

    boolean first = true;
    long start = System.currentTimeMillis();
    Structure record = (Structure) ncfile.findVariable("record");
    if (record == null) {
      Dimension d = ncfile.findDimension("Time");
      record = new StructurePseudo(ncfile, null, "precord", d);
      System.out.println("   use psuedo record");
    }
    StructureDataIterator iter = record.getStructureIterator();
    while (iter.hasNext()) {
      StructureData sd = iter.next();
View Full Code Here

Examples of ucar.nc2.StructurePseudo

  public void testMA() throws IOException, InvalidRangeException {
    NetcdfFile ncfile = TestNC2.openFile("jan.nc");
    Dimension dim = ncfile.findDimension("time");
    assert dim != null;

    Structure p = new StructurePseudo( ncfile, null, "Psuedo", dim);

    assert( p.getDataType() == DataType.STRUCTURE);

    Array data = p.read();
    assert( data instanceof ArrayStructure);
    assert( data instanceof ArrayStructureMA);
    assert(data.getElementType() == StructureData.class);

    test.testArrayStructure( (ArrayStructure) data);
View Full Code Here

Examples of ucar.nc2.StructurePseudo

    } else {
      if (recDimName == null)
        throw new IllegalArgumentException("File <" + this.ncfile.getLocation() +
                "> has no unlimited dimension, specify psuedo record dimension with observationDimension global attribute.");
      this.obsDim = this.ncfile.getRootGroup().findDimension(recDimName);
      this.recordVar = new StructureDS( null, new StructurePseudo(this.ncfile, null, "record", obsDim)); // true
    }

    // create member variables
    List<Variable> recordMembers = ncfile.getVariables();
    for (Variable v : recordMembers) {
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.