extract quartile based on array sorted by intensity