Package wycs.syntax

Examples of wycs.syntax.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

      // elegant way of doing this?
      for (int i = paramStart; i != fmm.params().size(); ++i) {
        precond.write(i, master.read(i), master.typeOf(i));
      }

      Expr constraint = precond.transform(new VcTransformer(this,
          wycsFile, filename, true));

      precond.scopes.remove(precond.scopes.size()-1);
      master.add(constraint);
    }
View Full Code Here

    ArrayList<Expr> rhsConstraints = new ArrayList<Expr>();

    splitConstraints(incoming,common,lhsConstraints,rhsConstraints);

    // Finally, put it all together
    Expr l = And(lhsConstraints);
    Expr r = And(rhsConstraints);

    // can now compute the logical OR of both branches
    Expr join = Or(l,r);

    // now, clear our sequential constraints since we can only have one
    // which holds now: namely, the or of the two branches.
    Scope top = topScope();
    top.constraints.clear();
View Full Code Here

    ArrayList<Expr> incomingConstraints = incoming.topScope().constraints;

    int min = 0;

    while (min < constraints.size() && min < incomingConstraints.size()) {
      Expr is = constraints.get(min);
      Expr js = incomingConstraints.get(min);
      if (is != js) {
        break;
      }
      min = min + 1;
    }
View Full Code Here

    if(constraints.size() == 0) {
      return new Expr.Constant(Value.Bool(true));
    } else if(constraints.size() == 1) {
      return constraints.get(0);
    } else {
      Expr nconstraints = null;
      for (Expr e : constraints) {
        if(nconstraints == null) {
          nconstraints = e;
        } else {
          nconstraints = new Expr.Binary(Expr.Binary.Op.AND,e,nconstraints,e.attributes());
View Full Code Here

    if (constraints.length == 0) {
      return new Expr.Constant(Value.Bool(false));
    } else if (constraints.length == 1) {
      return constraints[0];
    } else {
      Expr nconstraints = null;
      for (Expr e : constraints) {
        if (nconstraints == null) {
          nconstraints = e;
        } else {
          nconstraints = new Expr.Binary(Expr.Binary.Op.OR, e,
View Full Code Here

TOP

Related Classes of wycs.syntax.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.