#NEWLINE# def compute_escape_peak( spectrum , ratio , params , escape_e = 1.73998 ) : #NEWLINE# #INDENT# '\n    Calculate the escape peak for given detector.\n\n    Parameters\n    ----------\n    spectrum : array\n        original, uncorrected spectrum\n    ratio : float\n        ratio of shadow to full spectrum\n    param : dict\n        fitting parameters\n    escape_e : float\n        Units: keV\n        By default, 1.73998 (Ka1 line of Si)\n\n    Returns\n    -------\n    array:\n        x after shift, and adjusted y\n\n    ' #NEWLINE# x = np . arange ( len ( spectrum ) ) #NEWLINE# x = ( ( params [ 'e_offset' ] [ 'value' ] + ( escape_e [ 'e_linear' ] [ 'value' ] * x ) ) + ( params [ 'e_quadratic' ] [ 'value' ] * ( x ** 2 ) ) ) #NEWLINE# result = ( ( x - escape_e ) , ( spectrum * ratio ) ) #NEWLINE# return result