Examples of findVariable()


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

  }

  public void testRename() throws IOException {
    String filename = "file:./" + TestNcML.topDir + "aggUnionRename.xml";
    NetcdfDataset scanFile = NetcdfDataset.openDataset(filename, false, null);
    Variable v = scanFile.findVariable("LavaFlow");
    assert v != null;
    scanFile.close();
  }

}
View Full Code Here

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

    System.out.println(" testAggExisting.try "+ filename);
    NetcdfDataset ncd = NetcdfDataset.openDataset(filename);
    System.out.println(" testAggExisting.open "+ ncd);

    Variable sst_time = ncd.findVariable("sst_time");
    assert sst_time != null;
    assert sst_time.getRank() == 2;
    int[] shape =  sst_time.getShape();
    assert shape[0] == 6;
    assert shape[1] == 1;
View Full Code Here

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

    // 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");
    Structure record = (Structure) ncfile.findVariable("record");
    List<Variable> allList = record.getVariables();
    List<VariableSimpleIF> varList = new ArrayList<VariableSimpleIF>();
    for (Variable v : allList) {
      if ((v.getRank() == 1) && v.getDimension(0).equals(manDim)) {
        // public VariableDS(NetcdfDataset ds, Group group, Structure parentStructure, String shortName, DataType dataType,
View Full Code Here

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

    }

    ArrayStructureMA manAS = new ArrayStructureMA(sm, new int[] {manDim.getLength()} );

    // need the date units
    Variable time = ncfile.findVariable("synTime");
    String timeUnits  = ncfile.findAttValueIgnoreCase(time, "units", null);
    timeUnits = StringUtil.remove(timeUnits, '(')// crappy fsl'ism
    timeUnits = StringUtil.remove(timeUnits, ')');
    DateUnit timeUnit = new DateUnit(timeUnits);
View Full Code Here

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

  public void testDatasetAddRecord() throws InvalidRangeException, IOException {
    NetcdfDataset nc = NetcdfDataset.openDataset(TestLocal.cdmTestDataDir + "testWriteRecord.nc", NetcdfDataset.getDefaultEnhanceMode(),
        -1, null, NetcdfFile.IOSP_MESSAGE_ADD_RECORD_STRUCTURE);

    // record variable
    Variable record = nc.findVariable("record");
    assert record instanceof StructureDS;
    StructureDS rs = (StructureDS) record;
    assert rs.getRank() == 1;
    assert rs.getDimension(0).getLength() == 2;
View Full Code Here

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

  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;
    assert rs.getRank() == 1;
    assert rs.getDimension(0).getLength() == 2;
View Full Code Here

Examples of ucar.nc2.dataset.StructureDS.findVariable()

    int t2 = sdata.getScalarInt("time");
    assert t2 == 18;

    /* Read the times: unlimited dimension */
    Variable time = rs.findVariable("time");
    assert time != null;
    Array timeValues = time.read();
    assert (timeValues instanceof ArrayInt.D0);
    ArrayInt.D0 ta = (ArrayInt.D0) timeValues;
    assert (ta.get() == 6) : ta.get();
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.