flux_quality_kappamax function

selecting linear slope with kappamax method