grib/src/main/java/ucar/nc2/grib/collection/GribIosp.java
@Override
  public Array readData(Variable v2, Section section) throws IOException, InvalidRangeException {
    long start = System.currentTimeMillis();

    // see if its time2D - then generate data on the fly
    if (v2.getSPobject() instanceof Time2Dinfo) {
      Time2Dinfo info = (Time2Dinfo) v2.getSPobject();
      Array data = makeLazyCoordinateData(v2, info);
      Section sectionFilled = Section.fill(section, v2.getShape());
      return data.sectionNoReduce(sectionFilled.getRanges());
    }

    try {
      Array result;
      GribCollectionImmutable.VariableIndex vindex = (GribCollectionImmutable.VariableIndex) v2
          .getSPobject();
      GribDataReader dataReader = GribDataReader.factory(gribCollection, vindex);
      SectionIterable sectionIter = new SectionIterable(section, v2.getShape());
      result = dataReader.readData(sectionIter);

      long took = System.currentTimeMillis() - start;
      return result;

    } catch (IOException ioe) {
      logger.error("Failed to readData ", ioe);
      throw ioe;
    }
  }
@Override
  public Array readData(Variable v2, Section section) throws IOException, InvalidRangeException {
    long start = System.currentTimeMillis();

    // see if its time2D - then generate data on the fly
    if (v2.getSPobject() instanceof Time2Dinfo) {
      Time2Dinfo info = (Time2Dinfo) v2.getSPobject();
      Array data = makeLazyCoordinateData(v2, info);
      Section sectionFilled = Section.fill(section, v2.getShape());
      return data.sectionNoReduce(sectionFilled.getRanges());
    }

    try {
      Array result;
      GribCollectionImmutable.VariableIndex vindex = (GribCollectionImmutable.VariableIndex) v2
          .getSPobject();
      GribDataReader dataReader = GribDataReader.factory(gribCollection, vindex);
      SectionIterable sectionIter = new SectionIterable(section, v2.getShape());
      result = dataReader.readData(sectionIter);

      long took = System.currentTimeMillis() - start;
      return result;

    } catch (IOException ioe) {
      logger.error("Failed to readData ", ioe);
      throw ioe;
    }
  }
@ Override public Array readData ( Variable v2 , Section section ) throws IOException , InvalidRangeException { long start = System . currentTimeMillis ( ) ; // see if its time2D - then generate data on the fly if ( v2 . getSPobject ( ) instanceof Time2Dinfo ) { Time2Dinfo info = ( Time2Dinfo ) v2 . getSPobject ( ) ; Array data = makeLazyCoordinateData ( v2 , info ) ; Section sectionFilled = Section . fill ( section , v2 . getShape ( ) ) ; return data . sectionNoReduce ( sectionFilled . getRanges ( ) ) ; } try { Array result ; GribCollectionImmutable . VariableIndex vindex = ( GribCollectionImmutable . VariableIndex ) v2 . getSPobject ( ) ; GribDataReader dataReader = GribDataReader . factory ( gribCollection , vindex ) ; SectionIterable sectionIter = new SectionIterable ( section , v2 . getShape ( ) ) ; result = dataReader . readData ( sectionIter ) ; long took = System . currentTimeMillis ( ) - start ; return result ; } catch ( IOException ioe ) { logger . error ( "Failed to readData " , ioe ) ; throw ioe ; } }
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////