calculate_weights function

Calculate post-stratification weights