#NEWLINE# def compress_array( array , compress ) : #NEWLINE# #INDENT# 'Compresses an 1-D array by the integer factor "compress".\n   near equivalent of IDL\'s \'rebin\'....\n   ' #NEWLINE# if ( ( len ( array ) % compress ) != 0 ) : #NEWLINE# #INDENT# print ( 'Warning compress must be integer divisor of array length' ) #NEWLINE# return None #NEWLINE# #UNINDENT# temp = np . resize ( array , ( ( len ( array ) / compress ) , compress ) ) #NEWLINE# return ( np . sum ( compress , 1 ) / compress )