Update analysis.py

Improve performance by lifting the radius calculation out of the file processing loop.