@ Override protected Array readData ( Variable cdmvar , Section section ) throws IOException , InvalidRangeException { // The section is applied wrt to the DataDMR, so it // takes into account any constraint used in forming the dataDMR. // We use the Section to produce a view of the underlying variable array. assert this . dsp != null ; Array result = arraymap . get ( cdmvar ) ; if ( result == null ) throw new IOException ( "No data for variable: " + cdmvar . getFullName ( ) ) ; if ( section != null ) { if ( cdmvar . getRank ( ) != section . getRank ( ) ) throw new InvalidRangeException ( String . format ( "Section rank != %s rank" , cdmvar . getFullName ( ) ) ) ; List < Range > ranges = section . getRanges ( ) ; // Case out the possibilities if ( CDMUtil . hasVLEN ( ranges ) ) { ranges = ranges . subList ( 0 , ranges . size ( ) - 1 ) ; // may produce empty list } if ( ranges . size ( ) > 0 && ! CDMUtil . isWhole ( ranges , cdmvar ) ) result = result . sectionNoReduce ( ranges ) ; } return result ; }
Primary read entry point . This is the primary implementor of Variable . read .