Package wyrl.core

Examples of wyrl.core.Expr$Variable


    //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


  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));

    double sum2 = 0;
    double sum3 = 0;
    int[] varShape = v.getShape();
    int[] origin = new int[3];
    int[] size = new int[]{1, varShape[1], varShape[2]};
    for (int i = 0; i < varShape[0]; i++) {
      origin[0] = i;
      Array data2D = v.read(origin, size);

      double sum = MAMath.sumDouble(data2D);
      System.out.printf("  %d sum3D =        %f%n", i, sum);
      sum2 += sum;
View Full Code Here

    int recsize = vinfo.elemSize;

    // create the ArrayStructure
    StructureMembers members = s.makeStructureMembers();
    for (StructureMembers.Member m : members.getMembers()) {
      Variable v2 = s.findVariable(m.getName());
      H4header.Minfo minfo = (H4header.Minfo) v2.getSPobject();
      m.setDataParam(minfo.offset);
    }
    members.setStructureSize(recsize);
    ArrayStructureBB structureArray = new ArrayStructureBB(members, section.getShape())// LOOK subset
View Full Code Here

    return structureArray;
  }

  public String toStringDebug(Object o) {
    if (o instanceof Variable) {
      Variable v = (Variable) o;
      H4header.Vinfo vinfo = (H4header.Vinfo) v.getSPobject();
      return (vinfo != null) ? vinfo.toString() : "";
    }
    return null;
  }
View Full Code Here

    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

        ncfile = NetcdfFile.open(filename);
        Group root = ncfile.getRootGroup();
        Group g = root.findGroup("HDFEOS INFORMATION");
        if (g == null) g = ncfile.getRootGroup();

        Variable dset = g.findVariable("StructMetadata.0");
        if (dset != null) {
          System.out.println("EOS file=" + filename);
          return 1;
        }
View Full Code Here

    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

      conditionDone = true;
    }

    for (Pair<String, Expr> let : decl.lets) {
      String letVar = let.first();
      Expr letExpr = let.second();
      int result = translate(level, letExpr, environment, file);
      environment.put(result, letVar);
      //
      if (!conditionDone && decl.condition != null
          && allVariablesDefined(decl.condition, environment)) {
View Full Code Here

    List<Expr> arguments = code.arguments;
    for (int i = 0; i != arguments.size(); ++i) {
      if (i != 0) {
        body += ", ";
      }
      Expr argument = arguments.get(i);
      int reg = translate(level, argument, environment, file);
      reg = coerceFromValue(level, argument, reg, environment);
      body += "r" + reg;
    }
View Full Code Here

    // second, generate all the for loops
    for (int i = 0; i != sources.length; ++i) {
      Pair<Expr.Variable, Expr> p = expr.sources.get(i);
      Expr.Variable variable = p.first();
      Expr source = p.second();
      Type.Collection sourceType = (Type.Collection) source
          .attribute(Attribute.Type.class).type;
      Type elementType = variable.attribute(Attribute.Type.class).type;
      int index = environment.allocate(elementType, variable.var);
      myOut(level++, "for(int i" + index + "=0;i" + index + "<r"
          + sources[i] + ".size();i" + index + "++) {");
View Full Code Here

TOP

Related Classes of wyrl.core.Expr$Variable

Copyright © 2018 www.massapicom. 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.