Functional version of the HIPE scripts to extract photometry