getFrames method for reading data cubes efficiently