Package edu.wisc.ssec.mcidas.adde

Examples of edu.wisc.ssec.mcidas.adde.AddePointDataReader


  static AddePointDataReader callAdde( String request) throws IOException {
    try {
      System.out.println("Call ADDE request= "+request);
      long start = System.currentTimeMillis();
      AddePointDataReader reader = new AddePointDataReader( request);
      System.out.println(" took= "+(System.currentTimeMillis()-start)+" msec");

      return reader;

    } catch (AddeException e) {
View Full Code Here


        // time unit
    timeUnit = DateUnit.getUnixDateUnit();

    try {
      AddePointDataReader reader = callAdde( addeURL);

      String[] params = reader.getParams();
      String[] units = reader.getUnits();
      int[] scales  = reader.getScales();
      scaleFactor = new double[ params.length];

      if (debugHead) System.out.println(" Param  Unit Scale");
      for (int paramNo = 0; paramNo < params.length; paramNo++) {
        //memberNames.add( params[i]);
View Full Code Here

  // read from ADDE

  private ArrayStructureAdde readData(String selectClause, CancelTask cancel) {
    try {
      String urlString = (selectClause == null) ? addeURL+"&num=all" : addeURL+"&num=all&select='"+selectClause+"'";
      AddePointDataReader reader = callAdde( urlString);

      int [][] stationObsData = reader.getData();
      int nparams = stationObsData.length;
      int nobs = stationObsData[0].length;
      if (debugAddeCall) {
        System.out.println("CALL ADDE= "+urlString);
        System.out.println(" nparams= "+nparams+" nobs=" + nobs);
View Full Code Here

  static void test(String urlString) {
    try {
      long start = System.currentTimeMillis();
      System.out.println(" get "+urlString);

      AddePointDataReader reader = new AddePointDataReader( urlString);

      System.out.println(" took= "+(System.currentTimeMillis()-start)+" msec");
      System.out.println(reader.toString());

      System.out.println(" Param  Unit Scale");

      String[] params = reader.getParams();
      String[] units = reader.getUnits();
      int[] scales = reader.getScales();
      for (int i = 0; i < params.length; i++) {
        System.out.println(" "+params[i]+" "+units[i]+" "+scales[i]);
      }

      int[][] data = reader.getData();
      System.out.println(" nparams= "+params.length);
      System.out.println(" n= "+data.length);
      System.out.println(" m= "+data[0].length);

    } catch (AddeException e) {
View Full Code Here

    HashMap hashStations = new HashMap(5000);

    try {
      if (debugOpen) System.out.println("Call ADDE Server " + location);
      long start = System.currentTimeMillis();
      AddePointDataReader reader = AddeStationObsDataset.callAdde(location + "&num=all&param=ID LAT LON ZS"); // LOOK
      long took = System.currentTimeMillis() - start;
      if (debugOpen) System.out.println(" time = " + took);

      int[][] stationData = reader.getData();
      int nparams = stationData.length;
      int nstations = stationData[0].length;
      System.out.println(" nparams= " + nparams + " nstations=" + nstations);
      System.out.println(" size= " + (nparams * nstations * 4) + " bytes");

      int[] scales = reader.getScales();
      double[] scaleFactor = new double[scales.length];
      for (int i = 0; i < nparams; i++) {
        scaleFactor[i] = (scales[i] == 0) ? 1.0 : 1.0 / Math.pow(10.0, (double) scales[i]);
      }

View Full Code Here

TOP

Related Classes of edu.wisc.ssec.mcidas.adde.AddePointDataReader

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.