Examples of findVariable()


Examples of ucar.nc2.NetcdfFile.findVariable()

    //H4header.setDebugFlags(new ucar.nc2.util.DebugFlagsImpl("H4header/linked"));

    //TestAll.readAll("E:/problem/MAC021S0.A2007287.1920.002.2007289002404.hdf");

    NetcdfFile ncfile = NetcdfFile.open("R:\\testdata\\hdf4\\c402_rp_02.diag.sfc.20020122_0130z.hdf");
    Variable v = ncfile.findVariable("MOD_Grid_MOD17A2/Data Fields/PsnNet_1km");
    assert v != null;
    v.read();
    ncfile.close();
  }
}
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

  public void testUnsigned() throws IOException, InvalidRangeException {
    String filename = testDir + "MOD021KM.A2004328.1735.004.2004329164007.hdf";
    NetcdfFile ncfile = NetcdfFile.open(filename);
    String vname = "/MODIS_SWATH_Type_L1B/Data Fields/EV_250_Aggr1km_RefSB";
    Variable v = ncfile.findVariable(vname);
    assert v != null : filename+" "+vname;

    Array data = v.read();
    System.out.printf(" sum =          %f%n", MAMath.sumDouble(data));
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

    for (int i=0; i<10; i++) {
      String ncmli = StringUtil.replace(ncml,'%',Integer.toString(i));
      NetcdfFile ncfile = NcMLReader.readNcML(new StringReader(ncmli), filename, null);
      System.out.println(" TestNcmlAggExisting.open "+ filename);

      Variable timev = ncfile.findVariable("time");
      Array timeD = timev.read();

      int count1 = RandomAccessFile.getOpenFiles().size();
      System.out.printf("count files at dir %d count= %d%n", i, count1);
      ncfile.close();
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

    System.out.printf("ncml=%s%n", ncml);
    String filename = "file:" + TestNcML.topDir + "testAggModify.ncml";
    NetcdfFile ncfile = NcMLReader.readNcML(new StringReader(ncml), filename, null);
    System.out.println(" TestNcmlAggExisting.open " + filename + "\n" + ncfile);

    Variable v = ncfile.findVariable("T");
    assert null != v;

    v = ncfile.findVariable("P");
    assert null == v;
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

    System.out.println(" TestNcmlAggExisting.open " + filename + "\n" + ncfile);

    Variable v = ncfile.findVariable("T");
    assert null != v;

    v = ncfile.findVariable("P");
    assert null == v;

    ncfile.close();
  }
View Full Code Here

Examples of ucar.nc2.NetcdfFile.findVariable()

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

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

    Variable times = ncfile.findVariable("times");
    assert null != times;
    assert times.getRank() == 1;
    assert times.getSize() == 3;

    assert times.getDimension(0).getName().equals("time");
View Full Code Here

Examples of ucar.nc2.NetcdfFileWriteable.findVariable()

    data.setString(helloGreek);
    ncfile.write(helloGreek, data);
    ncfile.close();

    NetcdfFile nc = NetcdfFile.open(filename);
    Variable v = ncfile.findVariable(helloGreek);
    assert v != null;
    assert v.getShortName().equals(helloGreek);

    Attribute att = v.findAttribute("units");
    assert att != null;
View Full Code Here

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

    Array data = v2.read();
    assert data.getElementType() == int.class;

    NetcdfDataset ncd = TestH5.openH5dataset("support/enum.h5");
    v2 = ncd.findVariable("enum");
    assert v2 != null;

    data = v2.read();
    assert data.getElementType() == String.class;
    ncfile.close();
View Full Code Here

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

    Array data = v2.read();
    assert data.getElementType() == byte.class;

    NetcdfDataset ncd = NetcdfDataset.openDataset("D:/netcdf4/tst_enum_data.nc");
    v2 = ncd.findVariable("primary_cloud");
    assert v2 != null;

    data = v2.read();
    assert data.getElementType() == String.class;
    ncfile.close();
View Full Code Here

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

    //H5header.setDebugFlags(new ucar.nc2.util.DebugFlagsImpl("H5header/header"));
    NetcdfDataset ncfile = NetcdfDataset.openDataset(TestH5.testDir + "complex/compound_complex.h5");

    Variable dset = null;
    assert (null != (dset = ncfile.findVariable("CompoundComplex")));
    assert (dset.getDataType() == DataType.STRUCTURE);
    assert (dset.getRank() == 1);
    assert (dset.getSize() == 6);

    Dimension d = dset.getDimension(0);
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.