Examples of findVariable()


Examples of ucar.nc2.NetcdfFile.findVariable()

    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)
        new MetarField(v.getShortName());
    }
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

  public void openFile(Average avg) throws IOException, InvalidRangeException {
    long start = System.nanoTime();

    NetcdfFile ncfile = NetcdfDataset.openFile(TestAll.cdmUnitTestDir +"ft/grid/netcdf/AZ.000000000.nc", null);
    Variable v = ncfile.findVariable("qc");
    assert null != v;
    assert v.getDataType() == DataType.BYTE;

    Array data = v.read();
    assert data.getElementType() == byte.class;
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

      "  </aggregation>\n" +
      "</netcdf>";
    NetcdfFile ncfile = NcMLReader.readNcML(new StringReader(xml), "aggFmrcScaling", null);

    // make sure that scaling is applied
    VariableDS vs = (VariableDS) ncfile.findVariable("hs");
    Array data = vs.read("0,1,:,:)");
    while (data.hasNext()) {
      float val = data.nextFloat();
      if (!vs.isMissing(val))
        assert (val < 10.0) : val;
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

  public void testScaling2() throws Exception {
    NetcdfFile ncfile = NetcdfDataset.acquireFile("file:D:/work/signell/efine/fine.ncml", null);

    // make sure that scaling is applied
    VariableDS vs = (VariableDS) ncfile.findVariable("hs");
    Array data = vs.read("0,1,:,:)");
    while (data.hasNext()) {
      float val = data.nextFloat();
      if (!vs.isMissing(val))
        assert (val < 10.0) : val;
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

    String filename = "file:./" + TestNcML.topDir + "TestValuesFromAttribute.xml";

    NetcdfFile ncfile = NcMLReader.readNcML(new StringReader(ncml), filename, null);
    System.out.println(" TestNcmlAggExisting.open " + filename + "\n" + ncfile);

    Variable newVar = ncfile.findVariable("titleAsVariable");
    assert null != newVar;

    assert newVar.getShortName().equals("titleAsVariable");
    assert newVar.getRank() == 0;
    assert newVar.getSize() == 1;
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

    Object val = data.getObject(0);
    assert val instanceof String;
    assert val.equals("COADS 1-degree Equatorial Enhanced");

    ////////////////
    newVar = ncfile.findVariable("titleAsVariable2");
    assert null != newVar;

    assert newVar.getShortName().equals("titleAsVariable2");
    assert newVar.getRank() == 0;
    assert newVar.getSize() == 1;
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

    val = data.getObject(0);
    assert val instanceof String;
    assert val.equals("COADS 1-degree Equatorial Enhanced");

    ///////////////
    newVar = ncfile.findVariable("VariableAttribute");
    assert null != newVar;

    assert newVar.getShortName().equals("VariableAttribute");
    assert newVar.getRank() == 1;
    assert newVar.getSize() == 2;
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

    //System.out.println(" testNestedValues=\n"+ ncml);
    NetcdfFile ncfile = NcMLReader.readNcML(new StringReader(ncml), location, null);

    TestAll.readAllData(ncfile);

     Variable v = ncfile.findVariable("time");
     Array data = v.read();
     assert data.getSize() == 20;
     NCdumpW.printArray(data);

    ncfile.close();   
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

   NetcdfFile ncfile = NetcdfDataset.openFile(filename, null);

   TestAll.readAllData(ncfile);

    Variable v = ncfile.findVariable("time");
    Array data = v.read();
    assert data.getSize() == 59;
    NCdumpW.printArray(data);

   ncfile.close();
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

  }

  public void utestNestedTable() throws IOException, InvalidRangeException {
    String filename = TestAll.cdmLocalTestDataDir + "dataset/nestedTable.bufr";
    NetcdfFile ncfile = ucar.nc2.dataset.NetcdfDataset.openFile(filename, null);
    Structure outer = (Structure) ncfile.findVariable(BufrIosp.obsRecord);
    StructureData data = outer.readStructure(0);
    //NCdumpW.printStructureData( new PrintWriter(System.out), data);

    assert data.getScalarShort("Latitude") == 32767;
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.