Package org.apache.mahout.ga.watchmaker.cd.tool

Examples of org.apache.mahout.ga.watchmaker.cd.tool.DescriptionUtils$Range


    long startDate, endDate;
    // Read all data in variable oriented manner.
    TrajectoryObsDatatype trajDt = me.getTrajectory( "1Hz data" );

    Range range = trajDt.getFullRange();
    startDate = System.currentTimeMillis();
    for ( Iterator it = trajDt.getDataVariables().iterator(); it.hasNext(); )
    {
      VariableSimpleIF var = (VariableSimpleIF) it.next();
      Array a = trajDt.getData( range, var.getShortName() );
View Full Code Here


      if ( minIndex == -1 || maxIndex == -1 )
        return null;

      try
      {
        return new Range( minIndex, maxIndex);
      }
      catch ( InvalidRangeException e )
      {
        return null;
      }
View Full Code Here

  public File writeCoverageDataToFile( Request.Format format, LatLonRect bboxLatLonRect, VerticalRange verticalRange, DateRange timeRange)
          throws WcsException
  {
    // Get the height range.
    Range zRange = null;
    try
    {
      zRange = verticalRange != null ? verticalRange.getRange( this.coordSys ) : null;
    }
    catch ( InvalidRangeException e )
    {
      log.error( "writeCoverageDataToFile(): Failed to subset coverage <" + this.coverage.getFullName() + "> along vertical range <" + verticalRange + ">: " + e.getMessage() );
      throw new WcsException( WcsException.Code.CoverageNotDefined, "Vertical", "Failed to subset coverage [" + this.coverage.getFullName() + "] along vertical range." );
    }

    // Get the time range.
    Range tRange = null;
    if ( timeRange != null )
    {
      CoordinateAxis1DTime timeAxis = this.coordSys.getTimeAxis1D();
      DateType requestStartTime = timeRange.getStart();
      DateType requestEndTime = timeRange.getEnd();
      int startIndex = timeAxis.findTimeIndexFromDate( requestStartTime.getDate() );
      int endIndex = timeAxis.findTimeIndexFromDate( requestEndTime.getDate() );
      if ( startIndex < 0 || startIndex > timeAxis.getSize() -1
           || endIndex < 0 || endIndex > timeAxis.getSize() - 1 )
      {
        String availStart = timeAxis.getDateRange().getStart().toDateTimeStringISO();
        String availEnd = timeAxis.getDateRange().getEnd().toDateTimeStringISO();
        String msg = "Requested temporal range [" + requestStartTime.toDateTimeStringISO()
                     + " - " + requestEndTime.toDateTimeStringISO()
                     + "] not in available range [" + availStart + " - " + availEnd + "].";
        log.debug( "writeCoverageDataToFile(): " + msg );
        throw new WcsException( WcsException.Code.CoverageNotDefined, "Time", msg );
      }
      try
      {
        tRange = new Range( startIndex, endIndex );
      }
      catch ( InvalidRangeException e )
      {
        log.error( "writeCoverageDataToFile(): Failed to subset coverage [" + this.coverage.getFullName() + "] along time axis [" + timeRange + "]: " + e.getMessage() );
        throw new WcsException( WcsException.Code.CoverageNotDefined, "Time", "Failed to subset coverage [" + this.coverage.getFullName() + "] along time axis [" + timeRange + "]." );
View Full Code Here

        log.error( "getRange(): GridCoordSystem vertical axis does not contain min/max points." );
        throw new IllegalArgumentException( "GridCoordSystem vertical axis does not contain min/max points." );
      }

      if ( vertAxis.getPositive().equalsIgnoreCase( ucar.nc2.constants.CF.POSITIVE_DOWN ) )
        return new Range( maxIndex, minIndex, stride );
      else
        return new Range( minIndex, maxIndex, stride );
    }
View Full Code Here

    int rank = v.getRank();
    ArrayList ranges = new ArrayList();
    ranges.add(null);
    for (int i = 1; i < rank; i++) {
      ranges.add(new Range(0, 1));
    }

    VariableDS v_section = (VariableDS) v.section(ranges);
    assert (v_section.findAttribute("_FillValue") != null);
    System.out.println(v_section.findAttribute("_FillValue"));
View Full Code Here

            // T
            int first = slice2DIndex.getTIndex();
            int length = 1;
            int stride = 1;
            if (first != -1){
                ranges.add(new Range(first, first + length - 1, stride));
            }
            // Z
            first = slice2DIndex.getZIndex();
            if (first != -1){
                ranges.add(new Range(first, first + length - 1, stride));
            }
            // Y
            first = srcRegion.y;
            length = srcRegion.height;
            stride = strideY;
            ranges.add(new Range(first, first + length - 1, stride));
            // X
            first = srcRegion.x;
            length = srcRegion.width;
            stride = strideX;
            ranges.add(new Range(first, first + length - 1, stride));
        } catch (InvalidRangeException e) {
            throw netcdfFailure(e);
        }
   
        /*
 
View Full Code Here

                final String name = var.getName();
                for( int j = 0; j < numImages; j++ ) {
                    // Checking if the actual dataset is a product.
                    if (!checkProducts || name.equals(productList[j])) {
                        // Updating the subDatasetsMap map
                        indexMap.put(new Range(j, j + 1), new TerascanDatasetWrapper(var));
                        break;
                    }
                }
            }
        } catch (InvalidRangeException e) {
View Full Code Here

                stride = 1;
                break;
            }
            }
            try {
                ranges.add(new Range(first, first + length - 1, stride));
            } catch (InvalidRangeException e) {
                // TODO LOGME
            }
        }
        final Section sections = new Section(ranges);
View Full Code Here

                final String name = var.getName();
                for( int j = 0; j < numImages; j++ ) {
                    // Checking if the actual dataset is a product.
                    if (name.equals(productList[j])) {
                        // Updating the subDatasetsMap map
                        indexMap.put(new Range(j, j + 1), new APSDatasetWrapper(var));
                        break;
                    }
                }
            }
        } catch (InvalidRangeException e) {
View Full Code Here

TOP

Related Classes of org.apache.mahout.ga.watchmaker.cd.tool.DescriptionUtils$Range

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.