binning and flux analysis