#NEWLINE# def get_frame( self , j ) : #NEWLINE# #INDENT# if ( j >= self . _len ) : #NEWLINE# #INDENT# raise ValueError ( 'Frame number {} out of range.' . format ( j ) ) #NEWLINE# #UNINDENT# self . _file . seek ( ( Spec . data_start + ( ( ( j * self . _width ) * self . _height ) * self . _file_dtype . itemsize ) ) ) #NEWLINE# data = np . fromfile ( self . _file , dtype = self . _file_dtype , count = ( self . _width * self . _height ) ) #NEWLINE# if ( data . _dtype != self . _file_dtype ) : #NEWLINE# #INDENT# data = data . astype ( self . _dtype ) #NEWLINE# #UNINDENT# return Frame ( self . process_func ( data . reshape ( self . _height , self . _width ) ) , frame_no = j , metadata = self . metadata )