Update calcAtt.py

fixed some bugs