photometry code refactored into Photometer object