Examples of findVariable()


Examples of ucar.nc2.NetcdfFile.findVariable()

    String location = "file:"+ TestAll.cdmUnitTestDir + "ncml/nc/narr/";
    System.out.println(" TestOffAggExistingTimeUnitsChange.testNarrGrib=\n"+ ncml);
    NetcdfFile ncfile = NcMLReader.readNcML(new StringReader(ncml), location, null);

    Variable v = ncfile.findVariable("time");
    assert v != null;
    assert v.getDataType() == DataType.DOUBLE;

    String units = v.getUnitsString();
    assert units != null;
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

  public void testReadCompressedInt() throws IOException {
    // actually doesnt seem to be compressed ??

    NetcdfFile ncfile = TestH5.openH5("support/zip.h5");
    Variable dset = ncfile.findVariable("Data/Compressed_Data");
    assert dset != null;
    assert(dset.getDataType() == DataType.INT);

    assert(dset.getRank() == 2);
    assert(dset.getShape()[0] == 1000);
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

  public void testReadCompressedByte() throws IOException {
    // actually doesnt seem to be compressed ??

    NetcdfFile ncfile = TestH5.openH5("msg/MSG1_8bit_HRV.H5");
    Variable dset = ncfile.findVariable("image1/image_preview");
    assert dset != null;
    assert(dset.getDataType() == DataType.BYTE);

    assert(dset.getRank() == 2);
    assert(dset.getShape()[0] == 64);
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

  }

  public void testEndian() throws IOException {
    String testDir = TestN4.testDir;
    NetcdfFile ncfile = TestNC2.open(testDir+"endianTest.nc4");
    Variable v = ncfile.findVariable("TMP");
    assert v != null;
    assert v.getDataType() == DataType.FLOAT;

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

Examples of ucar.nc2.NetcdfFile.findVariable()

  public void testReadArrayType() throws IOException {
    NetcdfFile ncfile = TestH5.openH5("support/SDS_array_type.h5");

    Variable dset = null;
    assert(null != (dset = ncfile.findVariable("IntArray")));
    assert(dset.getDataType() == DataType.INT);

    assert(dset.getRank() == 3);
    assert(dset.getShape()[0] == 10);
    assert(dset.getShape()[1] == 5);
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

  }

  public void testVlengthVariableChunked() throws IOException {
    NetcdfFile ncfile = TestH5.openH5("support/uvlstr.h5");

    Variable v = ncfile.findVariable("Space1");
    assert (null != v);
    assert (v.getDataType() == DataType.STRING);
    assert (v.getRank() == 1);
    assert (v.getShape()[0] == 9);
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

  } // */

  public void testVlengthVariable() throws IOException {
    NetcdfFile ncfile = TestH5.openH5("support/vlslab.h5");

    Variable v = ncfile.findVariable("Space1");
    assert (null != v);
    assert (v.getDataType() == DataType.STRING);
    assert (v.getRank() == 1);
    assert (v.getShape()[0] == 12);

View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

  }

  private void testVlenEndian(String filename, int n) throws IOException {
    NetcdfFile ncfile = NetcdfDataset.openFile(filename, null);

    Variable v = ncfile.findVariable("levels");
    assert (null != v);
    assert (v.getDataType() == DataType.INT);
    assert (v.getRank() == 2);
    assert (v.getShape()[0] == n) : v.getShape()[0];
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

  }

  public void test1() throws IOException {
    //H5header.setDebugFlags( new ucar.nc2.util.DebugFlagsImpl("H5header/header"));
    NetcdfFile ncfile = TestH5.open(testDir +"HIRDLS1_v4.0.2a-aIrix-c2_2003d106.he5");
    Variable dset = ncfile.findVariable("HDFEOS/SWATHS/HIRDLS_L1_Swath/Data Fields/Scaled Ch01 Radiance");
    dset.read();
  }

  public void test2() throws IOException {
    NetcdfFile ncfile = TestH5.open(testDir +"HIRDLS2-AFGL_b027_na.he5");
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

    dset.read();
  }

  public void test2() throws IOException {
    NetcdfFile ncfile = TestH5.open(testDir +"HIRDLS2-AFGL_b027_na.he5");
    Variable dset = ncfile.findVariable("HDFEOS/SWATHS/HIRDLS/Data Fields/Altitude");
   
    //H5header.setDebugFlags( new ucar.nc2.util.DebugFlagsImpl("H5header/dataBtree"));
    Array data = dset.read();
    assert data.getElementType() == float.class;
  }
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.