Data from different nights can have significantly different throughput, so weighting by exposure time is not optimal for obtaining the best signal to noise. Design a weight calculation by comparing to stars across the image and deriving an initial zero point. This will require running photometry on each frame before the image stacking step.