Package com.cloudera.lib.service

Examples of com.cloudera.lib.service.Instrumentation$Variable


    }
    return null;
  }

  protected String matchAxisTypeAndDimension(NetcdfDataset ds, AxisType type, final Dimension outer) {
    Variable var = CoordSysEvaluator.findCoordByType(ds, type, new CoordSysEvaluator.Predicate() {
      public boolean match(CoordinateAxis axis) {
        if ((outer == null) && (axis.getRank() == 0))
          return true;
        if ((outer != null) && (axis.getRank() == 1) && (outer.equals(axis.getDimension(0))))
          return true;
        return false;
      }
    });
    if (var == null) return null;
    return var.getShortName();
  }
View Full Code Here


    if (var == null) return null;
    return var.getShortName();
  }

  protected String matchAxisTypeAndDimension(NetcdfDataset ds, AxisType type, final Dimension outer, final Dimension inner) {
    Variable var = CoordSysEvaluator.findCoordByType(ds, type, new CoordSysEvaluator.Predicate() {
      public boolean match(CoordinateAxis axis) {
        return ((axis.getRank() == 2) && outer.equals(axis.getDimension(0)) && inner.equals(axis.getDimension(1)));
      }
    });
    if (var == null) return null;
    return var.getShortName();
  }
View Full Code Here

    if (var == null) return null;
    return var.getShortName();
  }

  protected String matchAxisTypeAndDimension(NetcdfDataset ds, AxisType type, final Dimension outer, final Dimension middle, final Dimension inner) {
    Variable var = CoordSysEvaluator.findCoordByType(ds, type, new CoordSysEvaluator.Predicate() {
      public boolean match(CoordinateAxis axis) {
        return ((axis.getRank() == 3) && outer.equals(axis.getDimension(0)) && middle.equals(axis.getDimension(1)) && inner.equals(axis.getDimension(2)));
      }
    });
    if (var == null) return null;
    return var.getShortName();
  }
View Full Code Here

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

   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

        Attribute attr = ds.findGlobalAttributeIgnoreCase("Elevation");
        if( attr != null )
            ele = attr.getNumericValue().doubleValue();

        // ncml agg add this sweep variable as agg dimension
        Variable sp = ds.findVariable("sweep");

        if(sp ==  null) {
            // add Elevation
            ds.addDimension( null, new Dimension("Elevation", 1 , true));
            String lName = "elevation angle in degres: 0 = parallel to pedestal base, 90 = perpendicular";
            CoordinateAxis v = new CoordinateAxis1D(ds, null, "Elevation", DataType.DOUBLE, "Elevation", "degrees", lName);
            ds.setValues(v, 1, ele, 0);
            v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.RadialElevation.toString()));
            ds.addVariable(null, v);

        }
        else {
            Array spdata = sp.read();
            float [] spd = (float [])spdata.get1DJavaArray(float.class);
            int spsize = spd.length;

            // add Elevation
            ds.addDimension( null, new Dimension("Elevation", spsize , true));
View Full Code Here

        return name;
      }
      public float[] readAllData() throws IOException {
        Array allData;
        Sweep spn = (Sweep)sweeps.get(0);
        Variable v = spn.getsweepVar();
        try {
           allData = v.read();
        } catch (IOException e) {
             throw new IOException(e.getMessage());
        }
        return (float []) allData.get1DJavaArray(float.class);
      }
View Full Code Here

    // add each variable
    for (GridDatatype gg : gds.getGrids()) {
      GridCoordSystem gcs = gg.getCoordinateSystem();
      Grid grid = new Grid(gg.getFullName());
      VariableEnhanced ve = gg.getVariable();
      Variable v = ve.getOriginalVariable();   // LOOK why original variable ??
      addMissing(v, gcs, grid);

      // LOOK: Note this assumes a dense coordinate system
      CoordinateAxis1D axis = gcs.getTimeAxis1D();
      if (axis != null) {
View Full Code Here

        private void setMeanElevation() {

            if(isVolume) {
                try{
                    Variable sp = ds.findVariable("sweep");
                    Array spData = sp.read();
                    float [] spArray = (float [])spData.get1DJavaArray(float.class);
                    meanElevation = spArray[sweepno];
                } catch (IOException e) {
                    e.printStackTrace();
                    meanElevation = 0.0;
View Full Code Here

        }

        public float[] getAzimuth() throws IOException {
            Array aziData = null;
            try{
                Variable azi = ds.findVariable("Azimuth");
                 aziData = azi.read();
            } catch (IOException e) {
                e.printStackTrace();
                meanElevation = 0.0;
            }
            return (float [])aziData.get1DJavaArray(float.class);
View Full Code Here

TOP

Related Classes of com.cloudera.lib.service.Instrumentation$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.