Rough Working Python Code for Spot Detection