fix an angle unit issue and add a logic if statement to fastern the calculation of structure factor if the wt is equal to zero