add xray_line_mean() function