Calibrated Scanning/scan.py code