Example code to cluster data from different nights into lightcurves