Fixed weighting type in radial_profile. Added chi-squared function.