A ‘Profile’ produces either a weighted (or unweighted) average or a straight sum of a field in a bin defined by two other fields. In the case of a weighted average, we have: p_i = sum( w_i * v_i ) / sum(w_i)
We accept a data_source, which will be binned into x_n_bins by the field x_bin_field between the x_lower_bound and the x_upper_bound and then again binned into y_n_bins by the field y_bin_field between the y_lower_bound and the y_upper_bound. These bins may or may not be equally divided in log-space as specified by x_log and y_log, and the lazy_reader flag controls whether we use a memory conservative approach. If end_collect is True, take all values outside the given bounds and store them in the 0 and n_bins-1 values.