grib/src/main/java/ucar/nc2/grib/collection/GribIosp.java
private Array makeLazyTime1Darray(Variable v2, Time2Dinfo info) {
    int length = info.time1D.getSize();
    double[] data = new double[length];
    for (int i = 0; i < length; i++) {
      data[i] = Double.NaN;
    }

    // coordinate values
    switch (info.which) {
      case reftime:
        CoordinateRuntime rtc = (CoordinateRuntime) info.time1D;
        int count = 0;
        for (double val : rtc.getOffsetsInTimeUnits()) {
          data[count++] = val;
        }
        return Array.factory(DataType.DOUBLE, v2.getShape(), data);

      case timeAuxRef:
        CoordinateTimeAbstract time = (CoordinateTimeAbstract) info.time1D;
        count = 0;
        List<Double> masterOffsets = gribCollection.getMasterRuntime().getOffsetsInTimeUnits();
        for (int masterIdx : time.getTime2runtime()) {
          data[count++] = masterOffsets.get(masterIdx - 1);
        }
        return Array.factory(DataType.DOUBLE, v2.getShape(), data);

      default:
        throw new IllegalStateException("makeLazyTime1Darray must be reftime or timeAuxRef");
    }
  }
private Array makeLazyTime1Darray(Variable v2, Time2Dinfo info) {
    int length = info.time1D.getSize();
    double[] data = new double[length];
    for (int i = 0; i < length; i++) {
      data[i] = Double.NaN;
    }

    // coordinate values
    switch (info.which) {
      case reftime:
        CoordinateRuntime rtc = (CoordinateRuntime) info.time1D;
        int count = 0;
        for (double val : rtc.getOffsetsInTimeUnits()) {
          data[count++] = val;
        }
        return Array.factory(DataType.DOUBLE, v2.getShape(), data);

      case timeAuxRef:
        CoordinateTimeAbstract time = (CoordinateTimeAbstract) info.time1D;
        count = 0;
        List<Double> masterOffsets = gribCollection.getMasterRuntime().getOffsetsInTimeUnits();
        for (int masterIdx : time.getTime2runtime()) {
          data[count++] = masterOffsets.get(masterIdx - 1);
        }
        return Array.factory(DataType.DOUBLE, v2.getShape(), data);

      default:
        throw new IllegalStateException("makeLazyTime1Darray must be reftime or timeAuxRef");
    }
  }
private Array makeLazyTime1Darray ( Variable v2 , Time2Dinfo info ) { int length = info . time1D . getSize ( ) ; double [ ] data = new double [ length ] ; for ( int i = 0 ; i < length ; i ++ ) { data [ i ] = Double . NaN ; } // coordinate values switch ( info . which ) { case reftime : CoordinateRuntime rtc = ( CoordinateRuntime ) info . time1D ; int count = 0 ; for ( double val : rtc . getOffsetsInTimeUnits ( ) ) { data [ count ++ ] = val ; } return Array . factory ( DataType . DOUBLE , v2 . getShape ( ) , data ) ; case timeAuxRef : CoordinateTimeAbstract time = ( CoordinateTimeAbstract ) info . time1D ; count = 0 ; List < Double > masterOffsets = gribCollection . getMasterRuntime ( ) . getOffsetsInTimeUnits ( ) ; for ( int masterIdx : time . getTime2runtime ( ) ) { data [ count ++ ] = masterOffsets . get ( masterIdx - 1 ) ; } return Array . factory ( DataType . DOUBLE , v2 . getShape ( ) , data ) ; default : throw new IllegalStateException ( "makeLazyTime1Darray must be reftime or timeAuxRef" ) ; } }
only for the 2d times
only for the 2d times