public Array convertNestedVariable ( ucar . nc2 . Variable v , List < Range > section , DodsV dataV , boolean flatten ) throws IOException , DAP2Exception { Array data = convertTopVariable ( v , section , dataV ) ; if ( flatten ) { ArrayStructure as = ( ArrayStructure ) data ; // make list of names List < String > names = new ArrayList <> ( ) ; Variable nested = v ; while ( nested . isMemberOfStructure ( ) ) { names . add ( 0 , nested . getShortName ( ) ) ; nested = nested . getParentStructure ( ) ; } StructureMembers . Member m = findNested ( as , names , v . getShortName ( ) ) ; Array mdata = m . getDataArray ( ) ; if ( mdata instanceof ArraySequenceNested ) { // gotta unroll ArraySequenceNested arraySeq = ( ArraySequenceNested ) mdata ; return arraySeq . flatten ( ) ; } return mdata ; } return data ; }
Convert a DataDDS into an Array for a Structure member variable .