turned this code into a function to be called from plot_pixphasecorr.pro
working on a module to fit the light curve with a mandel_agol functional form