#NEWLINE# def __init__( self , h , x_dtype , up , down ) : #NEWLINE# #INDENT# 'Helper for resampling' #NEWLINE# h = np . asarray ( h ) #NEWLINE# if ( ( h . ndim != 1 ) or ( h . size == 0 ) ) : #NEWLINE# #INDENT# raise ValueError ( 'h must be 1D with non-zero length' ) #NEWLINE# #UNINDENT# self . _output_type = np . result_type ( h . dtype , x_dtype , np . float32 ) #NEWLINE# h = np . asarray ( h , self . _output_type ) #NEWLINE# self . _up = int ( self ) #NEWLINE# self . _down = int ( down ) #NEWLINE# if ( ( self . _up < 1 ) or ( self . _down < 1 ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Both up and down must be >= 1' ) #NEWLINE# #UNINDENT# self . _h_trans_flip = _pad_h ( h , self . _up )