As earlier, you're assuming the ordering of the arrays matches here between the data, coords and now the weights array.